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;