2022-01-26 04:04:25 +00:00
|
|
|
{ lib, fetchFromGitHub, python3, python3Packages, mypy, glib, pango, pkg-config, xcbutilcursor }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
let
|
2022-01-26 04:04:25 +00:00
|
|
|
unwrapped = python3Packages.buildPythonPackage rec {
|
2021-08-27 14:25:00 +00:00
|
|
|
pname = "qtile";
|
2022-01-26 04:04:25 +00:00
|
|
|
version = "0.20.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qtile";
|
|
|
|
repo = "qtile";
|
|
|
|
rev = "v${version}";
|
2022-01-26 04:04:25 +00:00
|
|
|
sha256 = "TRmul3t//izJRdViTvxFz29JZeGYsWc7WsJjagQ35nw=";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
patches = [
|
|
|
|
./fix-restart.patch # https://github.com/NixOS/nixpkgs/issues/139568
|
|
|
|
];
|
|
|
|
|
2021-08-22 07:53:02 +00: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-08-20 17:08:02 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2022-01-26 04:04:25 +00:00
|
|
|
] ++ (with python3Packages; [
|
2021-08-22 07:53:02 +00:00
|
|
|
setuptools-scm
|
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2021-08-22 07:53:02 +00:00
|
|
|
xcffib
|
2022-01-26 04:04:25 +00:00
|
|
|
(cairocffi.override { withXcffib = true; })
|
2021-08-22 07:53:02 +00:00
|
|
|
setuptools
|
|
|
|
python-dateutil
|
|
|
|
dbus-python
|
|
|
|
mpd2
|
|
|
|
psutil
|
|
|
|
pyxdg
|
|
|
|
pygobject3
|
2021-12-06 16:07:01 +00:00
|
|
|
pywayland
|
|
|
|
pywlroots
|
|
|
|
xkbcommon
|
|
|
|
];
|
|
|
|
|
|
|
|
# for `qtile check`, needs `stubtest` and `mypy` commands
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--suffix PATH : ${lib.makeBinPath [ mypy ]}"
|
2021-08-22 07:53:02 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
doCheck = false; # Requires X server #TODO this can be worked out with the existing NixOS testing infrastructure.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00: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 ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-08-22 07:53:02 +00:00
|
|
|
in
|
2022-01-26 04:04:25 +00:00
|
|
|
(python3.withPackages (_: [ unwrapped ])).overrideAttrs (_: {
|
|
|
|
# otherwise will be exported as "env", this restores `nix search` behavior
|
|
|
|
name = "${unwrapped.pname}-${unwrapped.version}";
|
|
|
|
# export underlying qtile package
|
|
|
|
passthru = { inherit unwrapped; };
|
|
|
|
})
|