forked from mirrors/nixpkgs
28c44a15c7
* Use absolute paths to load gobject, pango and cairo. * Add xcb-cursor support (also with absolute path) * Avoid tainting child processes environment: Save PATH and PYTHONPATH in wrapper, and restore them in python code. * Alter restart process, using $0 saved in wrapper, which allow user to restart qtile after system rebuild to upgrade it.
52 lines
1.6 KiB
Nix
52 lines
1.6 KiB
Nix
{ stdenv, fetchFromGitHub, buildPythonPackage, python27Packages, pkgs }:
|
|
|
|
let cairocffi-xcffib = python27Packages.cairocffi.override {
|
|
pythonPath = [ python27Packages.xcffib ];
|
|
};
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
name = "qtile-${version}";
|
|
version = "0.10.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "qtile";
|
|
repo = "qtile";
|
|
rev = "v${version}";
|
|
sha256 = "0dhdwjr4pdlzli68fa8glrnsjzxp6agdab9cnmpsqlwiwh97x9a6";
|
|
};
|
|
|
|
patches = [
|
|
./0001-Substitution-vars-for-absolute-paths.patch
|
|
./0002-Restore-PATH-and-PYTHONPATH.patch
|
|
./0003-Restart-executable.patch
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace libqtile/manager.py --subst-var-by out $out
|
|
substituteInPlace libqtile/pangocffi.py --subst-var-by glib ${pkgs.glib}
|
|
substituteInPlace libqtile/pangocffi.py --subst-var-by pango ${pkgs.pango}
|
|
substituteInPlace libqtile/xcursors.py --subst-var-by xcb-cursor ${pkgs.xorg.xcbutilcursor}
|
|
'';
|
|
|
|
buildInputs = [ pkgs.pkgconfig pkgs.glib pkgs.xorg.libxcb pkgs.cairo pkgs.pango python27Packages.xcffib ];
|
|
|
|
pythonPath = with python27Packages; [ xcffib cairocffi-xcffib trollius readline];
|
|
|
|
postInstall = ''
|
|
wrapProgram $out/bin/qtile \
|
|
--set QTILE_WRAPPER '"$0"' \
|
|
--set QTILE_SAVED_PYTHONPATH '"$PYTHONPATH"' \
|
|
--set QTILE_SAVED_PATH '"$PATH"'
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
homepage = http://www.qtile.org/;
|
|
license = licenses.mit;
|
|
description = "A small, flexible, scriptable tiling window manager written in Python";
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ kamilchm ];
|
|
};
|
|
}
|
|
|