about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMetaDark <kira.bruneau@gmail.com>2020-01-26 08:51:31 -0500
committerMetaDark <kira.bruneau@gmail.com>2020-01-27 19:41:58 -0500
commit28d361ae3c60a0888066636fdd1e56f1f7a427fa (patch)
treec6a4c279136be96b366ac50b8ebf1be2f195bf25
parentd91d400a847a74be32042301af37453e712f37bc (diff)
downloadnixlib-28d361ae3c60a0888066636fdd1e56f1f7a427fa.tar
nixlib-28d361ae3c60a0888066636fdd1e56f1f7a427fa.tar.gz
nixlib-28d361ae3c60a0888066636fdd1e56f1f7a427fa.tar.bz2
nixlib-28d361ae3c60a0888066636fdd1e56f1f7a427fa.tar.lz
nixlib-28d361ae3c60a0888066636fdd1e56f1f7a427fa.tar.xz
nixlib-28d361ae3c60a0888066636fdd1e56f1f7a427fa.tar.zst
nixlib-28d361ae3c60a0888066636fdd1e56f1f7a427fa.zip
protontricks: 1.3.1 -> 1.4
- Specify SETUPTOOLS_SCM_PRETEND_VERSION to workaround missing .git
- Start running tests that were introduced in 1.3
-rw-r--r--pkgs/tools/package-management/protontricks/default.nix27
-rw-r--r--pkgs/top-level/all-packages.nix5
2 files changed, 24 insertions, 8 deletions
diff --git a/pkgs/tools/package-management/protontricks/default.nix b/pkgs/tools/package-management/protontricks/default.nix
index c8413c56854f..2b7fbd28c7ef 100644
--- a/pkgs/tools/package-management/protontricks/default.nix
+++ b/pkgs/tools/package-management/protontricks/default.nix
@@ -1,18 +1,31 @@
 { stdenv, lib, buildPythonApplication, fetchFromGitHub
-, vdf, wine, winetricks, zenity
+, setuptools_scm, vdf
+, wine, winetricks, zenity
+, pytest
 }:
 
 buildPythonApplication rec {
   pname = "protontricks";
-  version = "1.3.1";
+  version = "1.4";
 
   src = fetchFromGitHub {
     owner = "Matoking";
     repo = pname;
     rev = version;
-    sha256 = "0snhm9r5igik030iqxm3zd9zvhlnsxi20zac71bbc29qflsi2dhk";
+    sha256 = "1aarx6g8ykw1jvygfngmz8apdvfj26rcq10bwl228612kwigh7s2";
   };
 
+  # Fix interpreter in mock run.sh for tests
+  postPatch = ''
+    substituteInPlace tests/conftest.py \
+      --replace '#!/bin/bash' '#!${stdenv.shell}' \
+  '';
+
+  preBuild = ''
+    export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
+  '';
+
+  nativeBuildInputs = [ setuptools_scm ];
   propagatedBuildInputs = [ vdf ];
 
   # The wine install shipped with Proton must run under steam's
@@ -24,12 +37,12 @@ buildPythonApplication rec {
     "--set STEAM_RUNTIME 0"
     "--set-default WINE ${wine}/bin/wine"
     "--set-default WINESERVER ${wine}/bin/wineserver"
-    "--prefix PATH : ${lib.makeBinPath [
-      (winetricks.override { inherit wine; })
-      zenity
-    ]}"
+    "--prefix PATH : ${lib.makeBinPath [ winetricks zenity ]}"
   ];
 
+  checkInputs = [ pytest ];
+  checkPhase = "pytest";
+
   meta = with stdenv.lib; {
     description = "A simple wrapper for running Winetricks commands for Proton-enabled games";
     homepage = https://github.com/Matoking/protontricks;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index aedba5c21b7b..c40dcdfd5281 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -23433,9 +23433,12 @@ in
   };
 
   protontricks = callPackage ../tools/package-management/protontricks {
-    inherit (python3Packages) buildPythonApplication vdf;
+    inherit (python3Packages) buildPythonApplication pytest setuptools_scm vdf;
     inherit (gnome3) zenity;
     wine = wineWowPackages.minimal;
+    winetricks = winetricks.override {
+      wine = wineWowPackages.minimal;
+    };
   };
 
   stepmania = callPackage ../games/stepmania {