summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-01-18 23:09:46 +0100
committerGitHub <noreply@github.com>2021-01-18 23:09:46 +0100
commit710a84461b2afe94636323ab383c01ac3e7be11b (patch)
treeac0522fe8de35a1bda5e03e8247a9060274a2f78 /pkgs
parent2d461342e7b7b62168c84fab9b926523e27ea02f (diff)
parenta6cdb113bd5fa4d136593909456e310c3f457597 (diff)
Merge pull request #104920 from ThibautMarty/herbstluftwm-0.9.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/window-managers/herbstluftwm/default.nix71
-rw-r--r--pkgs/applications/window-managers/herbstluftwm/test-path-environment.patch10
2 files changed, 67 insertions, 14 deletions
diff --git a/pkgs/applications/window-managers/herbstluftwm/default.nix b/pkgs/applications/window-managers/herbstluftwm/default.nix
index c4bdcb4ca753..1ec1e2e995cc 100644
--- a/pkgs/applications/window-managers/herbstluftwm/default.nix
+++ b/pkgs/applications/window-managers/herbstluftwm/default.nix
@@ -1,35 +1,38 @@
-{ lib, stdenv, fetchurl, cmake, pkgconfig, glib, libX11, libXext, libXinerama, libXrandr
-, withDoc ? stdenv.buildPlatform == stdenv.targetPlatform, asciidoc ? null }:
+{ lib, stdenv, fetchurl, cmake, pkgconfig, python3, libX11, libXext, libXinerama, libXrandr, asciidoc
+, xdotool, xorgserver, xsetroot, xterm, runtimeShell
+, nixosTests }:
# Doc generation is disabled by default when cross compiling because asciidoc
-# does not cross compile for now
+# dependency is broken when cross compiling for now
-assert withDoc -> asciidoc != null;
+let
+ cross = stdenv.buildPlatform != stdenv.targetPlatform;
-stdenv.mkDerivation rec {
+in stdenv.mkDerivation rec {
pname = "herbstluftwm";
- version = "0.8.3";
+ version = "0.9.1";
src = fetchurl {
url = "https://herbstluftwm.org/tarballs/herbstluftwm-${version}.tar.gz";
- sha256 = "1qmb4pjf2f6g0dvcg11cw9njwmxblhqzd70ai8qnlgqw1iz3nkm1";
+ sha256 = "0r4qaklv97qcq8p0pnz4f2zqg69vfai6c2qi1ydi2kz24xqjf5hy";
};
outputs = [
"out"
- ] ++ lib.optionals withDoc [
- "doc"
+ "doc" # share/doc exists with examples even without generated html documentation
+ ] ++ lib.optionals (!cross) [
"man"
];
cmakeFlags = [
"-DCMAKE_INSTALL_SYSCONF_PREFIX=${placeholder "out"}/etc"
- ] ++ lib.optional (!withDoc) "-DWITH_DOCUMENTATION=OFF";
+ ] ++ lib.optional cross "-DWITH_DOCUMENTATION=OFF";
nativeBuildInputs = [
cmake
pkgconfig
- ] ++ lib.optional withDoc asciidoc;
+ python3
+ ] ++ lib.optional (!cross) asciidoc;
buildInputs = [
libX11
@@ -38,10 +41,50 @@ stdenv.mkDerivation rec {
libXrandr
];
- meta = {
+ 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" ];
+
+ passthru = {
+ tests.herbstluftwm = nixosTests.herbstluftwm;
+ };
+
+ meta = with lib; {
description = "A manual tiling window manager for X";
homepage = "https://herbstluftwm.org/";
- license = lib.licenses.bsd2;
- platforms = lib.platforms.linux;
+ license = licenses.bsd2;
+ platforms = platforms.linux;
+ maintainers = with maintainers; [ thibautmarty ];
};
}
diff --git a/pkgs/applications/window-managers/herbstluftwm/test-path-environment.patch b/pkgs/applications/window-managers/herbstluftwm/test-path-environment.patch
new file mode 100644
index 000000000000..dab30d8ac71a
--- /dev/null
+++ b/pkgs/applications/window-managers/herbstluftwm/test-path-environment.patch
@@ -0,0 +1,10 @@
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -43,6 +43,7 @@
+ self.next_client_id = 0
+ self.env = {
+ 'DISPLAY': display,
++ 'PATH': os.environ['PATH']
+ }
+ self.env = extend_env_with_whitelist(self.env)
+ self.hlwm_process = hlwm_process