diff options
Diffstat (limited to 'pkgs/by-name/ca/cagebreak/package.nix')
| -rw-r--r-- | pkgs/by-name/ca/cagebreak/package.nix | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/pkgs/by-name/ca/cagebreak/package.nix b/pkgs/by-name/ca/cagebreak/package.nix new file mode 100644 index 000000000000..6bac3222e742 --- /dev/null +++ b/pkgs/by-name/ca/cagebreak/package.nix @@ -0,0 +1,97 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cairo, + fontconfig, + libdrm, + libevdev, + libinput, + libxkbcommon, + xcbutilwm, + makeWrapper, + meson, + ninja, + nixosTests, + pango, + pixman, + pkg-config, + scdoc, + systemd, + wayland, + wayland-protocols, + wayland-scanner, + withXwayland ? true, + xwayland, + wlroots_0_18, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "cagebreak"; + version = "2.4.0"; + + src = fetchFromGitHub { + owner = "project-repo"; + repo = "cagebreak"; + tag = finalAttrs.version; + hash = "sha256-eJLYv9CalBTOQEOMRg/5ctHByrkA44pfS7K3H4XTdSc="; + }; + + nativeBuildInputs = [ + makeWrapper + meson + ninja + pkg-config + scdoc + wayland-scanner + ]; + + buildInputs = [ + cairo + fontconfig + libdrm + libevdev + libinput + libxkbcommon + xcbutilwm + pango + pixman + systemd + wayland + wayland-protocols + wlroots_0_18 + ]; + + mesonFlags = [ + "-Dman-pages=true" + "-Dversion_override=${finalAttrs.version}" + "-Dxwayland=${lib.boolToString withXwayland}" + ]; + + postPatch = '' + # TODO: investigate why is this happening + sed -i -e 's|<drm_fourcc.h>|<libdrm/drm_fourcc.h>|' *.c + + # Patch cagebreak to read its default configuration from $out/share/cagebreak + sed -i "s|/etc/xdg/cagebreak|$out/share/cagebreak|" meson.build cagebreak.c + substituteInPlace meson.build \ + --replace "/usr/share/licenses" "$out/share/licenses" + ''; + + postFixup = lib.optionalString withXwayland '' + wrapProgram $out/bin/cagebreak \ + --prefix PATH : "${lib.makeBinPath [ xwayland ]}" + ''; + + meta = { + homepage = "https://github.com/project-repo/cagebreak"; + description = "Wayland tiling compositor inspired by ratpoison"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + platforms = lib.platforms.linux; + changelog = "https://github.com/project-repo/cagebreak/blob/${finalAttrs.version}/Changelog.md"; + mainProgram = "cagebreak"; + }; + + passthru.tests.basic = nixosTests.cagebreak; +}) |
