From 2df0c2aae5a7ad685fa21da91007d1a89538f722 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 6 Sep 2021 10:37:35 -0400 Subject: [PATCH] =?UTF-8?q?protontricks:=201.5.2=20=E2=86=92=201.6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../protontricks/default.nix | 31 +++-- .../protontricks/steam-run.patch | 118 +++++++++--------- pkgs/top-level/all-packages.nix | 10 +- 3 files changed, 89 insertions(+), 70 deletions(-) diff --git a/pkgs/tools/package-management/protontricks/default.nix b/pkgs/tools/package-management/protontricks/default.nix index cbe10e85f667..99751c00d99c 100644 --- a/pkgs/tools/package-management/protontricks/default.nix +++ b/pkgs/tools/package-management/protontricks/default.nix @@ -2,23 +2,24 @@ , buildPythonApplication , fetchFromGitHub , setuptools-scm +, setuptools , vdf , bash , steam-run , winetricks -, zenity +, yad , pytestCheckHook }: buildPythonApplication rec { pname = "protontricks"; - version = "1.5.2"; + version = "1.6.0"; src = fetchFromGitHub { owner = "Matoking"; repo = pname; rev = version; - hash = "sha256-Vmxb8SjPhcSqFzykHRPsLtAoSwomN+se+icwHkucbX8="; + hash = "sha256-sbYIqVsuDZ2Htb6SVIe/gBA1UIvUzu4fjTjWQ7k1WFs="; }; patches = [ @@ -27,23 +28,31 @@ buildPythonApplication rec { ]; SETUPTOOLS_SCM_PRETEND_VERSION = version; + nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ vdf ]; + + propagatedBuildInputs = [ + setuptools # implicit dependency, used to find data/icon_placeholder.png + vdf + ]; makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ bash steam-run - (winetricks.override { - # Remove default build of wine to reduce closure size. - # Falls back to wine in PATH when --no-runtime is passed. - wine = null; - }) - zenity + winetricks + yad ]}" ]; checkInputs = [ pytestCheckHook ]; + + # From 1.6.0 release notes (https://github.com/Matoking/protontricks/releases/tag/1.6.0): + # In most cases the script is unnecessary and should be removed as part of the packaging process. + postInstall = '' + rm "$out/bin/protontricks-desktop-install" + ''; + pythonImportsCheck = [ "protontricks" ]; meta = with lib; { @@ -51,6 +60,6 @@ buildPythonApplication rec { homepage = "https://github.com/Matoking/protontricks"; license = licenses.gpl3Only; maintainers = with maintainers; [ kira-bruneau ]; - platforms = platforms.linux; + platforms = [ "x86_64-linux" "i686-linux" ]; }; } diff --git a/pkgs/tools/package-management/protontricks/steam-run.patch b/pkgs/tools/package-management/protontricks/steam-run.patch index 82ddec1abb89..0144160c5af8 100644 --- a/pkgs/tools/package-management/protontricks/steam-run.patch +++ b/pkgs/tools/package-management/protontricks/steam-run.patch @@ -1,31 +1,31 @@ -diff --git a/src/protontricks/cli.py b/src/protontricks/cli.py -index cc65a03..5c3fc7a 100755 ---- a/src/protontricks/cli.py -+++ b/src/protontricks/cli.py -@@ -15,8 +15,8 @@ import sys +diff --git a/src/protontricks/cli/main.py b/src/protontricks/cli/main.py +index 535ec9b..690c1f9 100755 +--- a/src/protontricks/cli/main.py ++++ b/src/protontricks/cli/main.py +@@ -14,8 +14,8 @@ import sys - from . import __version__ - from .gui import select_steam_app_with_gui --from .steam import (find_legacy_steam_runtime_path, find_proton_app, -- find_steam_path, get_steam_apps, get_steam_lib_paths) -+from .steam import (find_proton_app, find_steam_path, get_steam_apps, -+ get_steam_lib_paths) - from .util import run_command, is_flatpak_sandbox - from .winetricks import get_winetricks_path - -@@ -77,8 +77,7 @@ def main(args=None): + from .. import __version__ + from ..gui import select_steam_app_with_gui +-from ..steam import (find_legacy_steam_runtime_path, find_proton_app, +- find_steam_path, get_steam_apps, get_steam_lib_paths) ++from ..steam import (find_proton_app, find_steam_path, get_steam_apps, ++ get_steam_lib_paths) + from ..util import is_flatpak_sandbox, run_command + from ..winetricks import get_winetricks_path + from .util import (CustomArgumentParser, cli_error_handler, enable_logging, +@@ -60,8 +60,7 @@ def main(args=None): "WINE: path to a custom 'wine' executable\n" "WINESERVER: path to a custom 'wineserver' executable\n" "STEAM_RUNTIME: 1 = enable Steam Runtime, 0 = disable Steam " - "Runtime, valid path = custom Steam Runtime path, " -- "empty = enable automatically (default)" -+ "Runtime, empty = enable automatically (default)" +- "empty = enable automatically (default)\n" ++ "Runtime, empty = enable automatically (default)\n" + "PROTONTRICKS_GUI: GUI provider to use, accepts either 'yad' " + "or 'zenity'" ), - formatter_class=argparse.RawTextHelpFormatter - ) -@@ -148,18 +147,9 @@ def main(args=None): - ) - sys.exit(-1) +@@ -147,17 +146,9 @@ def main(args=None): + if not steam_path: + exit_("Steam installation directory could not be found.") - # 2. Find the pre-installed legacy Steam Runtime if enabled - legacy_steam_runtime_path = None @@ -38,13 +38,12 @@ index cc65a03..5c3fc7a 100755 - ) - - if not legacy_steam_runtime_path: -- print("Steam Runtime was enabled but couldn't be found!") -- sys.exit(-1) +- exit_("Steam Runtime was enabled but couldn't be found!") + use_steam_runtime = True else: use_steam_runtime = False logger.info("Steam Runtime disabled.") -@@ -222,7 +212,6 @@ def main(args=None): +@@ -218,7 +209,6 @@ def main(args=None): proton_app=proton_app, steam_app=steam_app, use_steam_runtime=use_steam_runtime, @@ -52,7 +51,7 @@ index cc65a03..5c3fc7a 100755 command=[winetricks_path, "--gui"], use_bwrap=use_bwrap ) -@@ -292,7 +281,6 @@ def main(args=None): +@@ -286,7 +276,6 @@ def main(args=None): proton_app=proton_app, steam_app=steam_app, use_steam_runtime=use_steam_runtime, @@ -60,7 +59,7 @@ index cc65a03..5c3fc7a 100755 use_bwrap=use_bwrap, command=[winetricks_path] + args.winetricks_command) elif args.command: -@@ -302,7 +290,6 @@ def main(args=None): +@@ -296,7 +285,6 @@ def main(args=None): steam_app=steam_app, command=args.command, use_steam_runtime=use_steam_runtime, @@ -69,7 +68,7 @@ index cc65a03..5c3fc7a 100755 # Pass the command directly into the shell *without* # escaping it diff --git a/src/protontricks/steam.py b/src/protontricks/steam.py -index 4ab778b..f3f5f99 100644 +index e898caf..7448d11 100644 --- a/src/protontricks/steam.py +++ b/src/protontricks/steam.py @@ -12,8 +12,8 @@ from .util import lower_dict @@ -77,13 +76,13 @@ index 4ab778b..f3f5f99 100644 __all__ = ( "COMMON_STEAM_DIRS", "SteamApp", "find_steam_path", - "find_legacy_steam_runtime_path", "get_appinfo_sections", -- "get_proton_appid", "find_steam_proton_app", "find_appid_proton_prefix", -+ "get_appinfo_sections", "get_proton_appid", -+ "find_steam_proton_app", "find_appid_proton_prefix", +- "get_tool_appid", "find_steam_compat_tool_app", "find_appid_proton_prefix", ++ "get_appinfo_sections", "get_tool_appid", ++ "find_steam_compat_tool_app", "find_appid_proton_prefix", "find_proton_app", "get_steam_lib_paths", "get_compat_tool_dirs", - "get_custom_proton_installations_in_dir", "get_custom_proton_installations", + "get_custom_compat_tool_installations_in_dir", "get_custom_compat_tool_installations", "find_current_steamid3", "get_appid_from_shortcut", -@@ -300,37 +300,6 @@ def find_steam_path(): +@@ -311,37 +311,6 @@ def find_steam_path(): return None, None @@ -122,12 +121,12 @@ index 4ab778b..f3f5f99 100644 APPINFO_STRUCT_SECTION = "