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