nixpkgs/pkgs/applications/window-managers/i3/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

174 lines
3.6 KiB
Nix
Raw Normal View History

2024-11-12 13:58:02 +00:00
{
2024-11-12 15:44:33 +00:00
fetchFromGitHub,
2024-11-12 13:58:02 +00:00
lib,
stdenv,
pkg-config,
makeWrapper,
meson,
ninja,
installShellFiles,
libxcb,
xcbutilkeysyms,
xcbutil,
xcbutilwm,
xcbutilxrm,
libstartup_notification,
libX11,
pcre2,
libev,
yajl,
xcb-util-cursor,
perl,
pango,
perlPackages,
libxkbcommon,
xorgserver,
xvfb-run,
xdotool,
xorg,
which,
asciidoc,
xmlto,
docbook_xml_dtd_45,
docbook_xsl,
findXMLCatalogs,
nixosTests,
2024-11-12 15:44:33 +00:00
nix-update-script,
}:
2024-11-12 14:53:22 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "i3";
version = "4.24";
2024-11-12 15:44:33 +00:00
src = fetchFromGitHub {
owner = "i3";
repo = "i3";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-2tuhfB/SMN+osCBfZtw/yDPhNNEhBH4Qo6dexpqVWYk=";
};
2016-11-10 01:38:50 +00:00
nativeBuildInputs = [
2024-11-12 13:58:02 +00:00
pkg-config
makeWrapper
meson
ninja
installShellFiles
perl
asciidoc
xmlto
docbook_xml_dtd_45
docbook_xsl
findXMLCatalogs
];
mesonFlags = [
2024-11-12 14:53:22 +00:00
(lib.mesonBool "docs" true)
(lib.mesonBool "mans" true)
];
2024-11-12 13:58:02 +00:00
buildInputs =
[
libxcb
xcbutilkeysyms
xcbutil
xcbutilwm
xcbutilxrm
libxkbcommon
libstartup_notification
libX11
pcre2
libev
yajl
xcb-util-cursor
perl
pango
perlPackages.AnyEventI3
perlPackages.X11XCB
perlPackages.IPCRun
perlPackages.ExtUtilsPkgConfig
perlPackages.InlineC
]
2024-11-12 14:53:22 +00:00
++ lib.optionals finalAttrs.doCheck [
2024-11-12 13:58:02 +00:00
xorgserver
xvfb-run
xdotool
xorg.setxkbmap
xorg.xrandr
which
];
2016-11-10 01:38:50 +00:00
postPatch = ''
patchShebangs .
# This testcase generates a Perl executable file with a shebang, and
# patchShebangs can't replace a shebang in the middle of a file.
if [ -f testcases/t/318-i3-dmenu-desktop.t ]; then
substituteInPlace testcases/t/318-i3-dmenu-desktop.t \
2024-11-12 14:53:22 +00:00
--replace-fail "#!/usr/bin/env perl" "#!${lib.getExe perl}"
fi
'';
# xvfb-run is available only on Linux
doCheck = stdenv.hostPlatform.isLinux;
checkPhase = ''
2024-11-12 14:53:22 +00:00
runHook preCheck
test_failed=
# "| cat" disables fancy progress reporting which makes the log unreadable.
./complete-run.pl -p 1 --keep-xserver-output | cat || test_failed="complete-run.pl returned $?"
if [ -z "$test_failed" ]; then
# Apparently some old versions of `complete-run.pl` did not return a
# proper exit code, so check the log for signs of errors too.
grep -q '^not ok' latest/complete-run.log && test_failed="test log contains errors" ||:
fi
if [ -n "$test_failed" ]; then
echo "***** Error: $test_failed"
echo "===== Test log ====="
cat latest/complete-run.log
echo "===== End of test log ====="
false
fi
2024-11-12 14:53:22 +00:00
runHook postCheck
'';
postInstall = ''
wrapProgram "$out/bin/i3-save-tree" --prefix PERL5LIB ":" "$PERL5LIB"
for program in $out/bin/i3-sensible-*; do
sed -i 's/which/command -v/' $program
done
2017-09-05 15:49:40 +00:00
installManPage man/*.1
'';
2014-11-30 17:40:03 +00:00
separateDebugInfo = true;
2024-11-12 15:44:33 +00:00
passthru = {
updateScript = nix-update-script { };
tests = {
inherit (nixosTests) i3wm;
};
2024-11-12 13:58:02 +00:00
};
2024-11-12 14:53:22 +00:00
meta = {
description = "Tiling window manager";
2024-11-12 13:58:02 +00:00
homepage = "https://i3wm.org";
2024-11-12 14:53:22 +00:00
maintainers = with lib.maintainers; [
2024-11-12 13:58:02 +00:00
modulistic
fpletz
];
2024-03-08 20:36:43 +00:00
mainProgram = "i3";
2024-11-12 14:53:22 +00:00
license = lib.licenses.bsd3;
2024-11-12 15:07:37 +00:00
platforms = lib.platforms.unix;
longDescription = ''
A tiling window manager primarily targeted at advanced users and
developers. Based on a tree as data structure, supports tiling,
stacking, and tabbing layouts, handled dynamically, as well as
floating windows. Configured via plain text file. Multi-monitor.
UTF-8 clean.
'';
};
2024-11-12 14:53:22 +00:00
})