11 , withLibraries ? stdenv.isLinux
13 , withDocumentation ? withLibraries && stdenv.hostPlatform == stdenv.buildPlatform
24 # Documentation is only built when building libraries.
25 assert withDocumentation -> withLibraries;
28 isCross = stdenv.buildPlatform != stdenv.hostPlatform;
30 stdenv.mkDerivation rec {
35 url = "https://gitlab.freedesktop.org/wayland/wayland/-/releases/${version}/downloads/${pname}-${version}.tar.xz";
36 sha256 = "1b0ixya9bfw5c9jx8mzlr7yqnlyvd3jv5z8wln9scdv8q5zlvikd";
39 postPatch = lib.optionalString withDocumentation ''
40 patchShebangs doc/doxygen/gen-doxygen.py
41 '' + lib.optionalString stdenv.hostPlatform.isStatic ''
42 # delete line containing os-wrappers-test, disables
43 # the building of os-wrappers-test
44 sed -i '/os-wrappers-test/d' tests/meson.build
47 outputs = [ "out" "bin" "dev" ] ++ lib.optionals withDocumentation [ "doc" "man" ];
48 separateDebugInfo = true;
51 "-Dlibraries=${lib.boolToString withLibraries}"
52 "-Ddocumentation=${lib.boolToString withDocumentation}"
63 ] ++ lib.optionals isCross [
65 ] ++ lib.optionals withDocumentation [
66 (graphviz-nox.override { pango = null; }) # To avoid an infinite recursion
78 ] ++ lib.optionals withLibraries [
80 ] ++ lib.optionals withDocumentation [
87 # The pkg-config file is required for cross-compilation:
88 mkdir -p $bin/lib/pkgconfig/
89 cat <<EOF > $bin/lib/pkgconfig/wayland-scanner.pc
90 wayland_scanner=$bin/bin/wayland-scanner
93 Description: Wayland scanner
99 description = "Core Wayland window system code and protocol";
101 Wayland is a project to define a protocol for a compositor to talk to its
102 clients as well as a library implementation of the protocol.
103 The wayland protocol is essentially only about input handling and buffer
104 management, but also handles drag and drop, selections, window management
105 and other interactions that must go through the compositor (but not
108 homepage = "https://wayland.freedesktop.org/";
109 license = licenses.mit; # Expat version
110 platforms = if withLibraries then platforms.linux else platforms.unix;
111 maintainers = with maintainers; [ primeos codyopel qyliss ];
112 # big sur doesn't support gcc stdenv and wayland doesn't build with clang
113 broken = stdenv.isDarwin;
116 passthru.version = version;