about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgnidorah <gnidorah@users.noreply.github.com>2018-02-22 10:41:30 +0300
committergnidorah <gnidorah@users.noreply.github.com>2018-02-22 10:41:30 +0300
commite17a222f94852bf2e7ea5b7bb983a72233748cac (patch)
treeac188479d4476b1fa0d509249e50fb000e03e35b
parent89343b4d43665e63bb49286f4aa96038d4015d30 (diff)
downloadnixlib-e17a222f94852bf2e7ea5b7bb983a72233748cac.tar
nixlib-e17a222f94852bf2e7ea5b7bb983a72233748cac.tar.gz
nixlib-e17a222f94852bf2e7ea5b7bb983a72233748cac.tar.bz2
nixlib-e17a222f94852bf2e7ea5b7bb983a72233748cac.tar.lz
nixlib-e17a222f94852bf2e7ea5b7bb983a72233748cac.tar.xz
nixlib-e17a222f94852bf2e7ea5b7bb983a72233748cac.tar.zst
nixlib-e17a222f94852bf2e7ea5b7bb983a72233748cac.zip
autorandr: embed path to xrandr
-rw-r--r--pkgs/tools/misc/autorandr/default.nix17
1 files changed, 8 insertions, 9 deletions
diff --git a/pkgs/tools/misc/autorandr/default.nix b/pkgs/tools/misc/autorandr/default.nix
index b744e70a4e2f..db2e1fc622fa 100644
--- a/pkgs/tools/misc/autorandr/default.nix
+++ b/pkgs/tools/misc/autorandr/default.nix
@@ -2,19 +2,23 @@
 , python3Packages
 , fetchFromGitHub
 , systemd
-, xrandr
-, makeWrapper }:
+, xrandr }:
 
 let
   python = python3Packages.python;
-  wrapPython = python3Packages.wrapPython;
   version = "1.4";
 in
   stdenv.mkDerivation {
     name = "autorandr-${version}";
 
     buildInputs = [ python ];
-    nativeBuildInputs = [ makeWrapper ];
+
+    # no wrapper, as autorandr --batch does os.environ.clear()
+    buildPhase = ''
+      substituteInPlace autorandr.py \
+        --replace 'os.popen("xrandr' 'os.popen("${xrandr}/bin/xrandr' \
+        --replace '["xrandr"]' '["${xrandr}/bin/xrandr"]'
+    '';
 
     installPhase = ''
       runHook preInstall
@@ -40,11 +44,6 @@ in
       runHook postInstall
     '';
 
-    postFixup = ''
-      wrapProgram $out/bin/autorandr \
-        --prefix PATH : ${xrandr}/bin
-    '';
-
     src = fetchFromGitHub {
       owner = "phillipberndt";
       repo = "autorandr";