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