about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/package-management/protontricks/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/package-management/protontricks/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/package-management/protontricks/default.nix68
1 files changed, 68 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/package-management/protontricks/default.nix b/nixpkgs/pkgs/tools/package-management/protontricks/default.nix
new file mode 100644
index 000000000000..b8689fdf9966
--- /dev/null
+++ b/nixpkgs/pkgs/tools/package-management/protontricks/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, buildPythonApplication
+, fetchFromGitHub
+, setuptools-scm
+, setuptools
+, vdf
+, bash
+, steam-run
+, winetricks
+, yad
+, pytestCheckHook
+, nix-update-script
+}:
+
+buildPythonApplication rec {
+  pname = "protontricks";
+  version = "1.10.1";
+
+  src = fetchFromGitHub {
+    owner = "Matoking";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-gKrdUwX5TzeHHXuwhUyI4REPE6TNiZ6lhonyMCHcBCA=";
+  };
+
+  patches = [
+    # Use steam-run to run Proton binaries
+    ./steam-run.patch
+  ];
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  nativeBuildInputs = [ setuptools-scm ];
+
+  propagatedBuildInputs = [
+    setuptools # implicit dependency, used to find data/icon_placeholder.png
+    vdf
+  ];
+
+  makeWrapperArgs = [
+    "--prefix PATH : ${lib.makeBinPath [
+      bash
+      steam-run
+      winetricks
+      yad
+    ]}"
+  ];
+
+  nativeCheckInputs = [ 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" ];
+
+  passthru.updateScript = nix-update-script { };
+
+  meta = with lib; {
+    description = "A simple wrapper for running Winetricks commands for Proton-enabled games";
+    homepage = "https://github.com/Matoking/protontricks";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ kira-bruneau ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}