2021-03-20 04:20:00 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, pkg-config, python3, libX11, libXext, libXinerama, libXrandr, libXft, freetype, asciidoc
|
2021-02-05 17:12:51 +00:00
|
|
|
, xdotool, xorgserver, xsetroot, xterm, runtimeShell
|
|
|
|
, nixosTests }:
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-05-03 17:38:23 +00:00
|
|
|
pname = "herbstluftwm";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "0.9.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-05-03 17:38:23 +00:00
|
|
|
url = "https://herbstluftwm.org/tarballs/herbstluftwm-${version}.tar.gz";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "0avfhr68f6fjnafjdcyxcx7dkg38f2nadmhpj971qyqzfq2f6i38";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
2021-03-09 03:18:52 +00:00
|
|
|
"doc"
|
2020-05-03 17:38:23 +00:00
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_INSTALL_SYSCONF_PREFIX=${placeholder "out"}/etc"
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
depsBuildBuild = [
|
2021-03-20 04:20:00 +00:00
|
|
|
asciidoc
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
buildInputs = [
|
|
|
|
libX11
|
|
|
|
libXext
|
|
|
|
libXinerama
|
|
|
|
libXrandr
|
2021-03-09 03:18:52 +00:00
|
|
|
libXft
|
|
|
|
freetype
|
2020-05-03 17:38:23 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
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 avalaible
|
|
|
|
preCheck = ''
|
|
|
|
export PYTHONPATH="$PYTHONPATH:../python"
|
|
|
|
'';
|
|
|
|
|
|
|
|
pytestFlagsArray = [ "../tests" ];
|
2021-03-09 03:18:52 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_title_different_letters_are_drawn"
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests.herbstluftwm = nixosTests.herbstluftwm;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A manual tiling window manager for X";
|
2020-05-03 17:38:23 +00:00
|
|
|
homepage = "https://herbstluftwm.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thibautmarty ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|