2022-04-27 09:35:20 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, pkg-config, python3, libX11, libXext, libXinerama, libXrandr, libXft, libXrender, libXdmcp, libXfixes, freetype, asciidoc
|
2021-02-05 17:12:51 +00:00
|
|
|
, xdotool, xorgserver, xsetroot, xterm, runtimeShell
|
2023-03-15 16:39:30 +00:00
|
|
|
, fetchpatch
|
2021-02-05 17:12:51 +00:00
|
|
|
, 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";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "0.9.5";
|
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";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-stRgCQnlvs5a1jgY37MLsZ/SrJ9ShHsaenStQEBxgQU=";
|
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
|
2021-05-20 23:08:51 +00:00
|
|
|
libXrender
|
2022-04-27 09:35:20 +00:00
|
|
|
libXdmcp
|
|
|
|
libXfixes
|
2021-03-09 03:18:52 +00:00
|
|
|
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
|
2023-03-15 16:39:30 +00:00
|
|
|
# Adjust tests for compatibility with gcc 12 (https://github.com/herbstluftwm/herbstluftwm/issues/1512)
|
|
|
|
# Can be removed with the next release (>0.9.5).
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/herbstluftwm/herbstluftwm/commit/8678168c7a3307b1271e94974e062799e745ab40.patch";
|
|
|
|
hash = "sha256-uI6ErfDitT2Tw0txx4lMSBn/jjiiyL4Qw6AJa/CTh1E=";
|
|
|
|
})
|
2023-10-09 19:29:22 +00:00
|
|
|
# Fix tests with recent Xorg, can be removed with the next release (<0.9.5)
|
|
|
|
# Details here: https://github.com/herbstluftwm/herbstluftwm/issues/1560
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/herbstluftwm/herbstluftwm/commit/1a6e8ee24eac671569f54bfec22ab47ff285a52c.patch";
|
|
|
|
hash = "sha256-srulWJQ9zTR4Kdxo40AdHND4nexDe2PDSR69yWsOpVA=";
|
|
|
|
})
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
(python3.withPackages (ps: with ps; [ ewmh pytest xlib ]))
|
|
|
|
xdotool
|
|
|
|
xorgserver
|
|
|
|
xsetroot
|
|
|
|
xterm
|
|
|
|
python3.pkgs.pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# make the package's module available
|
2021-02-05 17:12:51 +00:00
|
|
|
preCheck = ''
|
|
|
|
export PYTHONPATH="$PYTHONPATH:../python"
|
|
|
|
'';
|
|
|
|
|
|
|
|
pytestFlagsArray = [ "../tests" ];
|
2021-03-09 03:18:52 +00:00
|
|
|
disabledTests = [
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_autostart" # $PATH problems
|
|
|
|
"test_wmexec_to_other" # timeouts in sandbox
|
2023-02-02 18:25:31 +00:00
|
|
|
"test_rules" # timeouts
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests.herbstluftwm = nixosTests.herbstluftwm;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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
|
|
|
};
|
|
|
|
}
|