nixpkgs/pkgs/applications/window-managers/qtile/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

97 lines
2.4 KiB
Nix
Raw Normal View History

2022-03-23 11:02:08 +00:00
{ lib
, fetchFromGitHub
, python3
, python3Packages
, mypy
, glib
, pango
, pkg-config
, libinput
, libxkbcommon
, wayland
, wlroots
, xcbutilcursor
}:
2015-07-28 20:52:03 +00:00
let
2022-01-13 03:14:01 +00:00
unwrapped = python3Packages.buildPythonPackage rec {
2021-08-25 03:42:00 +00:00
pname = "qtile";
version = "0.22.1";
2015-07-28 20:52:03 +00:00
src = fetchFromGitHub {
owner = "qtile";
repo = "qtile";
rev = "v${version}";
hash = "sha256-HOyExVKOqZ4OeNM1/AiXQeiUV+EbSJLEjWEibm07ff8=";
};
2015-07-28 20:52:03 +00:00
patches = [
./fix-restart.patch # https://github.com/NixOS/nixpkgs/issues/139568
];
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
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
2015-07-28 20:52:03 +00:00
nativeBuildInputs = [
pkg-config
2022-01-13 03:14:01 +00:00
] ++ (with python3Packages; [
setuptools-scm
]);
2015-07-28 20:52:03 +00:00
2022-01-13 03:14:01 +00:00
propagatedBuildInputs = with python3Packages; [
xcffib
2022-01-13 03:14:01 +00:00
(cairocffi.override { withXcffib = true; })
setuptools
python-dateutil
dbus-python
dbus-next
mpd2
psutil
pyxdg
pygobject3
pywayland
pywlroots
xkbcommon
];
2015-07-28 20:52:03 +00:00
2022-03-23 11:02:08 +00:00
buildInputs = [
libinput
wayland
wlroots
libxkbcommon
];
2021-11-14 21:30:14 +00:00
# for `qtile check`, needs `stubtest` and `mypy` commands
makeWrapperArgs = [
"--suffix PATH : ${lib.makeBinPath [ mypy ]}"
];
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
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 20:52:03 +00:00
};
in
2022-01-13 03:14:01 +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; };
2022-03-09 20:08:02 +00:00
# restore original qtile attrs
inherit (unwrapped) pname version meta;
2022-01-13 03:14:01 +00:00
})