From 6a513a37c1d75ef18f98eca058c20648ad58de54 Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Fri, 8 Apr 2022 16:53:56 -0400 Subject: [PATCH 01/13] Remove strange 'platform' lookup in print_steam_folders I don't understand what this code was ever meant to do, but the list of paths is not a dict and does not support lookups like this. It seems to me that listing all the steam paths is probably reasonable. --- lutris/gui/application.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lutris/gui/application.py b/lutris/gui/application.py index cfbd24ca8..dbe02024e 100644 --- a/lutris/gui/application.py +++ b/lutris/gui/application.py @@ -778,8 +778,8 @@ class Application(Gtk.Application): def print_steam_folders(self, command_line): steamapps_paths = get_steamapps_paths() - for platform in ("linux", "windows"): - for path in steamapps_paths[platform] if steamapps_paths else []: + if steamapps_paths: + for path in steamapps_paths: self._print(command_line, path) def print_runners(self): From 87e14d62286f18b1f6e756a6f81753a729a49cc7 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Fri, 8 Apr 2022 17:28:35 -0700 Subject: [PATCH 02/13] Change executable name on Steam shortcuts when run from Flatpak --- lutris/util/steam/shortcut.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lutris/util/steam/shortcut.py b/lutris/util/steam/shortcut.py index 198238670..9c79a0f97 100644 --- a/lutris/util/steam/shortcut.py +++ b/lutris/util/steam/shortcut.py @@ -3,6 +3,7 @@ import binascii import os import shutil +from lutris.util.log import logger from lutris.util import resources from lutris.util.steam import vdf from lutris.util.steam.config import search_recursive_in_steam_dirs @@ -122,6 +123,10 @@ def generate_shortcut(game): gameId = game.id icon = resources.get_icon_path(slug) lutris_binary = shutil.which("lutris") + launch_options = f'lutris:rungameid/{gameId}' + if lutris_binary == "/app/bin/lutris": + lutris_binary = "flatpak" + launch_options = "run net.lutris.Lutris " + launch_options start_dir = os.path.dirname(lutris_binary) return { @@ -134,7 +139,7 @@ def generate_shortcut(game): 'Exe': f'"{lutris_binary}"', 'IsHidden': 0, 'LastPlayTime': 0, - 'LaunchOptions': f'lutris:rungameid/{gameId}', + 'LaunchOptions': f'"{launch_options}"', 'OpenVR': 0, 'ShortcutPath': '', 'StartDir': f'"{start_dir}"', @@ -165,5 +170,5 @@ def set_artwork(game): try: shutil.copyfile(source_cover, target_cover) shutil.copyfile(source_banner, target_banner) - except FileNotFoundError: - pass + except FileNotFoundError as ex: + logger.error("Failed to copy media to %s: %s", target_path, ex) From 54310f70a19cca7f5892136147ac31fa6ece9c9a Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Fri, 8 Apr 2022 17:50:12 -0700 Subject: [PATCH 03/13] Remove quotes around launch options --- lutris/util/steam/shortcut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lutris/util/steam/shortcut.py b/lutris/util/steam/shortcut.py index 9c79a0f97..6707b756a 100644 --- a/lutris/util/steam/shortcut.py +++ b/lutris/util/steam/shortcut.py @@ -139,7 +139,7 @@ def generate_shortcut(game): 'Exe': f'"{lutris_binary}"', 'IsHidden': 0, 'LastPlayTime': 0, - 'LaunchOptions': f'"{launch_options}"', + 'LaunchOptions': launch_options, 'OpenVR': 0, 'ShortcutPath': '', 'StartDir': f'"{start_dir}"', From c8fef40b4f33d2a74b04577a970675b76129d702 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Fri, 8 Apr 2022 17:55:15 -0700 Subject: [PATCH 04/13] Separate banner and cover handlers --- lutris/util/steam/shortcut.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lutris/util/steam/shortcut.py b/lutris/util/steam/shortcut.py index 6707b756a..1fb2b2602 100644 --- a/lutris/util/steam/shortcut.py +++ b/lutris/util/steam/shortcut.py @@ -169,6 +169,10 @@ def set_artwork(game): target_banner = os.path.join(target_path, target_banner) try: shutil.copyfile(source_cover, target_cover) + + except FileNotFoundError as ex: + logger.error("Failed to copy cover to %s: %s", target_cover, ex) + try: shutil.copyfile(source_banner, target_banner) except FileNotFoundError as ex: - logger.error("Failed to copy media to %s: %s", target_path, ex) + logger.error("Failed to copy banner to %s: %s", target_banner, ex) From 0076056c0591ad0fe28545f18b120884271c36b1 Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Sat, 9 Apr 2022 18:30:45 -0400 Subject: [PATCH 05/13] Use 'baseenv' not 'wineenv' when blocking It needs to be consistent, I think. This change allows 'Osu!' to install, probably other things too. --- lutris/runners/commands/wine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lutris/runners/commands/wine.py b/lutris/runners/commands/wine.py index b9629829f..babd1e42d 100644 --- a/lutris/runners/commands/wine.py +++ b/lutris/runners/commands/wine.py @@ -299,7 +299,7 @@ def wineexec( # noqa: C901 wine.prelaunch() if blocking: - return system.execute(command_parameters, env=wineenv, cwd=working_dir) + return system.execute(command_parameters, env=baseenv, cwd=working_dir) command = MonitoredCommand( command_parameters, From 2a3803deda277e4622fe677df4dbb5bc950c7509 Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Sun, 10 Apr 2022 07:37:33 -0400 Subject: [PATCH 06/13] Default fsync to on only if supported Just have the default depend on weather fsync is supported at all. --- lutris/runners/wine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lutris/runners/wine.py b/lutris/runners/wine.py index 8ae12282a..0f548ddae 100644 --- a/lutris/runners/wine.py +++ b/lutris/runners/wine.py @@ -309,7 +309,7 @@ class wine(Runner): "option": "fsync", "label": _("Enable Fsync"), "type": "extended_bool", - "default": True, + "default": is_fsync_supported(), "callback": fsync_support_callback, "callback_on": True, "active": True, From 6e5743e357eb4b00f044bdb5234758cb22ba1a09 Mon Sep 17 00:00:00 2001 From: riQQ Date: Mon, 11 Apr 2022 12:37:05 +0200 Subject: [PATCH 07/13] Fix lint error about order of imports --- lutris/util/steam/shortcut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lutris/util/steam/shortcut.py b/lutris/util/steam/shortcut.py index 1fb2b2602..2539ae323 100644 --- a/lutris/util/steam/shortcut.py +++ b/lutris/util/steam/shortcut.py @@ -3,8 +3,8 @@ import binascii import os import shutil -from lutris.util.log import logger from lutris.util import resources +from lutris.util.log import logger from lutris.util.steam import vdf from lutris.util.steam.config import search_recursive_in_steam_dirs From 77c978ae53e9665a23eccf81ac306f190d034a9a Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Thu, 7 Apr 2022 23:14:18 +0200 Subject: [PATCH 08/13] Remove keyring dependency The file util/keyring.py is not imported anywhere and the keyring dependency has a big chain of dependencies. --- .isort.cfg | 1 - lutris/util/keyring.py | 13 --- po/POTFILES | 1 - poetry.lock | 188 +---------------------------------------- pyproject.toml | 1 - 5 files changed, 3 insertions(+), 201 deletions(-) delete mode 100644 lutris/util/keyring.py diff --git a/.isort.cfg b/.isort.cfg index 32ae48e43..fa2f31926 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -3,7 +3,6 @@ line_length=120 multi_line_output=6 skip= application.py, - keyring.py ;known_deps = ;known_third_party = known_first_party = lutris diff --git a/lutris/util/keyring.py b/lutris/util/keyring.py deleted file mode 100644 index 35912341a..000000000 --- a/lutris/util/keyring.py +++ /dev/null @@ -1,13 +0,0 @@ -# Third Party Libraries -import keyring -from keyring.errors import PasswordSetError - -KEYRING_NAME = "??" - - -def store_credentials(username, password): - try: - keyring.set_password("Lutris", username, password) - return True - except PasswordSetError: - return False diff --git a/po/POTFILES b/po/POTFILES index 7cb0eb073..f3a4e9a3a 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -182,7 +182,6 @@ lutris/util/i18n.py lutris/util/__init__.py lutris/util/jobs.py lutris/util/joypad.py -lutris/util/keyring.py lutris/util/libretro.py lutris/util/linux.py lutris/util/log.py diff --git a/poetry.lock b/poetry.lock index 255c19e66..96338551f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -96,17 +96,6 @@ category = "main" optional = false python-versions = "*" -[[package]] -name = "cffi" -version = "1.15.0" -description = "Foreign Function Interface for Python calling C code." -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -pycparser = "*" - [[package]] name = "chardet" version = "4.0.0" @@ -157,25 +146,6 @@ python-versions = ">=3.7" [package.extras] toml = ["tomli"] -[[package]] -name = "cryptography" -version = "36.0.2" -description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -cffi = ">=1.12" - -[package.extras] -docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"] -docstest = ["pyenchant (>=1.6.11)", "twine (>=1.12.0)", "sphinxcontrib-spelling (>=4.0.1)"] -pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"] -sdist = ["setuptools_rust (>=0.11.4)"] -ssh = ["bcrypt (>=3.1.5)"] -test = ["pytest (>=6.2.0)", "pytest-cov", "pytest-subtests", "pytest-xdist", "pretend", "iso8601", "pytz", "hypothesis (>=1.11.4,!=3.79.2)"] - [[package]] name = "dbus-python" version = "1.2.18" @@ -273,7 +243,7 @@ python-versions = ">=3.5" name = "importlib-metadata" version = "4.2.0" description = "Read metadata from Python packages" -category = "main" +category = "dev" optional = false python-versions = ">=3.6" @@ -307,36 +277,6 @@ requirements_deprecated_finder = ["pipreqs", "pip-api"] colors = ["colorama (>=0.4.3,<0.5.0)"] plugins = ["setuptools"] -[[package]] -name = "jeepney" -version = "0.7.1" -description = "Low-level, pure Python DBus protocol wrapper." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.extras] -test = ["pytest", "pytest-trio", "pytest-asyncio", "testpath", "trio", "async-timeout"] -trio = ["trio", "async-generator"] - -[[package]] -name = "keyring" -version = "23.5.0" -description = "Store and access your passwords safely." -category = "main" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -importlib-metadata = ">=3.6" -jeepney = {version = ">=0.4.2", markers = "sys_platform == \"linux\""} -pywin32-ctypes = {version = "<0.1.0 || >0.1.0,<0.1.1 || >0.1.1", markers = "sys_platform == \"win32\""} -SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""} - -[package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "jaraco.tidelift (>=1.4)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-black (>=0.3.7)", "pytest-mypy"] - [[package]] name = "lazy-object-proxy" version = "1.7.1" @@ -496,14 +436,6 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -[[package]] -name = "pycparser" -version = "2.21" -description = "C parser in Python" -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - [[package]] name = "pyflakes" version = "2.4.0" @@ -606,14 +538,6 @@ python-versions = ">=3.7" [package.dependencies] tokenize-rt = ">=3.2.0" -[[package]] -name = "pywin32-ctypes" -version = "0.2.0" -description = "" -category = "main" -optional = false -python-versions = "*" - [[package]] name = "pyyaml" version = "6.0" @@ -654,18 +578,6 @@ dparse = ">=0.5.1" packaging = "*" requests = "*" -[[package]] -name = "secretstorage" -version = "3.3.1" -description = "Python bindings to FreeDesktop.org Secret Service API" -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -cryptography = ">=2.0" -jeepney = ">=0.6" - [[package]] name = "six" version = "1.16.0" @@ -759,7 +671,7 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" name = "zipp" version = "3.7.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" @@ -770,7 +682,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "b7e81f5d72f39dfd45012d85222b2accda1963ac19511d39ae741b294cbe8716" +content-hash = "b42de684b75cbd472512d6cfc953cd18dcf5a9a44010eb3b791321a627407159" [metadata.files] astroid = [ @@ -822,58 +734,6 @@ certifi = [ {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"}, {file = "certifi-2021.10.8.tar.gz", hash = "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"}, ] -cffi = [ - {file = "cffi-1.15.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:c2502a1a03b6312837279c8c1bd3ebedf6c12c4228ddbad40912d671ccc8a962"}, - {file = "cffi-1.15.0-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:23cfe892bd5dd8941608f93348c0737e369e51c100d03718f108bf1add7bd6d0"}, - {file = "cffi-1.15.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:41d45de54cd277a7878919867c0f08b0cf817605e4eb94093e7516505d3c8d14"}, - {file = "cffi-1.15.0-cp27-cp27m-win32.whl", hash = "sha256:4a306fa632e8f0928956a41fa8e1d6243c71e7eb59ffbd165fc0b41e316b2474"}, - {file = "cffi-1.15.0-cp27-cp27m-win_amd64.whl", hash = "sha256:e7022a66d9b55e93e1a845d8c9eba2a1bebd4966cd8bfc25d9cd07d515b33fa6"}, - {file = "cffi-1.15.0-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:14cd121ea63ecdae71efa69c15c5543a4b5fbcd0bbe2aad864baca0063cecf27"}, - {file = "cffi-1.15.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d4d692a89c5cf08a8557fdeb329b82e7bf609aadfaed6c0d79f5a449a3c7c023"}, - {file = "cffi-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0104fb5ae2391d46a4cb082abdd5c69ea4eab79d8d44eaaf79f1b1fd806ee4c2"}, - {file = "cffi-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:91ec59c33514b7c7559a6acda53bbfe1b283949c34fe7440bcf917f96ac0723e"}, - {file = "cffi-1.15.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:f5c7150ad32ba43a07c4479f40241756145a1f03b43480e058cfd862bf5041c7"}, - {file = "cffi-1.15.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:00c878c90cb53ccfaae6b8bc18ad05d2036553e6d9d1d9dbcf323bbe83854ca3"}, - {file = "cffi-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:abb9a20a72ac4e0fdb50dae135ba5e77880518e742077ced47eb1499e29a443c"}, - {file = "cffi-1.15.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a5263e363c27b653a90078143adb3d076c1a748ec9ecc78ea2fb916f9b861962"}, - {file = "cffi-1.15.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f54a64f8b0c8ff0b64d18aa76675262e1700f3995182267998c31ae974fbc382"}, - {file = "cffi-1.15.0-cp310-cp310-win32.whl", hash = "sha256:c21c9e3896c23007803a875460fb786118f0cdd4434359577ea25eb556e34c55"}, - {file = "cffi-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:5e069f72d497312b24fcc02073d70cb989045d1c91cbd53979366077959933e0"}, - {file = "cffi-1.15.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:64d4ec9f448dfe041705426000cc13e34e6e5bb13736e9fd62e34a0b0c41566e"}, - {file = "cffi-1.15.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2756c88cbb94231c7a147402476be2c4df2f6078099a6f4a480d239a8817ae39"}, - {file = "cffi-1.15.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b96a311ac60a3f6be21d2572e46ce67f09abcf4d09344c49274eb9e0bf345fc"}, - {file = "cffi-1.15.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75e4024375654472cc27e91cbe9eaa08567f7fbdf822638be2814ce059f58032"}, - {file = "cffi-1.15.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:59888172256cac5629e60e72e86598027aca6bf01fa2465bdb676d37636573e8"}, - {file = "cffi-1.15.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:27c219baf94952ae9d50ec19651a687b826792055353d07648a5695413e0c605"}, - {file = "cffi-1.15.0-cp36-cp36m-win32.whl", hash = "sha256:4958391dbd6249d7ad855b9ca88fae690783a6be9e86df65865058ed81fc860e"}, - {file = "cffi-1.15.0-cp36-cp36m-win_amd64.whl", hash = "sha256:f6f824dc3bce0edab5f427efcfb1d63ee75b6fcb7282900ccaf925be84efb0fc"}, - {file = "cffi-1.15.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:06c48159c1abed75c2e721b1715c379fa3200c7784271b3c46df01383b593636"}, - {file = "cffi-1.15.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:c2051981a968d7de9dd2d7b87bcb9c939c74a34626a6e2f8181455dd49ed69e4"}, - {file = "cffi-1.15.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:fd8a250edc26254fe5b33be00402e6d287f562b6a5b2152dec302fa15bb3e997"}, - {file = "cffi-1.15.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:91d77d2a782be4274da750752bb1650a97bfd8f291022b379bb8e01c66b4e96b"}, - {file = "cffi-1.15.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:45db3a33139e9c8f7c09234b5784a5e33d31fd6907800b316decad50af323ff2"}, - {file = "cffi-1.15.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:263cc3d821c4ab2213cbe8cd8b355a7f72a8324577dc865ef98487c1aeee2bc7"}, - {file = "cffi-1.15.0-cp37-cp37m-win32.whl", hash = "sha256:17771976e82e9f94976180f76468546834d22a7cc404b17c22df2a2c81db0c66"}, - {file = "cffi-1.15.0-cp37-cp37m-win_amd64.whl", hash = "sha256:3415c89f9204ee60cd09b235810be700e993e343a408693e80ce7f6a40108029"}, - {file = "cffi-1.15.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:4238e6dab5d6a8ba812de994bbb0a79bddbdf80994e4ce802b6f6f3142fcc880"}, - {file = "cffi-1.15.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0808014eb713677ec1292301ea4c81ad277b6cdf2fdd90fd540af98c0b101d20"}, - {file = "cffi-1.15.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:57e9ac9ccc3101fac9d6014fba037473e4358ef4e89f8e181f8951a2c0162024"}, - {file = "cffi-1.15.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b6c2ea03845c9f501ed1313e78de148cd3f6cad741a75d43a29b43da27f2e1e"}, - {file = "cffi-1.15.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:10dffb601ccfb65262a27233ac273d552ddc4d8ae1bf93b21c94b8511bffe728"}, - {file = "cffi-1.15.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:786902fb9ba7433aae840e0ed609f45c7bcd4e225ebb9c753aa39725bb3e6ad6"}, - {file = "cffi-1.15.0-cp38-cp38-win32.whl", hash = "sha256:da5db4e883f1ce37f55c667e5c0de439df76ac4cb55964655906306918e7363c"}, - {file = "cffi-1.15.0-cp38-cp38-win_amd64.whl", hash = "sha256:181dee03b1170ff1969489acf1c26533710231c58f95534e3edac87fff06c443"}, - {file = "cffi-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:45e8636704eacc432a206ac7345a5d3d2c62d95a507ec70d62f23cd91770482a"}, - {file = "cffi-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:31fb708d9d7c3f49a60f04cf5b119aeefe5644daba1cd2a0fe389b674fd1de37"}, - {file = "cffi-1.15.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:6dc2737a3674b3e344847c8686cf29e500584ccad76204efea14f451d4cc669a"}, - {file = "cffi-1.15.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:74fdfdbfdc48d3f47148976f49fab3251e550a8720bebc99bf1483f5bfb5db3e"}, - {file = "cffi-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffaa5c925128e29efbde7301d8ecaf35c8c60ffbcd6a1ffd3a552177c8e5e796"}, - {file = "cffi-1.15.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3f7d084648d77af029acb79a0ff49a0ad7e9d09057a9bf46596dac9514dc07df"}, - {file = "cffi-1.15.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ef1f279350da2c586a69d32fc8733092fd32cc8ac95139a00377841f59a3f8d8"}, - {file = "cffi-1.15.0-cp39-cp39-win32.whl", hash = "sha256:2a23af14f408d53d5e6cd4e3d9a24ff9e05906ad574822a10563efcef137979a"}, - {file = "cffi-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139"}, - {file = "cffi-1.15.0.tar.gz", hash = "sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"}, -] chardet = [ {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"}, {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"}, @@ -933,28 +793,6 @@ coverage = [ {file = "coverage-6.3.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:18d520c6860515a771708937d2f78f63cc47ab3b80cb78e86573b0a760161faf"}, {file = "coverage-6.3.2.tar.gz", hash = "sha256:03e2a7826086b91ef345ff18742ee9fc47a6839ccd517061ef8fa1976e652ce9"}, ] -cryptography = [ - {file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:4e2dddd38a5ba733be6a025a1475a9f45e4e41139d1321f412c6b360b19070b6"}, - {file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:4881d09298cd0b669bb15b9cfe6166f16fc1277b4ed0d04a22f3d6430cb30f1d"}, - {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ea634401ca02367c1567f012317502ef3437522e2fc44a3ea1844de028fa4b84"}, - {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:7be666cc4599b415f320839e36367b273db8501127b38316f3b9f22f17a0b815"}, - {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8241cac0aae90b82d6b5c443b853723bcc66963970c67e56e71a2609dc4b5eaf"}, - {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b2d54e787a884ffc6e187262823b6feb06c338084bbe80d45166a1cb1c6c5bf"}, - {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:c2c5250ff0d36fd58550252f54915776940e4e866f38f3a7866d92b32a654b86"}, - {file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:ec6597aa85ce03f3e507566b8bcdf9da2227ec86c4266bd5e6ab4d9e0cc8dab2"}, - {file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ca9f686517ec2c4a4ce930207f75c00bf03d94e5063cbc00a1dc42531511b7eb"}, - {file = "cryptography-36.0.2-cp36-abi3-win32.whl", hash = "sha256:f64b232348ee82f13aac22856515ce0195837f6968aeaa94a3d0353ea2ec06a6"}, - {file = "cryptography-36.0.2-cp36-abi3-win_amd64.whl", hash = "sha256:53e0285b49fd0ab6e604f4c5d9c5ddd98de77018542e88366923f152dbeb3c29"}, - {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:32db5cc49c73f39aac27574522cecd0a4bb7384e71198bc65a0d23f901e89bb7"}, - {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b3d199647468d410994dbeb8cec5816fb74feb9368aedf300af709ef507e3e"}, - {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:da73d095f8590ad437cd5e9faf6628a218aa7c387e1fdf67b888b47ba56a17f0"}, - {file = "cryptography-36.0.2-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:0a3bf09bb0b7a2c93ce7b98cb107e9170a90c51a0162a20af1c61c765b90e60b"}, - {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8897b7b7ec077c819187a123174b645eb680c13df68354ed99f9b40a50898f77"}, - {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82740818f2f240a5da8dfb8943b360e4f24022b093207160c77cadade47d7c85"}, - {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:1f64a62b3b75e4005df19d3b5235abd43fa6358d5516cfc43d87aeba8d08dd51"}, - {file = "cryptography-36.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e167b6b710c7f7bc54e67ef593f8731e1f45aa35f8a8a7b72d6e42ec76afd4b3"}, - {file = "cryptography-36.0.2.tar.gz", hash = "sha256:70f8f4f7bb2ac9f340655cbac89d68c527af5bb4387522a8413e841e3e6628c9"}, -] dbus-python = [ {file = "dbus-python-1.2.18.tar.gz", hash = "sha256:92bdd1e68b45596c833307a5ff4b217ee6929a1502f5341bae28fd120acf7260"}, ] @@ -1001,14 +839,6 @@ isort = [ {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, ] -jeepney = [ - {file = "jeepney-0.7.1-py3-none-any.whl", hash = "sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac"}, - {file = "jeepney-0.7.1.tar.gz", hash = "sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f"}, -] -keyring = [ - {file = "keyring-23.5.0-py3-none-any.whl", hash = "sha256:b0d28928ac3ec8e42ef4cc227822647a19f1d544f21f96457965dc01cf555261"}, - {file = "keyring-23.5.0.tar.gz", hash = "sha256:9012508e141a80bd1c0b6778d5c610dd9f8c464d75ac6774248500503f972fb9"}, -] lazy-object-proxy = [ {file = "lazy-object-proxy-1.7.1.tar.gz", hash = "sha256:d609c75b986def706743cdebe5e47553f4a5a1da9c5ff66d76013ef396b5a8a4"}, {file = "lazy_object_proxy-1.7.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bb8c5fd1684d60a9902c60ebe276da1f2281a318ca16c1d0a96db28f62e9166b"}, @@ -1224,10 +1054,6 @@ pycodestyle = [ {file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"}, {file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"}, ] -pycparser = [ - {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, - {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, -] pyflakes = [ {file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"}, {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, @@ -1259,10 +1085,6 @@ pyupgrade = [ {file = "pyupgrade-2.31.1-py2.py3-none-any.whl", hash = "sha256:4060a7c20c79d373a3dcf34566b275c6de6cd2b034ad22465d3263fb0de82648"}, {file = "pyupgrade-2.31.1.tar.gz", hash = "sha256:22e0ad6dd39c4381805cb059f1e691b6315c62c0ebcec98a5f29d22cd186a72a"}, ] -pywin32-ctypes = [ - {file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"}, - {file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"}, -] pyyaml = [ {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, @@ -1306,10 +1128,6 @@ safety = [ {file = "safety-1.10.3-py2.py3-none-any.whl", hash = "sha256:5f802ad5df5614f9622d8d71fedec2757099705c2356f862847c58c6dfe13e84"}, {file = "safety-1.10.3.tar.gz", hash = "sha256:30e394d02a20ac49b7f65292d19d38fa927a8f9582cdfd3ad1adbbc66c641ad5"}, ] -secretstorage = [ - {file = "SecretStorage-3.3.1-py3-none-any.whl", hash = "sha256:422d82c36172d88d6a0ed5afdec956514b189ddbfb72fefab0c8a1cee4eaf71f"}, - {file = "SecretStorage-3.3.1.tar.gz", hash = "sha256:fd666c51a6bf200643495a04abb261f83229dcb6fd8472ec393df7ffc8b6f195"}, -] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, diff --git a/pyproject.toml b/pyproject.toml index fe2ba4285..7f1f5db1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,6 @@ requests = '>=2.23' six = '>=1.14' urllib3 = '>=1.25' wrapt = '>=1.11' -keyring = "*" lxml = '>=4.5.2' Pillow = '>=9.0.1' distro = {version = "^1.7.0", platform = "linux"} From 84468154408e75fcb6838c6db4e1181d3576de08 Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Tue, 5 Apr 2022 18:21:05 -0400 Subject: [PATCH 09/13] Try make take steam shortcuts more tolerant I think that sometimes the appname is listed as 'appname', in lower-case. This checks for that, and also avoids the crash if there is no app name anyway. --- lutris/util/steam/shortcut.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lutris/util/steam/shortcut.py b/lutris/util/steam/shortcut.py index 2539ae323..0d57ea451 100644 --- a/lutris/util/steam/shortcut.py +++ b/lutris/util/steam/shortcut.py @@ -33,7 +33,7 @@ def shortcut_exists(game, shortcut_path): shortcuts = vdf.binary_loads(shortcut_file.read())['shortcuts'].values() shortcut_found = [ s for s in shortcuts - if game.name in s['AppName'] + if matches_appname(s, game) ] if not shortcut_found: return False @@ -48,7 +48,7 @@ def all_shortcuts_set(game): shortcuts = vdf.binary_loads(shortcut_file.read())['shortcuts'].values() shortcut_found = [ s for s in shortcuts - if game.name in s['AppName'] + if matches_appname(s, game) ] shortcuts_found += len(shortcut_found) @@ -98,7 +98,7 @@ def remove_shortcut(game, shortcut_path): shortcuts = vdf.binary_loads(shortcut_file.read())['shortcuts'].values() shortcut_found = [ s for s in shortcuts - if game.name in s['AppName'] + if matches_appname(s, game) ] if not shortcut_found: @@ -106,7 +106,7 @@ def remove_shortcut(game, shortcut_path): other_shortcuts = [ s for s in shortcuts - if game.name not in s['AppName'] + if not matches_appname(s, game) ] updated_shortcuts = { 'shortcuts': { @@ -150,6 +150,12 @@ def generate_shortcut(game): } +def matches_appname(shortcut, game): + """Test if the game seems to be the a shortcut refers to.""" + appname = shortcut.get('AppName') or shortcut.get('appname') + return appname and game.name in appname + + def get_steam_shortcut_id(game): lutris_binary = shutil.which("lutris") exe = f'"{lutris_binary}"' From cc5e77f25225721248b859fbe6d0fc01b93049d0 Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Wed, 6 Apr 2022 04:36:43 -0400 Subject: [PATCH 10/13] Fix comment type-o --- lutris/util/steam/shortcut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lutris/util/steam/shortcut.py b/lutris/util/steam/shortcut.py index 0d57ea451..61cca7e0c 100644 --- a/lutris/util/steam/shortcut.py +++ b/lutris/util/steam/shortcut.py @@ -151,7 +151,7 @@ def generate_shortcut(game): def matches_appname(shortcut, game): - """Test if the game seems to be the a shortcut refers to.""" + """Test if the game seems to be the one a shortcut refers to.""" appname = shortcut.get('AppName') or shortcut.get('appname') return appname and game.name in appname From 1a8a98aff1b0fc528d07983a14fa48eef5a9bd6c Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Tue, 15 Mar 2022 11:06:32 +0100 Subject: [PATCH 11/13] meson: Validate metainfo and desktop file --- meson.build | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 50dfad0b3..e0846a661 100644 --- a/meson.build +++ b/meson.build @@ -60,7 +60,7 @@ install_man( install_dir: join_paths(mandir, 'man1'), ) -i18n.merge_file( +desktop_file = i18n.merge_file( input: files('share/applications/net.lutris.Lutris.desktop'), output: 'net.lutris.Lutris.desktop', type: 'desktop', @@ -69,7 +69,17 @@ i18n.merge_file( install_dir: join_paths(datadir, 'applications'), ) -i18n.merge_file( +# Validate the desktop file +desktop_file_validate = find_program('desktop-file-validate', required:false) +if desktop_file_validate.found() + test ( + 'Validate desktop file', + desktop_file_validate, + args: [ desktop_file.full_path() ], + ) +endif + +metainfo_file = i18n.merge_file( input: files('share/metainfo/net.lutris.Lutris.metainfo.xml'), output: 'net.lutris.Lutris.metainfo.xml', type: 'xml', @@ -77,3 +87,13 @@ i18n.merge_file( install: true, install_dir: join_paths(datadir, 'metainfo'), ) + +# Validate the metainfo file +appstreamcli = find_program('appstream-util', required: false) +if appstreamcli.found() + test ( + 'Validate metainfo file', + appstreamcli, + args: ['validate-relax', '--nonet', metainfo_file.full_path() ] + ) +endif From dc1be9c871a975e4e26e6b45a4190b8c01e7d6b7 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Tue, 15 Mar 2022 11:07:05 +0100 Subject: [PATCH 12/13] meson: Use glib preset for i18n.gettext It takes into account multiple glibisms. --- po/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/po/meson.build b/po/meson.build index d9b49841a..4630b2141 100644 --- a/po/meson.build +++ b/po/meson.build @@ -2,6 +2,5 @@ i18n = import('i18n') i18n.gettext( 'lutris', - install_dir: localedir, - args: '--from-code=UTF-8' + preset: 'glib', ) From f52a7308bfc264a7c3b9a83f2b47e2f1cc96cfc9 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Tue, 15 Mar 2022 11:16:37 +0100 Subject: [PATCH 13/13] meson: Add post install scrip Makes sure the icons and desktop file are installed --- meson.build | 2 ++ utils/meson_post_install.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 utils/meson_post_install.py diff --git a/meson.build b/meson.build index e0846a661..f0f398d8c 100644 --- a/meson.build +++ b/meson.build @@ -97,3 +97,5 @@ if appstreamcli.found() args: ['validate-relax', '--nonet', metainfo_file.full_path() ] ) endif + +meson.add_install_script('utils/meson_post_install.py') diff --git a/utils/meson_post_install.py b/utils/meson_post_install.py new file mode 100644 index 000000000..bf964f53e --- /dev/null +++ b/utils/meson_post_install.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +from os import environ, path +from subprocess import call + +prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') +datadir = path.join(prefix, 'share') +destdir = environ.get('DESTDIR', '') + +# Package managers set this so we don't need to run +if not destdir: + print('Updating icon cache...') + call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) + + print('Updating desktop database...') + call(['update-desktop-database', '-q', path.join(datadir, 'applications')])