1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
{ lib, stdenv, fetchurl, cmake, pkg-config, python3, libX11, libXext, libXinerama, libXrandr, libXft, libXrender, libXdmcp, libXfixes, freetype, asciidoc
, xdotool, xorgserver, xsetroot, xterm, runtimeShell
, nixosTests }:
stdenv.mkDerivation rec {
pname = "herbstluftwm";
version = "0.9.5";
src = fetchurl {
url = "https://herbstluftwm.org/tarballs/herbstluftwm-${version}.tar.gz";
sha256 = "sha256-stRgCQnlvs5a1jgY37MLsZ/SrJ9ShHsaenStQEBxgQU=";
};
outputs = [
"out"
"doc"
"man"
];
cmakeFlags = [
"-DCMAKE_INSTALL_SYSCONF_PREFIX=${placeholder "out"}/etc"
];
nativeBuildInputs = [
cmake
pkg-config
];
depsBuildBuild = [
asciidoc
];
buildInputs = [
libX11
libXext
libXinerama
libXrandr
libXft
libXrender
libXdmcp
libXfixes
freetype
];
patches = [
./test-path-environment.patch
];
postPatch = ''
patchShebangs doc/gendoc.py
# fix /etc/xdg/herbstluftwm paths in documentation and scripts
grep -rlZ /etc/xdg/herbstluftwm share/ doc/ scripts/ | while IFS="" read -r -d "" path; do
substituteInPlace "$path" --replace /etc/xdg/herbstluftwm $out/etc/xdg/herbstluftwm
done
# fix shebang in generated scripts
substituteInPlace tests/conftest.py --replace "/usr/bin/env bash" ${runtimeShell}
substituteInPlace tests/test_herbstluftwm.py --replace "/usr/bin/env bash" ${runtimeShell}
'';
doCheck = true;
checkInputs = [
(python3.withPackages (ps: with ps; [ ewmh pytest xlib ]))
xdotool
xorgserver
xsetroot
xterm
python3.pkgs.pytestCheckHook
];
# make the package's module available
preCheck = ''
export PYTHONPATH="$PYTHONPATH:../python"
'';
pytestFlagsArray = [ "../tests" ];
disabledTests = [
"test_title_different_letters_are_drawn" # font problems
"test_completable_commands" # font problems
"test_autostart" # $PATH problems
"test_wmexec_to_other" # timeouts in sandbox
];
passthru = {
tests.herbstluftwm = nixosTests.herbstluftwm;
};
meta = with lib; {
description = "A manual tiling window manager for X";
homepage = "https://herbstluftwm.org/";
license = licenses.bsd2;
platforms = platforms.linux;
maintainers = with maintainers; [ thibautmarty ];
};
}
|