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

77 lines
2.2 KiB
Nix
Raw Normal View History

2021-11-14 22:30:14 +01:00
{ lib, fetchFromGitHub, python3, mypy, glib, cairo, pango, pkg-config, libxcb, xcbutilcursor }:
2015-07-28 22:52:03 +02:00
let
enabled-xcffib = cairocffi-xcffib: cairocffi-xcffib.override {
withXcffib = true;
};
2015-07-28 22:52:03 +02:00
# make it easier to reference python
python = python3;
pythonPackages = python.pkgs;
2015-07-28 22:52:03 +02:00
unwrapped = pythonPackages.buildPythonPackage rec {
2021-08-25 05:42:00 +02:00
pname = "qtile";
2021-12-22 19:25:15 +01:00
version = "0.19.0";
2015-07-28 22:52:03 +02:00
src = fetchFromGitHub {
owner = "qtile";
repo = "qtile";
rev = "v${version}";
2021-12-22 19:25:15 +01:00
sha256 = "BLHGVPMQd8O4h5TVx/F/klzSra+FZYogp22V6Yq04T0=";
};
2015-07-28 22:52:03 +02: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
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
2015-07-28 22:52:03 +02:00
nativeBuildInputs = [
pkg-config
] ++ (with pythonPackages; [
setuptools-scm
]);
2015-07-28 22:52:03 +02:00
propagatedBuildInputs = with pythonPackages; [
xcffib
(enabled-xcffib cairocffi)
setuptools
python-dateutil
dbus-python
mpd2
psutil
pyxdg
pygobject3
pywayland
pywlroots
xkbcommon
];
2015-07-28 22:52:03 +02:00
2021-11-14 22:30:14 +01: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 12:14:54 +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 22:52:03 +02:00
};
in
(python.withPackages (ps: [ unwrapped ])).overrideAttrs (_: {
2021-08-25 05:42:00 +02:00
# otherwise will be exported as "env", this restores `nix search` behavior
name = "${unwrapped.pname}-${unwrapped.version}";
# export underlying qtile package
passthru = { inherit unwrapped; };
})