From 9208a5750dfb0827e1794f611e869c5395c640e3 Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Mon, 28 Jul 2025 10:29:42 +0200 Subject: [PATCH] zip windows packing --- xmake.lua | 15 +-------------- xpack.lua | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 xpack.lua diff --git a/xmake.lua b/xmake.lua index 5ab205d..a053819 100644 --- a/xmake.lua +++ b/xmake.lua @@ -52,20 +52,7 @@ if is_plat("mingw") then add_ldflags("-static-libstdc++", "-static") end -xpack("jminos") - set_formats("flatpak") - set_extension("") - set_title("jminos") - set_author("zulianc") - set_description("A test installer.") - set_homepage("https://git.ale-pri.com/TetrisNerd/jminos") - set_company("org.zulianc") - on_package(function (package) - os.cd("flatpak") - os.exec("flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir org.zulianc.jminos.yml") - os.exec("flatpak build-bundle repo jminos.flatpak org.zulianc.jminos --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo") - os.mv("jminos.flatpak", package:outputdir()) - end) +includes("./xpack.lua") -- -- If you want to known more usage about xmake, please see https://xmake.io diff --git a/xpack.lua b/xpack.lua new file mode 100644 index 0000000..c000afc --- /dev/null +++ b/xpack.lua @@ -0,0 +1,33 @@ +if is_os("linux") then + +xpack("jminos") + set_formats("flatpak") + set_extension("flatpak") + set_title("jminos") + set_author("zulianc") + set_description("A test installer.") + set_homepage("https://git.ale-pri.com/TetrisNerd/jminos") + set_company("org.zulianc") + on_package(function (package) + os.cd("flatpak") + os.exec("flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir org.zulianc.jminos.yml") + os.exec("flatpak build-bundle repo jminos.flatpak org.zulianc.jminos --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo") + os.mv("jminos.flatpak", package:outputdir()) + end) + +else + +xpack("jminos") + set_formats("zip") + add_targets("graph") + add_installfiles("(data/**.png)") + on_load(function (package) + package:set("basename", package:name() .. "-v" .. package:version() .. "-" .. package:arch()) + end) + after_installcmd(function (package, batchcmds) + batchcmds:mv(path.join(package:installdir("bin"), "*"), package:installdir()) + batchcmds:rm(package:installdir("bin")) + batchcmds:rm(package:installdir("**/.gitkeep")) + end) + +end \ No newline at end of file