2020-11-20 16:40:08 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, pkgconfig, python3, libX11, libXext, libXinerama, libXrandr, asciidoc
|
2020-11-27 19:20:36 +00:00
|
|
|
, xdotool, xorgserver, xsetroot, xterm, runtimeShell
|
|
|
|
, nixosTests }:
|
2020-04-10 09:56:37 +00:00
|
|
|
|
|
|
|
# Doc generation is disabled by default when cross compiling because asciidoc
|
2020-11-20 16:40:08 +00:00
|
|
|
# dependency is broken when cross compiling for now
|
2020-04-10 09:56:37 +00:00
|
|
|
|
2020-11-20 16:40:08 +00:00
|
|
|
let
|
|
|
|
cross = stdenv.buildPlatform != stdenv.targetPlatform;
|
2013-07-17 16:02:53 +00:00
|
|
|
|
2020-11-20 16:40:08 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2020-04-09 21:18:58 +00:00
|
|
|
pname = "herbstluftwm";
|
2020-11-20 16:40:08 +00:00
|
|
|
version = "0.9.1";
|
2013-07-17 16:02:53 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-04-09 21:18:58 +00:00
|
|
|
url = "https://herbstluftwm.org/tarballs/herbstluftwm-${version}.tar.gz";
|
2020-11-20 16:40:08 +00:00
|
|
|
sha256 = "0r4qaklv97qcq8p0pnz4f2zqg69vfai6c2qi1ydi2kz24xqjf5hy";
|
2013-07-17 16:02:53 +00:00
|
|
|
};
|
|
|
|
|
2020-04-09 21:18:58 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
2020-11-20 16:40:08 +00:00
|
|
|
"doc" # share/doc exists with examples even without generated html documentation
|
|
|
|
] ++ lib.optionals (!cross) [
|
2020-04-09 21:18:58 +00:00
|
|
|
"man"
|
|
|
|
];
|
2013-07-17 16:02:53 +00:00
|
|
|
|
2020-04-09 21:18:58 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_INSTALL_SYSCONF_PREFIX=${placeholder "out"}/etc"
|
2020-11-20 16:40:08 +00:00
|
|
|
] ++ lib.optional cross "-DWITH_DOCUMENTATION=OFF";
|
2020-04-09 21:18:58 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkgconfig
|
2020-11-20 16:40:08 +00:00
|
|
|
python3
|
|
|
|
] ++ lib.optional (!cross) asciidoc;
|
2020-04-09 21:18:58 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libX11
|
|
|
|
libXext
|
|
|
|
libXinerama
|
|
|
|
libXrandr
|
|
|
|
];
|
2013-07-17 16:02:53 +00:00
|
|
|
|
2020-11-20 16:40:08 +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" ];
|
|
|
|
|
2020-11-27 19:20:36 +00:00
|
|
|
passthru = {
|
|
|
|
tests.herbstluftwm = nixosTests.herbstluftwm;
|
|
|
|
};
|
|
|
|
|
2020-11-20 16:39:33 +00:00
|
|
|
meta = with lib; {
|
2013-07-17 16:02:53 +00:00
|
|
|
description = "A manual tiling window manager for X";
|
2020-04-09 21:18:58 +00:00
|
|
|
homepage = "https://herbstluftwm.org/";
|
2020-11-20 16:39:33 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thibautmarty ];
|
2013-07-17 16:02:53 +00:00
|
|
|
};
|
|
|
|
}
|