@@ -1,43 +1,66 @@
1−{ lib, stdenv, fetchurl, pkgconfig
1+{ lib, stdenv, fetchurl, meson, pkgconfig, ninja
22, libffi, libxml2, wayland
33, expat ? null # Build wayland-scanner (currently cannot be disabled as of 1.7.0)
4+, withDocumentation ? false, graphviz-nox, doxygen, libxslt, xmlto, python3
5+, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42
46}:
57
68# Require the optional to be enabled until upstream fixes or removes the configure flag
79assert expat != null;
810
9−stdenv.mkDerivation rec {
11+let
12+ isCross = stdenv.buildPlatform != stdenv.hostPlatform;
13+in stdenv.mkDerivation rec {
1014 pname = "wayland";
11− version = "1.17.0";
15+ version = "1.18.0";
1216
1317 src = fetchurl {
1418 url = "https://wayland.freedesktop.org/releases/${pname}-${version}.tar.xz";
15− sha256 = "194ibzwpdcn6fvk4xngr4bf5axpciwg2bj82fdvz88kfmjw13akj";
19+ sha256 = "0k995rn96xkplrapz5k648j651wc43kq817xk1x8280h16gsfxa6";
1620 };
1721
1822 separateDebugInfo = true;
1923
20− configureFlags = [
21− "--disable-documentation"
22− ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
23− "--with-host-scanner"
24− ];
24+ mesonFlags = [ "-Ddocumentation=${lib.boolToString withDocumentation}" ];
25+
26+ patches = lib.optional isCross ./fix-wayland-cross-compilation.patch;
27+
28+ postPatch = lib.optionalString withDocumentation ''
29+ patchShebangs doc/doxygen/gen-doxygen.py
30+ '' + lib.optionalString isCross ''
31+ substituteInPlace egl/meson.build --replace \
32+ "find_program('nm').path()" \
33+ "find_program('${stdenv.cc.targetPrefix}nm').path()"
34+ '';
2535
2636 nativeBuildInputs = [
27− pkgconfig
28− ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
29− # for wayland-scanner during build
30− wayland
37+ meson pkgconfig ninja
38+ ] ++ lib.optionals isCross [
39+ wayland # For wayland-scanner during the build
40+ ] ++ lib.optionals withDocumentation [
41+ (graphviz-nox.override { pango = null; }) # To avoid an infinite recursion
42+ doxygen libxslt xmlto python3 docbook_xml_dtd_45
3143 ];
3244
33− buildInputs = [ libffi /* docbook_xsl doxygen graphviz libxslt xmlto */ expat libxml2 ];
45+ buildInputs = [ libffi expat libxml2
46+ ] ++ lib.optionals withDocumentation [
47+ docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42
48+ ];
3449
3550 meta = {
36− description = "Reference implementation of the wayland protocol";
51+ description = "Core Wayland window system code and protocol";
52+ longDescription = ''
53+ Wayland is a project to define a protocol for a compositor to talk to its
54+ clients as well as a library implementation of the protocol.
55+ The wayland protocol is essentially only about input handling and buffer
56+ management, but also handles drag and drop, selections, window management
57+ and other interactions that must go through the compositor (but not
58+ rendering).
59+ '';
3760 homepage = https://wayland.freedesktop.org/;
38− license = lib.licenses.mit;
61+ license = lib.licenses.mit; # Expat version
3962 platforms = lib.platforms.linux;
40− maintainers = with lib.maintainers; [ codyopel ];
63+ maintainers = with lib.maintainers; [ primeos codyopel ];
4164 };
4265
4366 passthru.version = version;