From e432e78d1cbe08a00ff1c2ea4dc05cedcc842627 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sat, 17 Apr 2021 14:33:00 +0200 Subject: [PATCH] glib: fix docs cross compilation (again) Do not depend on host gtk-doc when cross compiling (we do not use it there), and document why we need a host gtk-doc in the first place. --- pkgs/development/libraries/glib/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index ce64bef95ad..fccd6ddb041 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -92,13 +92,23 @@ stdenv.mkDerivation rec { buildInputs = [ libelf setupHook pcre bash gnum4 # install glib-gettextize and m4 macros for other apps to use - gtk-doc ] ++ optionals stdenv.isLinux [ libselinux util-linuxMinimal # for libmount ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Carbon Cocoa CoreFoundation CoreServices Foundation - ]); + ]) ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + # Note: this needs to be both in buildInputs and nativeBuildInputs. The + # Meson gtkdoc module uses find_program to look it up (-> build dep), but + # glib's own Meson configuration uses the host pkg-config to find its + # version (-> host dep). We could technically go and fix this in glib, add + # pkg-config to depsBuildBuild, but this would be a futile exercise since + # Meson's gtkdoc integration does not support cross compilation[1] anyway + # and this derivation disables the docs build when cross compiling. + # + # [1] https://github.com/mesonbuild/meson/issues/2003 + gtk-doc + ]; strictDeps = true;