2022-01-09 18:14:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, meson, ninja, pkg-config, wayland-scanner
|
2021-04-03 13:29:55 +00:00
|
|
|
, libGL, wayland, wayland-protocols, libinput, libxkbcommon, pixman
|
2019-05-28 19:09:34 +00:00
|
|
|
, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
|
2022-02-05 21:02:03 +00:00
|
|
|
, libpng, ffmpeg_4, xcbutilrenderutil, seatd, vulkan-loader, glslang
|
2021-12-28 20:32:26 +00:00
|
|
|
, nixosTests
|
2021-10-11 19:24:30 +00:00
|
|
|
|
|
|
|
, enableXWayland ? true, xwayland ? null
|
2017-10-31 21:31:05 +00:00
|
|
|
}:
|
|
|
|
|
2019-06-03 13:24:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-10-22 20:51:10 +00:00
|
|
|
pname = "wlroots";
|
2022-02-04 12:19:55 +00:00
|
|
|
version = "0.15.1";
|
2017-10-31 21:31:05 +00:00
|
|
|
|
2021-12-18 20:18:35 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "wlroots";
|
2017-10-31 21:31:05 +00:00
|
|
|
repo = "wlroots";
|
2018-10-22 20:51:10 +00:00
|
|
|
rev = version;
|
2022-02-04 12:19:55 +00:00
|
|
|
sha256 = "sha256-MFR38UuB/wW7J9ODDUOfgTzKLse0SSMIRYTpEaEdRwM=";
|
2017-10-31 21:31:05 +00:00
|
|
|
};
|
|
|
|
|
2019-08-27 09:09:43 +00:00
|
|
|
# $out for the library and $examples for the example programs (in examples):
|
|
|
|
outputs = [ "out" "examples" ];
|
2017-10-31 21:31:05 +00:00
|
|
|
|
2021-07-03 13:46:36 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
|
|
|
|
2022-01-26 08:32:07 +00:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config wayland-scanner glslang ];
|
2017-10-31 21:31:05 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-06-24 18:57:00 +00:00
|
|
|
libGL wayland wayland-protocols libinput libxkbcommon pixman
|
2019-05-28 19:09:34 +00:00
|
|
|
xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
|
2022-02-05 21:02:03 +00:00
|
|
|
libpng ffmpeg_4 xcbutilrenderutil seatd vulkan-loader
|
2021-10-11 19:24:30 +00:00
|
|
|
]
|
|
|
|
++ lib.optional enableXWayland xwayland
|
|
|
|
;
|
|
|
|
|
|
|
|
mesonFlags =
|
|
|
|
lib.optional (!enableXWayland) "-Dxwayland=disabled"
|
|
|
|
;
|
2018-10-22 20:51:10 +00:00
|
|
|
|
2019-02-03 16:52:53 +00:00
|
|
|
postFixup = ''
|
2018-10-22 20:51:10 +00:00
|
|
|
# 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
|
2018-10-24 21:40:20 +00:00
|
|
|
cd ./examples
|
|
|
|
for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
|
|
|
|
cp "$binary" "$examples/bin/wlroots-$binary"
|
2018-10-22 20:51:10 +00:00
|
|
|
done
|
2017-12-23 13:02:59 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-28 20:32:26 +00:00
|
|
|
# Test via TinyWL (the "minimum viable product" Wayland compositor based on wlroots):
|
|
|
|
passthru.tests.tinywl = nixosTests.tinywl;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2017-10-31 21:31:05 +00:00
|
|
|
description = "A modular Wayland compositor library";
|
2020-03-10 14:33:00 +00:00
|
|
|
longDescription = ''
|
|
|
|
Pluggable, composable, unopinionated modules for building a Wayland
|
|
|
|
compositor; or about 50,000 lines of code you were going to write anyway.
|
|
|
|
'';
|
2017-10-31 21:31:05 +00:00
|
|
|
inherit (src.meta) homepage;
|
2021-12-18 20:18:35 +00:00
|
|
|
changelog = "https://gitlab.freedesktop.org/wlroots/wlroots/-/tags/${version}";
|
2017-10-31 21:31:05 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2021-04-07 20:16:06 +00:00
|
|
|
maintainers = with maintainers; [ primeos synthetica ];
|
2017-10-31 21:31:05 +00:00
|
|
|
};
|
|
|
|
}
|