nixpkgs-suyu/pkgs/applications/window-managers/qtile/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

66 lines
1.9 KiB
Nix

{ lib, stdenv, fetchFromGitHub, python37Packages, glib, cairo, pango, pkgconfig, libxcb, xcbutilcursor }:
let cairocffi-xcffib = python37Packages.cairocffi.override {
withXcffib = true;
};
in
python37Packages.buildPythonApplication rec {
name = "qtile-${version}";
version = "0.16.0";
src = fetchFromGitHub {
owner = "qtile";
repo = "qtile";
rev = "v${version}";
sha256 = "1klv1k9847nyx71sfrhqyl1k51k2w8phqnp2bns4dvbqii7q125l";
};
patches = [
./0001-Substitution-vars-for-absolute-paths.patch
./0002-Restore-PATH-and-PYTHONPATH.patch
./0003-Restart-executable.patch
];
postPatch = ''
substituteInPlace libqtile/core/manager.py --subst-var-by out $out
substituteInPlace libqtile/pangocffi.py --subst-var-by glib ${glib.out}
substituteInPlace libqtile/pangocffi.py --subst-var-by pango ${pango.out}
substituteInPlace libqtile/backend/x11/xcursors.py --subst-var-by xcb-cursor ${xcbutilcursor.out}
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ glib libxcb cairo pango python37Packages.xcffib ];
pythonPath = with python37Packages; [
xcffib
cairocffi-xcffib
setuptools
setuptools_scm
dateutil
dbus-python
mpd2
psutil
pyxdg
pygobject3
];
postInstall = ''
wrapProgram $out/bin/qtile \
--run 'export QTILE_WRAPPER=$0' \
--run 'export QTILE_SAVED_PYTHONPATH=$PYTHONPATH' \
--run 'export QTILE_SAVED_PATH=$PATH'
'';
doCheck = false; # Requires X server #TODO this can be worked out with the existing NixOS testing infrastructure.
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 ];
};
}