2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, fetchurl
|
|
|
|
, fetchgit
|
|
|
|
, ffmpeg
|
|
|
|
, libGL
|
|
|
|
, libX11
|
|
|
|
, libcap
|
|
|
|
, libdrm
|
|
|
|
, libinput
|
|
|
|
, libpng
|
|
|
|
, libxcb
|
|
|
|
, libxkbcommon
|
|
|
|
, mesa
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pandoc
|
|
|
|
, pixman
|
|
|
|
, pkg-config
|
|
|
|
, unzip
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, xcbutilerrors
|
|
|
|
, xcbutilimage
|
|
|
|
, xcbutilwm
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# cereal.wrap
|
|
|
|
cereal-wrap = fetchurl {
|
|
|
|
name = "cereal-1.3.0.tar.gz";
|
|
|
|
url = "https://github.com/USCiLab/cereal/archive/v1.3.0.tar.gz";
|
|
|
|
hash = "sha256-Mp6j4xMLAmwDpKzFDhaOfa/05uZhvGp9/sDXe1cIUdU=";
|
|
|
|
};
|
|
|
|
cereal-wrapdb = fetchurl {
|
|
|
|
name = "cereal-1.3.0-1-wrap.zip";
|
|
|
|
url = "https://wrapdb.mesonbuild.com/v1/projects/cereal/1.3.0/1/get_zip";
|
|
|
|
hash = "sha256-QYck5UT7fPLqtLDb1iOSX4Hnnns48Jj23Ae/LCfLSKY=";
|
|
|
|
};
|
|
|
|
|
|
|
|
# expected.wrap
|
|
|
|
expected-wrap = fetchgit {
|
|
|
|
name = "expected";
|
|
|
|
url = "https://gitlab.com/cardboardwm/expected";
|
|
|
|
rev = "0ee13cb2b058809aa9708c45ca18d494e72a759e";
|
|
|
|
sha256 = "sha256-gYr4/pjuLlr3k6Jcrg2/SzJLtbgyA+ZN2oMHkHXANDo=";
|
|
|
|
};
|
|
|
|
|
|
|
|
# wlroots.wrap
|
|
|
|
wlroots-wrap = fetchgit {
|
|
|
|
name = "wlroots";
|
|
|
|
url = "https://github.com/swaywm/wlroots";
|
|
|
|
rev = "0.12.0";
|
|
|
|
sha256 = "sha256-1rE3D+kQprjcjobc95/mQkUa5y1noY0MdoYJ/SpFQwY=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cardboard";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "unstable=2021-05-10";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "cardboardwm";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = "cardboard";
|
2021-05-20 23:08:51 +00:00
|
|
|
rev = "b54758d85164fb19468f5ca52588ebea576cd027";
|
|
|
|
hash = "sha256-Kn5NyQSDyX7/nn2bKZPnsuepkoppi5XIkdu7IDy5r4w=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pandoc
|
|
|
|
pkg-config
|
|
|
|
unzip
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [
|
|
|
|
ffmpeg
|
|
|
|
libGL
|
|
|
|
libX11
|
|
|
|
libcap
|
|
|
|
libdrm
|
|
|
|
libinput
|
|
|
|
libpng
|
|
|
|
libxcb
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
|
|
|
pixman
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
xcbutilerrors
|
|
|
|
xcbutilimage
|
|
|
|
xcbutilwm
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
pushd subprojects
|
|
|
|
tar xvf ${cereal-wrap}
|
|
|
|
unzip ${cereal-wrapdb}
|
|
|
|
cp -r ${expected-wrap} ${expected-wrap.name}
|
|
|
|
cp -r ${wlroots-wrap} ${wlroots-wrap.name}
|
|
|
|
popd
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
sed '1i#include <functional>' -i cardboard/ViewAnimation.h # gcc12
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# "Inherited" from Nixpkgs expression for wlroots
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dman=true"
|
|
|
|
"-Dwlroots:logind-provider=systemd"
|
|
|
|
"-Dwlroots:libseat=disabled"
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=array-bounds" ]; # gcc12
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = {
|
2021-05-20 23:08:51 +00:00
|
|
|
homepage = "https://gitlab.com/cardboardwm/cardboard";
|
|
|
|
description = "A scrollable, tiling Wayland compositor inspired on PaperWM";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
inherit (wayland.meta) platforms;
|
|
|
|
knownVulnerabilities = [
|
|
|
|
"CVE-2020-11104 (inherited from cereal 1.3.0)"
|
|
|
|
"CVE-2020-11105 (inherited from cereal 1.3.0)"
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|