2021-05-04 19:27:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cairo
|
|
|
|
, fontconfig
|
2021-10-12 15:16:41 +00:00
|
|
|
, libevdev
|
|
|
|
, libinput
|
2021-05-04 19:27:52 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, makeWrapper
|
|
|
|
, mesa
|
|
|
|
, meson
|
|
|
|
, ninja
|
2020-10-06 02:18:44 +00:00
|
|
|
, nixosTests
|
2021-05-04 19:27:52 +00:00
|
|
|
, pango
|
|
|
|
, pixman
|
|
|
|
, pkg-config
|
|
|
|
, scdoc
|
|
|
|
, systemd
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, withXwayland ? true , xwayland
|
|
|
|
, wlroots
|
2020-10-06 02:18:44 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cagebreak";
|
2022-11-30 13:12:04 +00:00
|
|
|
version = "1.9.1";
|
2020-10-06 02:18:44 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "project-repo";
|
2021-05-04 00:20:17 +00:00
|
|
|
repo = pname;
|
2020-10-06 02:18:44 +00:00
|
|
|
rev = version;
|
2022-11-30 13:12:04 +00:00
|
|
|
hash = "sha256-pU1QHYOqnkb3L4iSKbZY9Vo60Z6EaX9mp2Nw48NSPic=";
|
2020-10-06 02:18:44 +00:00
|
|
|
};
|
|
|
|
|
2021-05-04 19:27:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
scdoc
|
|
|
|
wayland
|
|
|
|
];
|
2020-10-06 02:18:44 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-05-04 19:27:52 +00:00
|
|
|
cairo
|
|
|
|
fontconfig
|
2021-10-12 15:16:41 +00:00
|
|
|
libevdev
|
|
|
|
libinput
|
2021-05-04 19:27:52 +00:00
|
|
|
libxkbcommon
|
2021-04-09 08:45:22 +00:00
|
|
|
mesa # for libEGL headers
|
2021-05-04 19:27:52 +00:00
|
|
|
pango
|
|
|
|
pixman
|
|
|
|
systemd
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
wlroots
|
2020-10-06 02:18:44 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
2021-03-10 23:27:42 +00:00
|
|
|
"-Dman-pages=true"
|
2021-05-04 19:27:52 +00:00
|
|
|
"-Dversion_override=${version}"
|
|
|
|
"-Dxwayland=${lib.boolToString withXwayland}"
|
2020-10-06 02:18:44 +00:00
|
|
|
];
|
|
|
|
|
2021-05-04 00:20:17 +00:00
|
|
|
postPatch = ''
|
2021-11-24 21:56:53 +00:00
|
|
|
# TODO: investigate why is this happening
|
2021-05-04 00:20:17 +00:00
|
|
|
sed -i -e 's|<drm_fourcc.h>|<libdrm/drm_fourcc.h>|' *.c
|
|
|
|
|
2021-11-24 21:56:53 +00:00
|
|
|
# Patch cagebreak to read its default configuration from $out/share/cagebreak
|
|
|
|
sed -i "s|/etc/xdg/cagebreak|$out/share/cagebreak|" meson.build cagebreak.c
|
2020-10-06 02:18:44 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
postFixup = lib.optionalString withXwayland ''
|
2021-10-19 21:56:26 +00:00
|
|
|
wrapProgram $out/bin/cagebreak \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ xwayland ]}"
|
2020-10-06 02:18:44 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-06 02:18:44 +00:00
|
|
|
homepage = "https://github.com/project-repo/cagebreak";
|
2021-05-07 17:34:18 +00:00
|
|
|
description = "A Wayland tiling compositor inspired by ratpoison";
|
2020-10-06 02:18:44 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ berbiche ];
|
2021-05-07 17:34:18 +00:00
|
|
|
platforms = platforms.linux;
|
2022-11-30 13:12:04 +00:00
|
|
|
changelog = "https://github.com/project-repo/cagebreak/blob/${version}/Changelog.md";
|
2020-10-06 02:18:44 +00:00
|
|
|
};
|
2021-05-07 17:34:18 +00:00
|
|
|
|
|
|
|
passthru.tests.basic = nixosTests.cagebreak;
|
2020-10-06 02:18:44 +00:00
|
|
|
}
|