2016-09-26 10:09:25 +01:00
|
|
|
{ stdenv, fetchurl, pythonPackages
|
2013-06-21 15:15:07 +01:00
|
|
|
, which, xpra, xmodmap }:
|
|
|
|
|
|
|
|
let
|
2016-09-26 10:09:25 +01:00
|
|
|
base = pythonPackages.buildPythonApplication rec {
|
2013-06-21 15:15:07 +01:00
|
|
|
name = "winswitch-${version}";
|
|
|
|
namePrefix = "";
|
2018-03-10 01:43:42 +00:00
|
|
|
version = "0.12.23";
|
2013-06-21 15:15:07 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://winswitch.org/src/${name}.src.tar.bz2";
|
2018-03-10 01:43:42 +00:00
|
|
|
sha256 = "1m0akjcdlsgng426rwvzlcl76kjm993icj0pggvha40cizig1yd9";
|
2013-06-21 15:15:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
|
|
pygtk twisted pycrypto pyasn1 which xpra xmodmap
|
|
|
|
];
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i -r -e 's|(PREFIX_DIR *= *).*|\1"'"$out"'"|' \
|
|
|
|
-e 's|(PREFIX_SEARCH_ORDER *= *).*|\1["'"$out"'"]|' \
|
|
|
|
-e 's|(ETC_SEARCH_ORDER *= *).*|\1["'"$out/etc"'"]|' \
|
|
|
|
-e 's|(BIN_SEARCH_ORDER *= *).*|\1["'"$out/bin"'"]|' \
|
|
|
|
winswitch/util/paths.py
|
|
|
|
|
|
|
|
sed -i -e '/elif *LINUX:/,/distro_helper/{
|
|
|
|
s/elif *LINUX:.*/else: name = "NixOS"/p
|
|
|
|
/distro_helper/!d
|
|
|
|
}' winswitch/util/distro_packaging_util.py
|
|
|
|
'';
|
|
|
|
|
2014-01-06 22:35:39 +00:00
|
|
|
preInstall = ''
|
|
|
|
# see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix
|
|
|
|
python setup.py install_data --install-dir=$out --root=$out
|
|
|
|
sed -i '/data_files = data_files/d' setup.py
|
2013-06-21 15:15:07 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false;
|
2013-10-07 16:36:47 +01:00
|
|
|
|
2014-08-08 16:58:34 +01:00
|
|
|
meta.platforms = stdenv.lib.platforms.linux;
|
2013-06-21 15:15:07 +01:00
|
|
|
};
|
|
|
|
in stdenv.lib.overrideDerivation base (b: {
|
|
|
|
postFixup = b.postFixup + ''
|
|
|
|
sed -i -e 's/\''${PATH:+:}\$PATH//g' "$out/bin"/*
|
|
|
|
'';
|
|
|
|
})
|