2022-01-26 04:04:25 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, meson, ninja, pkg-config, wayland-scanner
|
2021-04-26 19:14:03 +00:00
|
|
|
, libGL, wayland, wayland-protocols, libinput, libxkbcommon, pixman
|
2020-04-24 23:36:52 +00:00
|
|
|
, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
|
2022-02-10 20:34:41 +00:00
|
|
|
, libpng, ffmpeg_4, xcbutilrenderutil, seatd, vulkan-loader, glslang
|
2022-01-19 23:45:15 +00:00
|
|
|
, nixosTests
|
2021-10-17 09:34:42 +00:00
|
|
|
|
|
|
|
, enableXWayland ? true, xwayland ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "wlroots";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.15.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "wlroots";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "wlroots";
|
|
|
|
rev = version;
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256-MFR38UuB/wW7J9ODDUOfgTzKLse0SSMIRYTpEaEdRwM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# $out for the library and $examples for the example programs (in examples):
|
|
|
|
outputs = [ "out" "examples" ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
2021-07-04 02:40:35 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config wayland-scanner glslang ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-07-18 16:06:22 +00:00
|
|
|
libGL wayland wayland-protocols libinput libxkbcommon pixman
|
2020-04-24 23:36:52 +00:00
|
|
|
xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
|
2022-02-10 20:34:41 +00:00
|
|
|
libpng ffmpeg_4 xcbutilrenderutil seatd vulkan-loader
|
2021-10-17 09:34:42 +00:00
|
|
|
]
|
|
|
|
++ lib.optional enableXWayland xwayland
|
|
|
|
;
|
|
|
|
|
|
|
|
mesonFlags =
|
|
|
|
lib.optional (!enableXWayland) "-Dxwayland=disabled"
|
|
|
|
;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Install ALL example programs to $examples:
|
|
|
|
# screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
|
|
|
|
# screenshot output-layout multi-pointer rotation tablet touch pointer
|
|
|
|
# simple
|
|
|
|
mkdir -p $examples/bin
|
|
|
|
cd ./examples
|
|
|
|
for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
|
|
|
|
cp "$binary" "$examples/bin/wlroots-$binary"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
# Test via TinyWL (the "minimum viable product" Wayland compositor based on wlroots):
|
|
|
|
passthru.tests.tinywl = nixosTests.tinywl;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A modular Wayland compositor library";
|
|
|
|
longDescription = ''
|
|
|
|
Pluggable, composable, unopinionated modules for building a Wayland
|
|
|
|
compositor; or about 50,000 lines of code you were going to write anyway.
|
|
|
|
'';
|
|
|
|
inherit (src.meta) homepage;
|
2022-01-13 20:06:32 +00:00
|
|
|
changelog = "https://gitlab.freedesktop.org/wlroots/wlroots/-/tags/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2021-04-08 16:26:57 +00:00
|
|
|
maintainers = with maintainers; [ primeos synthetica ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|