Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 97 lines 2.0 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cairo, 6 fontconfig, 7 libdrm, 8 libevdev, 9 libinput, 10 libxkbcommon, 11 xcbutilwm, 12 makeWrapper, 13 meson, 14 ninja, 15 nixosTests, 16 pango, 17 pixman, 18 pkg-config, 19 scdoc, 20 systemd, 21 wayland, 22 wayland-protocols, 23 wayland-scanner, 24 withXwayland ? true, 25 xwayland, 26 wlroots_0_18, 27}: 28 29stdenv.mkDerivation (finalAttrs: { 30 pname = "cagebreak"; 31 version = "3.0.0"; 32 33 src = fetchFromGitHub { 34 owner = "project-repo"; 35 repo = "cagebreak"; 36 tag = finalAttrs.version; 37 hash = "sha256-vXRIZqFyywRettzriOArl1FGdzWdaeVOfYFZCiPLQZg="; 38 }; 39 40 nativeBuildInputs = [ 41 makeWrapper 42 meson 43 ninja 44 pkg-config 45 scdoc 46 wayland-scanner 47 ]; 48 49 buildInputs = [ 50 cairo 51 fontconfig 52 libdrm 53 libevdev 54 libinput 55 libxkbcommon 56 xcbutilwm 57 pango 58 pixman 59 systemd 60 wayland 61 wayland-protocols 62 wlroots_0_18 63 ]; 64 65 mesonFlags = [ 66 "-Dman-pages=true" 67 "-Dversion_override=${finalAttrs.version}" 68 "-Dxwayland=${lib.boolToString withXwayland}" 69 ]; 70 71 postPatch = '' 72 # TODO: investigate why is this happening 73 sed -i -e 's|<drm_fourcc.h>|<libdrm/drm_fourcc.h>|' *.c 74 75 # Patch cagebreak to read its default configuration from $out/share/cagebreak 76 sed -i "s|/etc/xdg/cagebreak|$out/share/cagebreak|" meson.build cagebreak.c 77 substituteInPlace meson.build \ 78 --replace "/usr/share/licenses" "$out/share/licenses" 79 ''; 80 81 postFixup = lib.optionalString withXwayland '' 82 wrapProgram $out/bin/cagebreak \ 83 --prefix PATH : "${lib.makeBinPath [ xwayland ]}" 84 ''; 85 86 meta = { 87 homepage = "https://github.com/project-repo/cagebreak"; 88 description = "Wayland tiling compositor inspired by ratpoison"; 89 license = lib.licenses.mit; 90 maintainers = with lib.maintainers; [ ]; 91 platforms = lib.platforms.linux; 92 changelog = "https://github.com/project-repo/cagebreak/blob/${finalAttrs.version}/Changelog.md"; 93 mainProgram = "cagebreak"; 94 }; 95 96 passthru.tests.basic = nixosTests.cagebreak; 97})