forked from mirrors/nixpkgs
autorandr: embed path to xrandr
This commit is contained in:
parent
89343b4d43
commit
e17a222f94
|
@ -2,19 +2,23 @@
|
||||||
, python3Packages
|
, python3Packages
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, systemd
|
, systemd
|
||||||
, xrandr
|
, xrandr }:
|
||||||
, makeWrapper }:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
python = python3Packages.python;
|
python = python3Packages.python;
|
||||||
wrapPython = python3Packages.wrapPython;
|
|
||||||
version = "1.4";
|
version = "1.4";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "autorandr-${version}";
|
name = "autorandr-${version}";
|
||||||
|
|
||||||
buildInputs = [ python ];
|
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 = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
@ -40,11 +44,6 @@ in
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
|
||||||
wrapProgram $out/bin/autorandr \
|
|
||||||
--prefix PATH : ${xrandr}/bin
|
|
||||||
'';
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "phillipberndt";
|
owner = "phillipberndt";
|
||||||
repo = "autorandr";
|
repo = "autorandr";
|
||||||
|
|
Loading…
Reference in a new issue