2021-05-04 21:07:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cairo
|
|
|
|
, fontconfig
|
2021-10-14 00:43:12 +00:00
|
|
|
, libevdev
|
|
|
|
, libinput
|
2021-05-04 21:07:42 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, makeWrapper
|
|
|
|
, mesa
|
|
|
|
, meson
|
|
|
|
, ninja
|
2020-10-11 12:50:04 +00:00
|
|
|
, nixosTests
|
2021-05-04 21:07:42 +00:00
|
|
|
, pango
|
|
|
|
, pixman
|
|
|
|
, pkg-config
|
|
|
|
, scdoc
|
|
|
|
, systemd
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, withXwayland ? true , xwayland
|
|
|
|
, wlroots
|
2020-10-11 12:50:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cagebreak";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.8.1";
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "project-repo";
|
2021-05-04 21:07:42 +00:00
|
|
|
repo = pname;
|
2020-10-11 12:50:04 +00:00
|
|
|
rev = version;
|
2021-12-06 16:07:01 +00:00
|
|
|
hash = "sha256-YaLGRlvppTUCSHFlt3sEfHgN3pYHuc5oGt3dt0DDw3I=";
|
2020-10-11 12:50:04 +00:00
|
|
|
};
|
|
|
|
|
2021-05-04 21:07:42 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
scdoc
|
|
|
|
wayland
|
|
|
|
];
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-05-04 21:07:42 +00:00
|
|
|
cairo
|
|
|
|
fontconfig
|
2021-10-14 00:43:12 +00:00
|
|
|
libevdev
|
|
|
|
libinput
|
2021-05-04 21:07:42 +00:00
|
|
|
libxkbcommon
|
2021-04-26 19:14:03 +00:00
|
|
|
mesa # for libEGL headers
|
2021-05-04 21:07:42 +00:00
|
|
|
pango
|
|
|
|
pixman
|
|
|
|
systemd
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
wlroots
|
2020-10-11 12:50:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
2021-03-12 07:09:13 +00:00
|
|
|
"-Dman-pages=true"
|
2021-05-04 21:07:42 +00:00
|
|
|
"-Dversion_override=${version}"
|
|
|
|
"-Dxwayland=${lib.boolToString withXwayland}"
|
2020-10-11 12:50:04 +00:00
|
|
|
];
|
|
|
|
|
2021-05-04 21:07:42 +00:00
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
# TODO: investigate why is this happening
|
2021-05-04 21:07:42 +00:00
|
|
|
sed -i -e 's|<drm_fourcc.h>|<libdrm/drm_fourcc.h>|' *.c
|
|
|
|
|
2021-12-06 16:07:01 +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-11 12:50:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
postFixup = lib.optionalString withXwayland ''
|
2021-10-17 09:34:42 +00:00
|
|
|
wrapProgram $out/bin/cagebreak \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ xwayland ]}"
|
2020-10-11 12:50:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 12:50:04 +00:00
|
|
|
homepage = "https://github.com/project-repo/cagebreak";
|
2021-05-20 23:08:51 +00:00
|
|
|
description = "A Wayland tiling compositor inspired by ratpoison";
|
2020-10-11 12:50:04 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ berbiche ];
|
2021-05-20 23:08:51 +00:00
|
|
|
platforms = platforms.linux;
|
2020-10-11 12:50:04 +00:00
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
passthru.tests.basic = nixosTests.cagebreak;
|
2020-10-11 12:50:04 +00:00
|
|
|
}
|