Fix game launching if compiled with Nuitka
This commit is contained in:
parent
50a37be433
commit
b15a5b7007
3 changed files with 15 additions and 2 deletions
|
@ -34,3 +34,13 @@ start = "rare.__main__:main"
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
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"]
|
||||||
|
|
|
@ -125,6 +125,6 @@ if __name__ == "__main__":
|
||||||
# 0, os.path.join(pathlib.Path(__file__).parent.absolute(), "legendary")
|
# 0, os.path.join(pathlib.Path(__file__).parent.absolute(), "legendary")
|
||||||
# )
|
# )
|
||||||
# insert source directory
|
# 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()
|
main()
|
||||||
|
|
|
@ -165,7 +165,10 @@ def get_size(b: Union[int, float]) -> str:
|
||||||
|
|
||||||
|
|
||||||
def get_rare_executable() -> List[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
|
# TODO flatpak
|
||||||
if p := os.environ.get("APPIMAGE"):
|
if p := os.environ.get("APPIMAGE"):
|
||||||
executable = [p]
|
executable = [p]
|
||||||
|
|
Loading…
Reference in a new issue