small fix for developing on NixOS

adds a small condititon before finding a system-wide wine istallation because `/usr/lib` doesn't exist on NixOS
This commit is contained in:
Zitrone 2024-07-30 19:35:14 +02:00
parent 85082abc80
commit 739f075a10
No known key found for this signature in database
GPG key ID: 54767E8E66ABED22
2 changed files with 8 additions and 5 deletions

2
.gitignore vendored
View file

@ -16,6 +16,8 @@ pga.db
tests/coverage/*
/dist
/lutris.egg-info
/flake.nix
/flake.lock
# meson builddirs
builddir

View file

@ -24,11 +24,12 @@ WINE_PATHS: Dict[str, str] = {
# Insert additional system-wide Wine installations.
try:
for _candidate in os.listdir("/usr/lib/"):
if _candidate.startswith("wine-"):
_wine_path = os.path.join("/usr/lib/", _candidate, "bin/wine")
if os.path.isfile(_wine_path):
WINE_PATHS["System " + _candidate] = _wine_path
if system.path_exists("/usr/lib"):
for _candidate in os.listdir("/usr/lib/"):
if _candidate.startswith("wine-"):
_wine_path = os.path.join("/usr/lib/", _candidate, "bin/wine")
if os.path.isfile(_wine_path):
WINE_PATHS["System " + _candidate] = _wine_path
_candidate = None
_wine_path = None
except Exception as ex: