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

96 lines
1.9 KiB
Nix
Raw Normal View History

2021-05-04 19:27:52 +00:00
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
2021-05-04 19:27:52 +00:00
, cairo
, fontconfig
, 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";
version = "1.7.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;
hash = "sha256-1IztedN5/I/4TDKHLJ26fSrDsvJ5QAr+cbzS2PQITDE=";
2020-10-06 02:18:44 +00:00
};
patches = [
# To fix the build with wlroots 0.14.0:
(fetchpatch {
# Add fixes for wlroots 0.14.0
url = "https://github.com/project-repo/cagebreak/commit/d57869d43add58331386fc8e89c14bb2b74afe17.patch";
sha256 = "0g6sl8y4kk0bm5x6pxqbxw2j0gyg3ybr2v9m70q2pxp70kms4lqg";
})
];
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
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 = [
"-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
];
# TODO: investigate why is this happening
2021-05-04 00:20:17 +00:00
postPatch = ''
sed -i -e 's|<drm_fourcc.h>|<libdrm/drm_fourcc.h>|' *.c
'';
2020-10-06 02:18:44 +00:00
postInstall = ''
install -d $out/share/cagebreak/
install -m644 $src/examples/config $out/share/cagebreak/
2020-10-06 02:18:44 +00:00
'';
2021-01-15 13:21:58 +00:00
postFixup = lib.optionalString withXwayland ''
2020-10-06 02:18:44 +00:00
wrapProgram $out/bin/cagebreak --prefix PATH : "${xwayland}/bin"
'';
meta = with lib; {
2020-10-06 02:18:44 +00:00
homepage = "https://github.com/project-repo/cagebreak";
description = "A Wayland tiling compositor inspired by ratpoison";
2020-10-06 02:18:44 +00:00
license = licenses.mit;
maintainers = with maintainers; [ berbiche ];
platforms = platforms.linux;
2020-10-06 02:18:44 +00:00
};
passthru.tests.basic = nixosTests.cagebreak;
2020-10-06 02:18:44 +00:00
}