1
0
Fork 0
mirror of synced 2024-06-21 12:00:25 +12:00

Fix game launching if compiled with Nuitka

This commit is contained in:
loathingKernel 2022-08-18 02:24:51 +03:00
parent 50a37be433
commit b15a5b7007
3 changed files with 15 additions and 2 deletions

View file

@ -34,3 +34,13 @@ start = "rare.__main__:main"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[build-system]
requires = ["setuptools>=42", "wheel", "nuitka", "toml"]
build-backend = "nuitka.distutils.Build"
[nuitka]
show-scons = true
enable-plugin = pyqt5,anti-bloat
show-anti-bloat-changes = true
nofollow-import-to = ["*.tests", "*.distutils"]

View file

@ -125,6 +125,6 @@ if __name__ == "__main__":
# 0, os.path.join(pathlib.Path(__file__).parent.absolute(), "legendary")
# )
# insert source directory
sys.path.insert(0, str(pathlib.Path(__file__).parents[1].absolute()))
#sys.path.insert(0, str(pathlib.Path(__file__).parents[1].absolute()))
main()

View file

@ -165,7 +165,10 @@ def get_size(b: Union[int, float]) -> str:
def get_rare_executable() -> List[str]:
if platform.system() == "Linux" or platform.system() == "Darwin":
# lk: detech if nuitka
if "__compiled__" in globals():
executable = [sys.executable]
elif platform.system() == "Linux" or platform.system() == "Darwin":
# TODO flatpak
if p := os.environ.get("APPIMAGE"):
executable = [p]