30 enableXWayland ? true,
39 extraBuildInputs ? [ ],
40 extraNativeBuildInputs ? [ ],
44 stdenv.mkDerivation (finalAttrs: {
48 inherit enableXWayland;
50 src = fetchFromGitLab {
51 domain = "gitlab.freedesktop.org";
54 rev = finalAttrs.version;
58 inherit patches postPatch;
60 # $out for the library and $examples for the example programs (in examples):
67 depsBuildBuild = [ pkg-config ];
75 ] ++ extraNativeBuildInputs;
93 xorg.xcbutilrenderutil
96 ++ lib.optional finalAttrs.enableXWayland xwayland
99 mesonFlags = lib.optional (!finalAttrs.enableXWayland) "-Dxwayland=disabled";
102 # Install ALL example programs to $examples:
103 # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
104 # screenshot output-layout multi-pointer rotation tablet touch pointer
106 mkdir -p $examples/bin
108 for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
109 cp "$binary" "$examples/bin/wlroots-$binary"
113 # Test via TinyWL (the "minimum viable product" Wayland compositor based on wlroots):
115 tinywl = nixosTests.tinywl;
116 pkg-config = testers.hasPkgConfigModules {
117 package = finalAttrs.finalPackage;
122 description = "Modular Wayland compositor library";
124 Pluggable, composable, unopinionated modules for building a Wayland
125 compositor; or about 50,000 lines of code you were going to write anyway.
127 inherit (finalAttrs.src.meta) homepage;
128 changelog = "https://gitlab.freedesktop.org/wlroots/wlroots/-/tags/${version}";
129 license = lib.licenses.mit;
130 platforms = lib.platforms.linux;
131 maintainers = with lib.maintainers; [
138 if lib.versionOlder finalAttrs.version "0.18" then
141 "wlroots-${lib.versions.majorMinor finalAttrs.version}"
149 wlroots_0_17 = generic {
151 hash = "sha256-AzmXf+HMX/6VAr0LpfHwfmDB9dRrrLQHt7l35K98MVo=";
152 extraNativeBuildInputs = [
162 wlroots_0_18 = generic {
164 hash = "sha256-vKvMWRPPJ4PRKWVjmKKCdNSiqsQm+uQBoBnBUFElLNA=";
165 extraNativeBuildInputs = [
176 wlroots = wlroots_0_18;