3
0
Fork 0
forked from mirrors/nixpkgs

autorandr: make the dependencies on xrandr and disper configurable by enableX params

This commit is contained in:
Jonas Hoersch 2013-09-26 13:12:01 +02:00
parent cd902179db
commit 683310e05e
2 changed files with 10 additions and 6 deletions

View file

@ -1,4 +1,11 @@
{ fetchgit, stdenv, disper ? null, xrandr, xdpyinfo }:
{ fetchgit
, stdenv
, enableXRandr ? true, xrandr ? null
, enableDisper ? false, disper ? null
, xdpyinfo }:
assert enableXRandr -> xrandr != null;
assert enableDisper -> disper != null;
let
rev = "4f5e2401ef";
@ -13,11 +20,9 @@ in
patchPhase = ''
substituteInPlace "autorandr" \
--replace "/usr/bin/xrandr" "${xrandr}/bin/xrandr" \
--replace "/usr/bin/xrandr" "${if enableXRandr then xrandr else "/nowhere"}/bin/xrandr" \
--replace "/usr/bin/disper" "${if enableDisper then disper else "/nowhere"}/bin/disper" \
--replace "/usr/bin/xdpyinfo" "${xdpyinfo}/bin/xdpyinfo"
'' + stdenv.lib.optionalString (disper != null) ''
substituteInPlace "autorandr"
--replace "/usr/bin/disper" "${disper}/bin/disper"
'';
installPhase = ''

View file

@ -497,7 +497,6 @@ let
autorandr = callPackage ../tools/misc/autorandr {
inherit (xorg) xrandr xdpyinfo;
disper = null;
};
avahi = callPackage ../development/libraries/avahi {