2021-08-19 19:09:30 +01:00
|
|
|
{ lib, fetchFromGitHub, python3, glib, cairo, pango, pkg-config, libxcb, xcbutilcursor }:
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
let
|
|
|
|
enabled-xcffib = cairocffi-xcffib: cairocffi-xcffib.override {
|
2018-02-21 02:25:23 +00:00
|
|
|
withXcffib = true;
|
2015-12-01 11:46:18 +00:00
|
|
|
};
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
# make it easier to reference python
|
|
|
|
python = python3;
|
|
|
|
pythonPackages = python.pkgs;
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
unwrapped = pythonPackages.buildPythonPackage rec {
|
2021-08-25 04:42:00 +01:00
|
|
|
pname = "qtile";
|
2021-09-16 23:20:45 +01:00
|
|
|
version = "0.18.1";
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qtile";
|
|
|
|
repo = "qtile";
|
|
|
|
rev = "v${version}";
|
2021-09-16 23:20:45 +01:00
|
|
|
sha256 = "0ln0fxarin9liy9n76zywmbr31xrjw8f7d3nr1mphci7wkc9bqmm";
|
2021-08-19 19:09:30 +01:00
|
|
|
};
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace libqtile/pangocffi.py \
|
|
|
|
--replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \
|
|
|
|
--replace libpangocairo-1.0.so.0 ${pango.out}/lib/libpangocairo-1.0.so.0 \
|
|
|
|
--replace libpango-1.0.so.0 ${pango.out}/lib/libpango-1.0.so.0
|
|
|
|
substituteInPlace libqtile/backend/x11/xcursors.py \
|
|
|
|
--replace libxcb-cursor.so.0 ${xcbutilcursor.out}/lib/libxcb-cursor.so.0
|
|
|
|
'';
|
2020-07-25 16:51:57 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
] ++ (with pythonPackages; [
|
|
|
|
setuptools-scm
|
|
|
|
]);
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
|
|
xcffib
|
|
|
|
(enabled-xcffib cairocffi)
|
|
|
|
setuptools
|
|
|
|
python-dateutil
|
|
|
|
dbus-python
|
|
|
|
mpd2
|
|
|
|
psutil
|
|
|
|
pyxdg
|
|
|
|
pygobject3
|
|
|
|
];
|
2015-07-28 21:52:03 +01:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
doCheck = false; # Requires X server #TODO this can be worked out with the existing NixOS testing infrastructure.
|
2017-12-11 11:14:54 +00:00
|
|
|
|
2021-08-19 19:09:30 +01:00
|
|
|
meta = with 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 ];
|
|
|
|
};
|
2015-07-28 21:52:03 +01:00
|
|
|
};
|
2021-08-19 19:09:30 +01:00
|
|
|
in
|
|
|
|
(python.withPackages (ps: [ unwrapped ])).overrideAttrs (_: {
|
2021-08-25 04:42:00 +01:00
|
|
|
# otherwise will be exported as "env", this restores `nix search` behavior
|
|
|
|
name = "${unwrapped.pname}-${unwrapped.version}";
|
2021-08-19 19:09:30 +01:00
|
|
|
# export underlying qtile package
|
|
|
|
passthru = { inherit unwrapped; };
|
|
|
|
})
|