2021-05-04 21:07:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cairo
|
|
|
|
, fontconfig
|
|
|
|
, 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-05-20 23:08:51 +00:00
|
|
|
version = "1.7.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-05-20 23:08:51 +00:00
|
|
|
hash = "sha256-1IztedN5/I/4TDKHLJ26fSrDsvJ5QAr+cbzS2PQITDE=";
|
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
|
|
|
|
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-20 23:08:51 +00:00
|
|
|
# TODO: investigate why is this happening
|
2021-05-04 21:07:42 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's|<drm_fourcc.h>|<libdrm/drm_fourcc.h>|' *.c
|
|
|
|
'';
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
postInstall = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
install -d $out/share/cagebreak/
|
|
|
|
install -m644 $src/examples/config $out/share/cagebreak/
|
2020-10-11 12:50:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
postFixup = lib.optionalString withXwayland ''
|
2020-10-11 12:50:04 +00:00
|
|
|
wrapProgram $out/bin/cagebreak --prefix PATH : "${xwayland}/bin"
|
|
|
|
'';
|
|
|
|
|
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
|
|
|
}
|