From 0c0f16e2f7e72b48d490b52a467bcff712cc1dbe Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 21 Mar 2021 01:20:05 +0000 Subject: [PATCH] =?UTF-8?q?gtk4:=204.0.3=20=E2=86=92=204.2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switches to gi-docgen for building docs. --- pkgs/development/libraries/gtk/4.x.nix | 59 +++++++++++++------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/pkgs/development/libraries/gtk/4.x.nix b/pkgs/development/libraries/gtk/4.x.nix index 50b322c9dbaf..455e54ded21c 100644 --- a/pkgs/development/libraries/gtk/4.x.nix +++ b/pkgs/development/libraries/gtk/4.x.nix @@ -5,9 +5,7 @@ , pkg-config , gettext , graphene -, docbook-xsl-nons -, docbook_xml_dtd_43 -, gtk-doc +, gi-docgen , meson , ninja , python3 @@ -45,7 +43,6 @@ , wayland-protocols , xineramaSupport ? stdenv.isLinux , cupsSupport ? stdenv.isLinux -, withGtkDoc ? stdenv.isLinux , cups , AppKit , Cocoa @@ -64,9 +61,9 @@ in stdenv.mkDerivation rec { pname = "gtk4"; - version = "4.0.3"; + version = "4.2.1"; - outputs = [ "out" "dev" ] ++ lib.optional withGtkDoc "devdoc"; + outputs = [ "out" "dev" ] ++ lib.optionals x11Support [ "devdoc" ]; outputBin = "dev"; setupHooks = [ @@ -76,7 +73,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://gnome/sources/gtk/${lib.versions.majorMinor version}/gtk-${version}.tar.xz"; - sha256 = "18mJNyV5C1C9mjuyeIVtnVQ7RLa5uVHXtg573swTGJA="; + sha256 = "AjFpd13kPwof3gZvvBnXhUXqanViwZFavem4rkpzCeY="; }; nativeBuildInputs = [ @@ -88,21 +85,17 @@ stdenv.mkDerivation rec { pkg-config python3 sassc - ] ++ setupHooks ++ lib.optionals withGtkDoc [ - pandoc - docbook_xml_dtd_43 - docbook-xsl-nons - gtk-doc - # For xmllint - libxml2 - ]; + gi-docgen + ] ++ setupHooks; buildInputs = [ libxkbcommon epoxy json-glib isocodes + ] ++ lib.optionals (!stdenv.isDarwin) [ vulkan-headers + ] ++ [ librest libsoup ffmpeg @@ -141,18 +134,27 @@ stdenv.mkDerivation rec { glib graphene pango - vulkan-loader # TODO: Possibly not used on Darwin - + ] ++ lib.optionals (!stdenv.isDarwin) [ + vulkan-loader + ] ++ [ # Required for GSettings schemas at runtime. # Will be picked up by wrapGAppsHook. gsettings-desktop-schemas ]; mesonFlags = [ - "-Dgtk_doc=${lib.boolToString withGtkDoc}" - "-Dtests=false" - "-Dtracker3=${lib.boolToString trackerSupport}" - "-Dbroadway_backend=${lib.boolToString broadwaySupport}" + # ../docs/tools/shooter.c:4:10: fatal error: 'cairo-xlib.h' file not found + "-Dgtk_doc=${lib.boolToString x11Support}" + "-Dbuild-tests=false" + "-Dtracker=${if trackerSupport then "enabled" else "disabled"}" + "-Dbroadway-backend=${lib.boolToString broadwaySupport}" + ] ++ lib.optionals (!cupsSupport) [ + "-Dprint-cups=disabled" + ] ++ lib.optionals stdenv.isDarwin [ + "-Dvulkan=disabled" + "-Dmedia-gstreamer=disabled" # requires gstreamer-gl + ] ++ lib.optionals (!x11Support) [ + "-Dx11-backend=false" ]; doCheck = false; # needs X11 @@ -171,20 +173,12 @@ stdenv.mkDerivation rec { gdk/gen-gdk-gresources-xml.py gtk/gen-gtk-gresources-xml.py gtk/gentypefuncs.py - docs/reference/gtk/gtk-markdown-to-docbook ) chmod +x ''${files[@]} patchShebangs ''${files[@]} ''; - postBuild = lib.optionalString withGtkDoc '' - # Meson not building `custom_target`s passed to `custom_files` argument of `gnome.gtkdoc` function - # as part of the `install` target. We have to build the docs manually first. - # https://github.com/mesonbuild/meson/issues/2831 - ninja g{t,d,s}k4-doc - ''; - preInstall = '' OLD_PATH="$PATH" PATH="$PATH:$dev/bin" # so the install script finds gtk4-update-icon-cache @@ -202,6 +196,13 @@ stdenv.mkDerivation rec { for f in $dev/bin/gtk4-encode-symbolic-svg; do wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" done + + '' + lib.optionalString x11Support '' + # So that DevHelp can find this. + # TODO: Remove this with DevHelp 41. + mkdir -p "$devdoc/share/devhelp/books" + mv "$out/share/doc/"* "$devdoc/share/devhelp/books" + rmdir -p --ignore-fail-on-non-empty "$out/share/doc" ''; # Wrap demos