summary refs log tree commit diff
path: root/pkgs/os-specific/linux/powertop/default.nix
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2016-01-31 21:40:05 +0100
committerPeter Simons <simons@cryp.to>2016-01-31 21:44:36 +0100
commitb7badc6be04b7faacddc9f5864d3f3b2d37e310a (patch)
treee77aa2bd92ae9722840d39ba76b9cc78add5c6af /pkgs/os-specific/linux/powertop/default.nix
parent268d4699ece342da82ec9d4e716f21655a69d665 (diff)
downloadnixpkgs-b7badc6be04b7faacddc9f5864d3f3b2d37e310a.tar
nixpkgs-b7badc6be04b7faacddc9f5864d3f3b2d37e310a.tar.gz
nixpkgs-b7badc6be04b7faacddc9f5864d3f3b2d37e310a.tar.bz2
nixpkgs-b7badc6be04b7faacddc9f5864d3f3b2d37e310a.tar.lz
nixpkgs-b7badc6be04b7faacddc9f5864d3f3b2d37e310a.tar.xz
nixpkgs-b7badc6be04b7faacddc9f5864d3f3b2d37e310a.tar.zst
nixpkgs-b7badc6be04b7faacddc9f5864d3f3b2d37e310a.zip
powertop: call "xset" from $PATH
Patch the source code to find "xset" in $PATH rather than expecting the
hard-coded path "/usr/bin/xset" to work. I've decided *not* to hard-code
a proper path like "${xset}/bin/xset", because that reference greatly
increases the size of the powertop closure. Since "xset" is required
only for --calibrate (and that even seems to work fine without it), it
felt like an optional dependency is more appropriate in this case.

Thanks to @heydojo locating the source code file that needs patching.

Fixes https://github.com/NixOS/nixpkgs/issues/12662.
Diffstat (limited to 'pkgs/os-specific/linux/powertop/default.nix')
-rw-r--r--pkgs/os-specific/linux/powertop/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/powertop/default.nix b/pkgs/os-specific/linux/powertop/default.nix
index ef1dbf00b52..59083a8b040 100644
--- a/pkgs/os-specific/linux/powertop/default.nix
+++ b/pkgs/os-specific/linux/powertop/default.nix
@@ -12,6 +12,7 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe"
+    substituteInPlace src/calibrate/calibrate.cpp --replace "/usr/bin/xset" "xset"
   '';
 
   meta = {