Merge pull request #20744 from kampka/python-autorandr
autorandr: 59f6aec0b -> 53d29f9
This commit is contained in:
commit
ce31c6b019
|
@ -1,48 +1,41 @@
|
||||||
{ fetchgit
|
{ fetchgit
|
||||||
, stdenv
|
, stdenv
|
||||||
, enableXRandr ? true, xrandr ? null
|
, python3Packages
|
||||||
, enableDisper ? true, disper ? null
|
, fetchFromGitHub }:
|
||||||
, python
|
|
||||||
, xdpyinfo }:
|
|
||||||
|
|
||||||
assert enableXRandr -> xrandr != null;
|
|
||||||
assert enableDisper -> disper != null;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
# Revision and date taken from the legacy tree, which still
|
python = python3Packages.python;
|
||||||
# supports disper:
|
wrapPython = python3Packages.wrapPython;
|
||||||
# https://github.com/phillipberndt/autorandr/tree/legacy
|
date = "2016-11-23";
|
||||||
rev = "59f6aec0bb72e26751ce285d079e085b7178e45d";
|
|
||||||
date = "20150127";
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "autorandr-${date}";
|
name = "autorandr-unstable-${date}";
|
||||||
|
|
||||||
src = fetchgit {
|
buildInputs = [ python wrapPython ];
|
||||||
inherit rev;
|
|
||||||
url = "https://github.com/phillipberndt/autorandr.git";
|
|
||||||
sha256 = "0mnggsp42477kbzwwn65gi8y0rydk10my9iahikvs6n43lphfa1f";
|
|
||||||
};
|
|
||||||
|
|
||||||
patchPhase = ''
|
phases = [ "unpackPhase" "installPhase" ];
|
||||||
substituteInPlace "autorandr" \
|
|
||||||
--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" \
|
|
||||||
--replace "which xxd" "false" \
|
|
||||||
--replace "python" "${python}/bin/python"
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p "$out/etc/bash_completion.d"
|
# install bash completions
|
||||||
cp -v bash_completion/autorandr "$out/etc/bash_completion.d"
|
mkdir -p $out/bin $out/libexec $out/etc/bash_completion.d
|
||||||
mkdir -p "$out/bin"
|
cp -v contrib/bash_completion/autorandr $out/etc/bash_completion.d
|
||||||
cp -v autorandr auto-disper $out/bin
|
|
||||||
|
# install autorandr bin
|
||||||
|
cp autorandr.py $out/bin/autorandr
|
||||||
|
wrapPythonProgramsIn $out/bin/autorandr $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "phillipberndt";
|
||||||
|
repo = "autorandr";
|
||||||
|
rev = "53d29f99275aebf14240ea95f2d7022b305738d5";
|
||||||
|
sha256 = "0pza4wfkzv7mmg2m4pf3n8wk0p7cy6bfqknn8ywz51r8ja16cqfj";
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Automatic display configuration selector based on connected devices";
|
homepage = "http://github.com/phillipberndt/autorandr/";
|
||||||
homepage = https://github.com/wertarbyte/autorandr;
|
description = "Auto-detect the connect display hardware and load the appropiate X11 setup using xrandr";
|
||||||
|
license = stdenv.lib.licenses.gpl3Plus;
|
||||||
maintainers = [ stdenv.lib.maintainers.coroa ];
|
maintainers = [ stdenv.lib.maintainers.coroa ];
|
||||||
platforms = stdenv.lib.platforms.unix;
|
platforms = stdenv.lib.platforms.unix;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue