mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 22:32:58 +03:00
Merge pull request #35314 from gnidorah/autorandr
autorandr: embed path to xrandr
This commit is contained in:
commit
8f80b63696
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user