10 , withLibraries ? stdenv.isLinux || stdenv.isDarwin
11 , withTests ? stdenv.isLinux
14 , withDocumentation ? withLibraries && stdenv.hostPlatform == stdenv.buildPlatform
25 # Documentation is only built when building libraries.
26 assert withDocumentation -> withLibraries;
28 # Tests are only built when building libraries.
29 assert withTests -> withLibraries;
32 isCross = stdenv.buildPlatform != stdenv.hostPlatform;
34 stdenv.mkDerivation rec {
39 url = "https://gitlab.freedesktop.org/wayland/wayland/-/releases/${version}/downloads/${pname}-${version}.tar.xz";
40 hash = "sha256-FUCvHqaYpHHC2OnSiDMsfg/TYMjx0Sk267fny8JCWEI=";
47 postPatch = lib.optionalString withDocumentation ''
48 patchShebangs doc/doxygen/gen-doxygen.py
49 '' + lib.optionalString stdenv.hostPlatform.isStatic ''
50 # delete line containing os-wrappers-test, disables
51 # the building of os-wrappers-test
52 sed -i '/os-wrappers-test/d' tests/meson.build
55 outputs = [ "out" "bin" "dev" ] ++ lib.optionals withDocumentation [ "doc" "man" ];
56 separateDebugInfo = true;
59 "-Ddocumentation=${lib.boolToString withDocumentation}"
60 "-Dlibraries=${lib.boolToString withLibraries}"
61 "-Dtests=${lib.boolToString withTests}"
72 ] ++ lib.optionals isCross [
74 ] ++ lib.optionals withDocumentation [
75 (graphviz-nox.override { pango = null; }) # To avoid an infinite recursion
87 ] ++ lib.optionals withLibraries [
89 ] ++ lib.optionals (withLibraries && !stdenv.hostPlatform.isLinux) [
91 ] ++ lib.optionals withDocumentation [
98 # The pkg-config file is required for cross-compilation:
99 mkdir -p $bin/lib/pkgconfig/
100 cat <<EOF > $bin/lib/pkgconfig/wayland-scanner.pc
101 wayland_scanner=$bin/bin/wayland-scanner
103 Name: Wayland Scanner
104 Description: Wayland scanner
109 passthru = { inherit withLibraries; };
112 description = "Core Wayland window system code and protocol";
114 Wayland is a project to define a protocol for a compositor to talk to its
115 clients as well as a library implementation of the protocol.
116 The wayland protocol is essentially only about input handling and buffer
117 management, but also handles drag and drop, selections, window management
118 and other interactions that must go through the compositor (but not
121 homepage = "https://wayland.freedesktop.org/";
122 license = licenses.mit; # Expat version
123 platforms = platforms.unix;
124 maintainers = with maintainers; [ primeos codyopel qyliss ];