stevenblack-blocklist: 3.15.5 -> 3.15.8 (#372042)
[NixPkgs.git] / pkgs / by-name / ca / cardboard / package.nix
blob6b4e37ce6ad2876c5a8b4296afd392426eed765b
2   lib,
3   stdenv,
4   fetchFromGitLab,
5   fetchurl,
6   fetchgit,
7   ffmpeg,
8   libGL,
9   libX11,
10   libcap,
11   libdrm,
12   libinput,
13   libpng,
14   libxcb,
15   libxkbcommon,
16   libgbm,
17   meson,
18   ninja,
19   pandoc,
20   pixman,
21   pkg-config,
22   unzip,
23   wayland,
24   wayland-protocols,
25   wayland-scanner,
26   xcbutilerrors,
27   xcbutilimage,
28   xcbutilwm,
31 let
32   allSources = {
33     # cereal.wrap
34     cereal-wrap = fetchurl {
35       name = "cereal-1.3.0.tar.gz";
36       url = "https://github.com/USCiLab/cereal/archive/v1.3.0.tar.gz";
37       hash = "sha256-Mp6j4xMLAmwDpKzFDhaOfa/05uZhvGp9/sDXe1cIUdU=";
38     };
39     cereal-wrapdb = fetchurl {
40       name = "cereal-1.3.0-1-wrap.zip";
41       url = "https://wrapdb.mesonbuild.com/v1/projects/cereal/1.3.0/1/get_zip";
42       hash = "sha256-QYck5UT7fPLqtLDb1iOSX4Hnnns48Jj23Ae/LCfLSKY=";
43     };
45     # expected.wrap
46     expected-wrap = fetchgit {
47       name = "expected";
48       url = "https://gitlab.com/cardboardwm/expected";
49       rev = "0ee13cb2b058809aa9708c45ca18d494e72a759e";
50       hash = "sha256-gYr4/pjuLlr3k6Jcrg2/SzJLtbgyA+ZN2oMHkHXANDo=";
51     };
53     # wlroots.wrap
54     wlroots-wrap = fetchgit {
55       name = "wlroots";
56       url = "https://github.com/swaywm/wlroots";
57       rev = "0.12.0";
58       hash = "sha256-1rE3D+kQprjcjobc95/mQkUa5y1noY0MdoYJ/SpFQwY=";
59     };
61     # the source itself
62     cardboard = fetchFromGitLab {
63       owner = "cardboardwm";
64       repo = "cardboard";
65       rev = "b54758d85164fb19468f5ca52588ebea576cd027";
66       hash = "sha256-Kn5NyQSDyX7/nn2bKZPnsuepkoppi5XIkdu7IDy5r4w=";
67     };
68   };
70 stdenv.mkDerivation {
71   pname = "cardboard";
72   version = "unstable-2021-05-10";
74   src = allSources.cardboard;
76   outputs = [
77     "out"
78     "dev"
79     "lib"
80     "man"
81   ];
83   nativeBuildInputs = [
84     meson
85     ninja
86     pandoc
87     pkg-config
88     unzip
89     wayland-scanner
90   ];
92   buildInputs = [
93     ffmpeg
94     libGL
95     libX11
96     libcap
97     libdrm
98     libinput
99     libpng
100     libxcb
101     libxkbcommon
102     libgbm
103     pixman
104     wayland
105     wayland-protocols
106     xcbutilerrors
107     xcbutilimage
108     xcbutilwm
109   ];
111   postPatch = ''
112     pushd subprojects
113     tar xvf ${allSources.cereal-wrap}
114     unzip ${allSources.cereal-wrapdb}
115     cp -r ${allSources.expected-wrap} ${allSources.expected-wrap.name}
116     cp -r ${allSources.wlroots-wrap} ${allSources.wlroots-wrap.name}
117     popd
119     # gcc12
120     sed '1i#include <functional>' -i cardboard/ViewAnimation.h
121   '';
123   # "Inherited" from Nixpkgs expression for wlroots
124   mesonFlags = [
125     (lib.mesonBool "man" true)
126     (lib.mesonOption "wlroots:logind-provider" "systemd")
127     (lib.mesonEnable "wlroots:libseat" false)
128   ];
130   # gcc12
131   env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=array-bounds" ];
133   passthru = {
134     providedSessions = [ "cardboard" ];
135   };
137   meta = {
138     broken = true; # Upstream is archived, fails to build on gcc-13.
139     homepage = "https://gitlab.com/cardboardwm/cardboard";
140     description = "Scrollable, tiling Wayland compositor inspired on PaperWM";
141     license = lib.licenses.gpl3Only;
142     mainProgram = "cardboard";
143     maintainers = with lib.maintainers; [ AndersonTorres ];
144     inherit (wayland.meta) platforms;
145   };