3 Commits

Author SHA1 Message Date
a836dd31e2 fix exec path
All checks were successful
Linux arm64 / Build (push) Successful in 2m13s
2025-07-29 21:36:18 +02:00
94e5450a74 fix icon path 2025-07-29 21:36:01 +02:00
7977fb976b nsis packaging
All checks were successful
Linux arm64 / Build (push) Successful in 2m16s
2025-07-29 21:13:10 +02:00
5 changed files with 40 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -10,7 +10,7 @@
[[nodiscard]] bool resetKeybindFile(int layout);
int main() {
int main(int arc, char** args) {
std::srand(std::time(NULL));
bool everythingIsOK = true;

View File

@@ -1,10 +1,36 @@
#include "AssetManager.h"
#ifdef _WIN32
#include <windows.h> //GetModuleFileNameW
#else
#include <limits.h>
#include <unistd.h> //readlink
#endif
namespace fs = std::filesystem;
static std::string getEnv(const std::string& var) {
static fs::path getExeDirectory(){
#ifdef _WIN32
wchar_t path[MAX_PATH] = { 0 };
GetModuleFileNameW(NULL, path, MAX_PATH);
return path;
#else
char result[PATH_MAX];
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
return std::string(result, (count > 0) ? count : 0);
#endif
}
static fs::path getEnv(const std::string& var) {
char* env = std::getenv(var.c_str());
return env ? env : "";
return env ? env :
#ifdef JMINOS_IGNORE_WORKDIR
getExeDirectory().parent_path().parent_path();
#else
"";
#endif
}
fs::path AssetManager::getResourcePath(const std::string& resource) {

View File

@@ -11,6 +11,7 @@ option_end()
if has_config("external_build") then
add_requires("sfml 3.0.0", "zlib", {system = false})
add_defines("JMINOS_IGNORE_WORKDIR")
else
add_requires("sfml 3.0.0", "zlib")
end
@@ -52,7 +53,7 @@ if is_plat("mingw") then
add_ldflags("-static-libstdc++", "-static")
end
includes("./xpack.lua")
includes("xmake/xpack.lua")
--
-- If you want to known more usage about xmake, please see https://xmake.io

View File

@@ -10,24 +10,27 @@ xpack("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 install org.flatpak.Builder --user -y")
os.exec("flatpak run org.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)
on_load(function (package)
package:set("basename", package:name() .. "-v" .. package:version() .. "-" .. package:arch())
end)
else
xpack("jminos")
set_formats("zip")
set_formats("zip", "nsis")
add_targets("graph")
add_installfiles("(data/**.png)")
on_load(function (package)
set_iconfile("../flatpak/org.zulianc.jminos.ico")
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
end