summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2022-07-12 16:14:46 +0300
committerGitHub <noreply@github.com>2022-07-12 16:14:46 +0300
commit4427b7dfabc4586b90a7afe3e3085f7e9b2909c2 (patch)
tree19f4eda3d74814220967671e5db994d7d2d71741 /pkgs/development
parentb2fe1ecd272328d3f89420bc1db86480373ebe22 (diff)
parent20642e2ab0c278f1e51ca2e63ec0836f91b5451d (diff)
downloadnixpkgs-4427b7dfabc4586b90a7afe3e3085f7e9b2909c2.tar
nixpkgs-4427b7dfabc4586b90a7afe3e3085f7e9b2909c2.tar.gz
nixpkgs-4427b7dfabc4586b90a7afe3e3085f7e9b2909c2.tar.bz2
nixpkgs-4427b7dfabc4586b90a7afe3e3085f7e9b2909c2.tar.lz
nixpkgs-4427b7dfabc4586b90a7afe3e3085f7e9b2909c2.tar.xz
nixpkgs-4427b7dfabc4586b90a7afe3e3085f7e9b2909c2.tar.zst
nixpkgs-4427b7dfabc4586b90a7afe3e3085f7e9b2909c2.zip
Merge pull request #177538 from Artturin/fixcross3
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/atk/default.nix6
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/default.nix33
-rw-r--r--pkgs/development/libraries/geoclue/default.nix4
-rw-r--r--pkgs/development/libraries/gobject-introspection/default.nix24
-rw-r--r--pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch32
-rw-r--r--pkgs/development/libraries/gobject-introspection/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/gobject-introspection/wrapper.nix7
-rw-r--r--pkgs/development/libraries/gstreamer/bad/default.nix6
-rw-r--r--pkgs/development/libraries/gstreamer/base/default.nix11
-rw-r--r--pkgs/development/libraries/gstreamer/core/default.nix12
-rw-r--r--pkgs/development/libraries/gstreamer/devtools/default.nix7
-rw-r--r--pkgs/development/libraries/gstreamer/ges/default.nix3
-rw-r--r--pkgs/development/libraries/gstreamer/rtsp-server/default.nix3
-rw-r--r--pkgs/development/libraries/gtk/3.x.nix2
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix11
-rw-r--r--pkgs/development/libraries/json-glib/default.nix29
-rw-r--r--pkgs/development/libraries/libgudev/default.nix26
-rw-r--r--pkgs/development/libraries/libical/default.nix11
-rw-r--r--pkgs/development/libraries/libmanette/default.nix4
-rw-r--r--pkgs/development/libraries/librdf/raptor2.nix24
-rw-r--r--pkgs/development/libraries/libsecret/default.nix5
-rw-r--r--pkgs/development/libraries/libsoup/default.nix25
-rw-r--r--pkgs/development/libraries/neon/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/4.x.nix5
-rw-r--r--pkgs/development/libraries/pango/default.nix28
-rw-r--r--pkgs/development/libraries/polkit/default.nix20
-rw-r--r--pkgs/development/libraries/tracker/default.nix32
-rw-r--r--pkgs/development/python-modules/pygobject/3.nix15
28 files changed, 254 insertions, 137 deletions
diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix
index ce3352b5751..268bf43eb3e 100644
--- a/pkgs/development/libraries/atk/default.nix
+++ b/pkgs/development/libraries/atk/default.nix
@@ -39,15 +39,13 @@ stdenv.mkDerivation rec {
     fixDarwinDylibNames
   ];
 
+  buildInputs = [ gobject-introspection ];
+
   propagatedBuildInputs = [
     # Required by atk.pc
     glib
   ];
 
-  mesonFlags = [
-    "-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
-  ];
-
   doCheck = true;
 
   passthru = {
diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index cbed6a62a3c..ff8ace9613f 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -16,22 +16,18 @@
 , libjpeg
 , libpng
 , gnome
+, gobject-introspection
+, buildPackages
 , doCheck ? false
 , makeWrapper
 , lib
-, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
-, gobject-introspection
 }:
 
-let
-  withGtkDoc = stdenv.buildPlatform == stdenv.hostPlatform;
-in
 stdenv.mkDerivation rec {
   pname = "gdk-pixbuf";
   version = "2.42.8";
 
-  outputs = [ "out" "dev" "man" ]
-    ++ lib.optional withGtkDoc "devdoc"
+  outputs = [ "out" "dev" "man" "devdoc" ]
     ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests";
 
   src = fetchurl {
@@ -60,6 +56,7 @@ stdenv.mkDerivation rec {
     makeWrapper
     glib
     gi-docgen
+    gobject-introspection
 
     # for man pages
     libxslt
@@ -67,10 +64,10 @@ stdenv.mkDerivation rec {
     docbook_xml_dtd_43
   ] ++ lib.optionals stdenv.isDarwin [
     fixDarwinDylibNames
-  ] ++ lib.optionals withIntrospection [
-    gobject-introspection
   ];
 
+  buildInputs = [ gobject-introspection ];
+
   propagatedBuildInputs = [
     glib
     libtiff
@@ -79,9 +76,8 @@ stdenv.mkDerivation rec {
   ];
 
   mesonFlags = [
-    "-Dgtk_doc=${lib.boolToString withGtkDoc}"
-    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
     "-Dgio_sniffing=false"
+    "-Dgtk_doc=true"
   ];
 
   postPatch = ''
@@ -89,10 +85,13 @@ stdenv.mkDerivation rec {
     patchShebangs build-aux
 
     substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
-  '';
 
-  preInstall = ''
-    PATH=$PATH:$out/bin # for install script
+    # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
+    # it should be a build-time dep for build
+    # TODO: send upstream
+    substituteInPlace docs/meson.build \
+      --replace "dependency('gi-docgen'," "dependency('gi-docgen', native:true," \
+      --replace "'gi-docgen', req" "'gi-docgen', native:true, req"
   '';
 
   postInstall =
@@ -108,9 +107,9 @@ stdenv.mkDerivation rec {
           install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
           mv $f ''${f%.dylib}.so
       done
-    '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+    '' + ''
       # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
-      $dev/bin/gdk-pixbuf-query-loaders --update-cache
+      ${stdenv.hostPlatform.emulator buildPackages} $dev/bin/gdk-pixbuf-query-loaders --update-cache
     '';
 
   # The fixDarwinDylibNames hook doesn't patch binaries.
@@ -120,7 +119,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  postFixup = lib.optionalString withGtkDoc ''
+  postFixup = ''
     # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
     moveToOutput "share/doc" "$devdoc"
   '';
diff --git a/pkgs/development/libraries/geoclue/default.nix b/pkgs/development/libraries/geoclue/default.nix
index 39156c95949..7756f6169cc 100644
--- a/pkgs/development/libraries/geoclue/default.nix
+++ b/pkgs/development/libraries/geoclue/default.nix
@@ -4,6 +4,7 @@
 , fetchpatch
 , intltool
 , meson
+, mesonEmulatorHook
 , ninja
 , pkg-config
 , gtk-doc
@@ -74,6 +75,8 @@ stdenv.mkDerivation rec {
     gtk-doc
     docbook-xsl-nons
     docbook_xml_dtd_412
+  ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
+    mesonEmulatorHook
   ];
 
   buildInputs = [
@@ -81,6 +84,7 @@ stdenv.mkDerivation rec {
     json-glib
     libsoup
     avahi
+    gobject-introspection
   ] ++ lib.optionals withDemoAgent [
     libnotify gdk-pixbuf
   ] ++ lib.optionals (!stdenv.isDarwin) [
diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix
index 82be84e1f1d..bfcb9a44014 100644
--- a/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/pkgs/development/libraries/gobject-introspection/default.nix
@@ -27,7 +27,7 @@
 # it may be worth thinking about using multiple derivation outputs
 # In that case its about 6MB which could be separated
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "gobject-introspection";
   version = "1.72.0";
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gobject-introspection/${lib.versions.majorMinor finalAttrs.version}/gobject-introspection-${finalAttrs.version}.tar.xz";
     sha256 = "Av6OWQhh2I+DBg3TnNpcyqYLLaHSHQ+VSZMBsYa+qrw=";
   };
 
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
     docbook-xsl-nons
     docbook_xml_dtd_45
     python3
-    setupHook # move .gir files
+    finalAttrs.setupHook # move .gir files
   ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ gobject-introspection-unwrapped ];
 
   buildInputs = [
@@ -105,6 +105,10 @@ stdenv.mkDerivation rec {
 
   postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     cp -r ${buildPackages.gobject-introspection-unwrapped.devdoc} $devdoc
+    # these are uncompiled c and header files which aren't installed when cross-compiling because
+    # code that installs them is in tests/meson.build which is only run when not cross-compiling
+    # pygobject3 needs them
+    cp -r ${buildPackages.gobject-introspection-unwrapped.dev}/share/gobject-introspection-1.0/tests $dev/share/gobject-introspection-1.0/tests
   '';
 
   preCheck = ''
@@ -120,11 +124,21 @@ stdenv.mkDerivation rec {
     rm $out/lib/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary}
   '';
 
+  # when cross-compiling and using the wrapper then when a package looks up the g_ir_X
+  # variable with pkg-config they'll get the host version which can't be run
+  # switch the variables to use g_ir_X from path instead of an absolute path
+  postFixup = lib.optionalString (!lib.hasSuffix "wrapped" finalAttrs.pname) ''
+    find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do
+        substituteInPlace "$pc" \
+          --replace '=''${bindir}/g-ir' '=g-ir'
+    done
+  '';
+
   setupHook = ./setup-hook.sh;
 
   passthru = {
     updateScript = gnome.updateScript {
-      packageName = pname;
+      packageName = "gobject-introspection";
       versionPolicy = "odd-unstable";
     };
   };
@@ -144,4 +158,4 @@ stdenv.mkDerivation rec {
       automatically provide bindings to call into the C library.
     '';
   };
-}
+})
diff --git a/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch b/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch
new file mode 100644
index 00000000000..bf1c1f1b713
--- /dev/null
+++ b/pkgs/development/libraries/gobject-introspection/giscanner-ignore-error-return-codes-from-ldd-wrapper.patch
@@ -0,0 +1,32 @@
+From e0fc4a2a5161a36483ddc518be9bb14390f11b19 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 5 Sep 2018 16:46:52 +0200
+Subject: [PATCH] giscanner: ignore error return codes from ldd-wrapper
+
+prelink-rtld, which we use instead of ldd returns 127 when it can't find a library.
+It is not an error per se, but it breaks subprocess.check_output().
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+---
+ giscanner/shlibs.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
+index 9f8ab5df..7a1a72fe 100644
+--- a/giscanner/shlibs.py
++++ b/giscanner/shlibs.py
+@@ -103,7 +103,7 @@ def _resolve_non_libtool(options, binary, libraries):
+             args.extend(['otool', '-L', binary.args[0]])
+         else:
+             args.extend(['ldd', binary.args[0]])
+-        output = subprocess.check_output(args)
++        output = subprocess.run(args, check=False, stdout=subprocess.PIPE).stdout
+         if isinstance(output, bytes):
+             output = output.decode("utf-8", "replace")
+ 
+-- 
+2.25.1
+
+
diff --git a/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
index 6bee47aeb09..50571a8f914 100644
--- a/pkgs/development/libraries/gobject-introspection/setup-hook.sh
+++ b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
@@ -10,7 +10,7 @@ make_gobject_introspection_find_gir_files() {
     fi
 }
 
-addEnvHooks "$hostOffset" make_gobject_introspection_find_gir_files
+addEnvHooks "$targetOffset" make_gobject_introspection_find_gir_files
 
 giDiscoverSelf() {
     if [ -d "$prefix/lib/girepository-1.0" ]; then
diff --git a/pkgs/development/libraries/gobject-introspection/wrapper.nix b/pkgs/development/libraries/gobject-introspection/wrapper.nix
index 44d31540e64..46000073205 100644
--- a/pkgs/development/libraries/gobject-introspection/wrapper.nix
+++ b/pkgs/development/libraries/gobject-introspection/wrapper.nix
@@ -7,9 +7,12 @@
 
 # to build, run
 # `nix build ".#pkgsCross.aarch64-multiplatform.buildPackages.gobject-introspection"`
-gobject-introspection-unwrapped.overrideAttrs (_previousAttrs: {
+gobject-introspection-unwrapped.overrideAttrs (previousAttrs: {
   pname = "gobject-introspection-wrapped";
-  postFixup = ''
+  # failure in e.g. pkgsCross.aarch64-multiplatform.polkit
+  # subprocess.CalledProcessError: Command '['/nix/store/...-prelink-unstable-2019-06-24/bin/prelink-rtld', '/build/source/build/tmp-introspectzp2ldkyk/PolkitAgent-1.0']' returned non-zero exit status 127.
+  patches = previousAttrs.patches ++ [ ./giscanner-ignore-error-return-codes-from-ldd-wrapper.patch ];
+  postFixup = (previousAttrs.postFixup or "") + ''
     mv $dev/bin/g-ir-compiler $dev/bin/.g-ir-compiler-wrapped
     mv $dev/bin/g-ir-scanner $dev/bin/.g-ir-scanner-wrapped
 
diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix
index 28bcbe9a74c..6d940362a21 100644
--- a/pkgs/development/libraries/gstreamer/bad/default.nix
+++ b/pkgs/development/libraries/gstreamer/bad/default.nix
@@ -121,11 +121,9 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
+    gobject-introspection
     gst-plugins-base
     orc
-    # gobject-introspection has to be in both nativeBuildInputs and
-    # buildInputs. The build tries to link against libgirepository-1.0.so
-    gobject-introspection
     json-glib
     ldacbt
     libass
@@ -294,8 +292,6 @@ stdenv.mkDerivation rec {
     # `applemedia/videotexturecache.h` requires `gst/gl/gl.h`,
     # but its meson build system does not declare the dependency.
     "-Dapplemedia=disabled"
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-    "-Dintrospection=disabled"
   ] ++ (if enableGplPlugins then [
     "-Dgpl=enabled"
   ] else [
diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix
index 599e6586ea0..c9e9c7f3248 100644
--- a/pkgs/development/libraries/gstreamer/base/default.nix
+++ b/pkgs/development/libraries/gstreamer/base/default.nix
@@ -18,6 +18,7 @@
 , libvisual
 , tremor # provides 'virbisidec'
 , libGL
+, gobject-introspection
 , enableX11 ? stdenv.isLinux
 , libXv
 , libXext
@@ -36,8 +37,6 @@
 , enableCdparanoia ? (!stdenv.isDarwin)
 , cdparanoia
 , glib
-, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
-, gobject-introspection
 }:
 
 stdenv.mkDerivation rec {
@@ -52,6 +51,9 @@ stdenv.mkDerivation rec {
   };
 
   strictDeps = true;
+  depsBuildBuild = [
+    pkg-config
+  ];
   nativeBuildInputs = [
     meson
     ninja
@@ -63,11 +65,11 @@ stdenv.mkDerivation rec {
     gstreamer
     # docs
     # TODO add hotdoc here
-  ] ++ lib.optionals withIntrospection [
     gobject-introspection
   ] ++ lib.optional enableWayland wayland;
 
   buildInputs = [
+    gobject-introspection
     orc
     libtheora
     libintl
@@ -91,8 +93,6 @@ stdenv.mkDerivation rec {
   ] ++ lib.optionals enableWayland [
     wayland
     wayland-protocols
-  ] ++ lib.optionals withIntrospection [
-    gobject-introspection
   ] ++ lib.optional enableCocoa Cocoa
     ++ lib.optional enableCdparanoia cdparanoia;
 
@@ -106,7 +106,6 @@ stdenv.mkDerivation rec {
     "-Dgl-graphene=disabled" # not packaged in nixpkgs as of writing
     # See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices
     "-Dgl_winsys=${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}"
-    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
   ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
     "-Dtests=disabled"
   ]
diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix
index c5f836f26a4..662c3281b03 100644
--- a/pkgs/development/libraries/gstreamer/core/default.nix
+++ b/pkgs/development/libraries/gstreamer/core/default.nix
@@ -16,7 +16,6 @@
 , bash-completion
 , lib
 , CoreServices
-, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
 , gobject-introspection
 }:
 
@@ -38,6 +37,10 @@ stdenv.mkDerivation rec {
     sha256 = "0cghi6n4nhdbajz3wqcgbh5xm94myvnqgsi9g2bz9n1s9904l2fy";
   };
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   strictDeps = true;
   nativeBuildInputs = [
     meson
@@ -50,23 +53,21 @@ stdenv.mkDerivation rec {
     makeWrapper
     glib
     bash-completion
+    gobject-introspection
 
     # documentation
     # TODO add hotdoc here
   ] ++ lib.optionals stdenv.isLinux [
     libcap # for setcap binary
-  ] ++ lib.optionals withIntrospection [
-    gobject-introspection
   ];
 
   buildInputs = [
     bash-completion
+    gobject-introspection
   ] ++ lib.optionals stdenv.isLinux [
     libcap
     libunwind
     elfutils
-  ] ++ lib.optionals withIntrospection [
-    gobject-introspection
   ] ++ lib.optionals stdenv.isDarwin [
     CoreServices
   ];
@@ -79,7 +80,6 @@ stdenv.mkDerivation rec {
     "-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
     "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
-    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
   ] ++ lib.optionals stdenv.isDarwin [
     # darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it.
     "-Dlibunwind=disabled"
diff --git a/pkgs/development/libraries/gstreamer/devtools/default.nix b/pkgs/development/libraries/gstreamer/devtools/default.nix
index 31c25648cc7..acb12b78341 100644
--- a/pkgs/development/libraries/gstreamer/devtools/default.nix
+++ b/pkgs/development/libraries/gstreamer/devtools/default.nix
@@ -26,6 +26,10 @@ stdenv.mkDerivation rec {
     # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
   ];
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -40,6 +44,7 @@ stdenv.mkDerivation rec {
     cairo
     python3
     json-glib
+    gobject-introspection
   ];
 
   propagatedBuildInputs = [
@@ -49,8 +54,6 @@ stdenv.mkDerivation rec {
 
   mesonFlags = [
     "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-    "-Dintrospection=disabled"
   ];
 
   meta = with lib; {
diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix
index 50acba29d67..9d6f3c0f483 100644
--- a/pkgs/development/libraries/gstreamer/ges/default.nix
+++ b/pkgs/development/libraries/gstreamer/ges/default.nix
@@ -46,6 +46,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     bash-completion
     libxml2
+    gobject-introspection
   ];
 
   propagatedBuildInputs = [
@@ -55,8 +56,6 @@ stdenv.mkDerivation rec {
 
   mesonFlags = [
     "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-    "-Dintrospection=disabled"
   ];
 
   postPatch = ''
diff --git a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
index 679560e8ee1..8fe79bb7b8b 100644
--- a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
+++ b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
@@ -41,13 +41,12 @@ stdenv.mkDerivation rec {
   buildInputs = [
     gst-plugins-base
     gst-plugins-bad
+    gobject-introspection
   ];
 
   mesonFlags = [
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
     "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-    "-Dintrospection=disabled"
   ];
 
   postPatch = ''
diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix
index f3f3f0c108a..c06aa946993 100644
--- a/pkgs/development/libraries/gtk/3.x.nix
+++ b/pkgs/development/libraries/gtk/3.x.nix
@@ -110,6 +110,7 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
+    gobject-introspection
     libxkbcommon
     (libepoxy.override { inherit x11Support; })
     isocodes
@@ -158,7 +159,6 @@ stdenv.mkDerivation rec {
     "-Dbroadway_backend=${lib.boolToString broadwaySupport}"
     "-Dx11_backend=${lib.boolToString x11Support}"
     "-Dquartz_backend=${lib.boolToString (stdenv.isDarwin && !x11Support)}"
-    "-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
   ];
 
   doCheck = false; # needs X11
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index b7ba05bb79b..20323796e9d 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -34,7 +34,6 @@ let
   inherit (lib) optional optionals optionalString;
   mesonFeatureFlag = opt: b:
     "-D${opt}=${if b then "enabled" else "disabled"}";
-  isNativeCompilation = stdenv.buildPlatform == stdenv.hostPlatform;
 in
 
 stdenv.mkDerivation {
@@ -70,7 +69,10 @@ stdenv.mkDerivation {
     (mesonFeatureFlag "coretext" withCoreText)
     (mesonFeatureFlag "graphite" withGraphite2)
     (mesonFeatureFlag "icu" withIcu)
-    (mesonFeatureFlag "introspection" isNativeCompilation)
+  ];
+
+  depsBuildBuild = [
+    pkg-config
   ];
 
   nativeBuildInputs = [
@@ -85,9 +87,8 @@ stdenv.mkDerivation {
     docbook_xml_dtd_43
   ];
 
-  buildInputs = [ glib freetype ]
-    ++ lib.optionals withCoreText [ ApplicationServices CoreText ]
-    ++ lib.optionals isNativeCompilation [ gobject-introspection ];
+  buildInputs = [ glib freetype gobject-introspection ]
+    ++ lib.optionals withCoreText [ ApplicationServices CoreText ];
 
   propagatedBuildInputs = optional withGraphite2 graphite2
     ++ optionals withIcu [ icu harfbuzz ];
diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix
index e041908f3f4..1f8f4fd1acc 100644
--- a/pkgs/development/libraries/json-glib/default.nix
+++ b/pkgs/development/libraries/json-glib/default.nix
@@ -6,10 +6,10 @@
 , ninja
 , pkg-config
 , gettext
-, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
 , gobject-introspection
-, fixDarwinDylibNames
 , gi-docgen
+, libxslt
+, fixDarwinDylibNames
 , gnome
 }:
 
@@ -17,8 +17,7 @@ stdenv.mkDerivation rec {
   pname = "json-glib";
   version = "1.6.6";
 
-  outputs = [ "out" "dev" ]
-    ++ lib.optional withIntrospection "devdoc";
+  outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
@@ -37,22 +36,28 @@ stdenv.mkDerivation rec {
     pkg-config
     gettext
     glib
-  ] ++ lib.optional stdenv.hostPlatform.isDarwin [
-    fixDarwinDylibNames
-  ] ++ lib.optionals withIntrospection [
+    libxslt
     gobject-introspection
     gi-docgen
+  ] ++ lib.optional stdenv.hostPlatform.isDarwin [
+    fixDarwinDylibNames
   ];
 
+  buildInputs = [ gobject-introspection ];
+
   propagatedBuildInputs = [
     glib
   ];
 
-  mesonFlags = lib.optionals (!withIntrospection) [
-    "-Dintrospection=disabled"
-    # gi-docgen relies on introspection data
-    "-Dgtk_doc=disabled"
-  ];
+
+  # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
+  # it should be a build-time dep for build
+  # TODO: send upstream
+  postPatch = ''
+    substituteInPlace doc/meson.build \
+      --replace "'gi-docgen', ver" "'gi-docgen', native:true, ver" \
+      --replace "'gi-docgen', req" "'gi-docgen', native:true, req"
+  '';
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/libgudev/default.nix b/pkgs/development/libraries/libgudev/default.nix
index 6a63947c8a5..799e1d0f845 100644
--- a/pkgs/development/libraries/libgudev/default.nix
+++ b/pkgs/development/libraries/libgudev/default.nix
@@ -7,8 +7,8 @@
 , glib
 , gnome
 , vala
-, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
 , gobject-introspection
+, fetchpatch
 }:
 
 stdenv.mkDerivation rec {
@@ -22,6 +22,25 @@ stdenv.mkDerivation rec {
     sha256 = "1al6nr492nzbm8ql02xhzwci2kwb1advnkaky3j9636jf08v41hd";
   };
 
+  patches = [
+    # https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/27
+    (fetchpatch {
+      name = "gir-dep";
+      url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/6bdde16a0cfde462502fce1d9a7eb6ec33f388bb.diff";
+      sha256 = "sha256-bDtLUxOLEgyJURshqEQC4YCBTUVzQQP4qoWL786b3Z8=";
+    })
+    (fetchpatch {
+      name = "vapi-dep";
+      url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/d1f6457910842ba869c9871e7a2131fbe0d6b6be.diff";
+      sha256 = "sha256-/PY8ziZST/vQvksJm69a3O6/YesknIxCDvj0z40piik=";
+    })
+    (fetchpatch {
+      name = "gtk-doc-dep";
+      url = "https://gitlab.gnome.org/GNOME/libgudev/-/commit/34336cbadbcaac8b9b029f730eed0bdf4c633617.diff";
+      sha256 = "sha256-Bk05xe69LGqWH1uhLMZhwbVMSsCTyBrrOvqWic2TTd4=";
+    })
+  ];
+
   strictDeps = true;
 
   depsBuildBuild = [ pkg-config ];
@@ -32,11 +51,11 @@ stdenv.mkDerivation rec {
     ninja
     vala
     glib # for glib-mkenums needed during the build
-  ] ++ lib.optionals withIntrospection [
     gobject-introspection
   ];
 
   buildInputs = [
+    gobject-introspection
     udev
     glib
   ];
@@ -44,9 +63,6 @@ stdenv.mkDerivation rec {
   mesonFlags = [
     # There's a dependency cycle with umockdev and the tests fail to LD_PRELOAD anyway
     "-Dtests=disabled"
-    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-    "-Dvapi=disabled"
   ];
 
   passthru = {
diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix
index 48e611a3482..3656d2991a8 100644
--- a/pkgs/development/libraries/libical/default.nix
+++ b/pkgs/development/libraries/libical/default.nix
@@ -13,7 +13,6 @@
 , python3
 , tzdata
 , fixDarwinDylibNames
-, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
 , gobject-introspection
 , vala
 }:
@@ -37,6 +36,8 @@ stdenv.mkDerivation rec {
     ninja
     perl
     pkg-config
+    gobject-introspection
+    vala
     # Docs building fails:
     # https://github.com/NixOS/nixpkgs/pull/67204
     # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489
@@ -44,15 +45,12 @@ stdenv.mkDerivation rec {
   ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     # provides ical-glib-src-generator that runs during build
     libical
-  ] ++ lib.optionals withIntrospection [
-    gobject-introspection
-    vala
   ] ++ lib.optionals stdenv.isDarwin [
     fixDarwinDylibNames
   ];
   installCheckInputs = [
     # running libical-glib tests
-    (python3.withPackages (pkgs: with pkgs; [
+    (python3.pythonForBuild.withPackages (pkgs: with pkgs; [
       pygobject3
     ]))
   ];
@@ -61,14 +59,11 @@ stdenv.mkDerivation rec {
     glib
     libxml2
     icu
-  ] ++ lib.optionals withIntrospection [
     gobject-introspection
   ];
 
   cmakeFlags = [
     "-DENABLE_GTK_DOC=False"
-    "-DGOBJECT_INTROSPECTION=${if withIntrospection then "True" else "False"}"
-    "-DICAL_GLIB_VAPI=${if withIntrospection then "True" else "False"}"
   ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev buildPackages.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake"
   ];
diff --git a/pkgs/development/libraries/libmanette/default.nix b/pkgs/development/libraries/libmanette/default.nix
index 645b521b817..2320aa78bba 100644
--- a/pkgs/development/libraries/libmanette/default.nix
+++ b/pkgs/development/libraries/libmanette/default.nix
@@ -2,6 +2,7 @@
 , fetchurl
 , ninja
 , meson
+, mesonEmulatorHook
 , pkg-config
 , vala
 , gobject-introspection
@@ -34,9 +35,12 @@ stdenv.mkDerivation rec {
     gtk-doc
     docbook-xsl-nons
     docbook_xml_dtd_43
+  ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
+    mesonEmulatorHook
   ];
 
   buildInputs = [
+    gobject-introspection
     glib
     libgudev
     libevdev
diff --git a/pkgs/development/libraries/librdf/raptor2.nix b/pkgs/development/libraries/librdf/raptor2.nix
index 65655814685..e290aa2b743 100644
--- a/pkgs/development/libraries/librdf/raptor2.nix
+++ b/pkgs/development/libraries/librdf/raptor2.nix
@@ -1,26 +1,28 @@
-{ lib, stdenv, fetchurl, libxml2, libxslt }:
+{ lib, stdenv, libxml2, libxslt, pkg-config, cmake, fetchFromGitHub, perl, bison, flex, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "raptor2";
-  version = "2.0.15";
+  version = "unstable-2022-06-06";
 
-  src = fetchurl {
-    url = "http://download.librdf.org/source/${pname}-${version}.tar.gz";
-    sha256 = "ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed";
+  src = fetchFromGitHub {
+    owner = "dajobe";
+    repo = "raptor";
+    rev = "3cca62a33da68143b687c9e486eefc7c7cbb4586";
+    sha256 = "sha256-h03IyFH1GHPqajfHBBTb19lCEu+VXzQLGC1wiEGVvgY=";
   };
 
   patches = [
-    (fetchurl {
-      name = "CVE-2017-18926.patch";
-      url = "https://github.com/dajobe/raptor/commit/590681e546cd9aa18d57dc2ea1858cb734a3863f.patch";
-      sha256 = "1qlpb5rm3j2yi0x6zgdi5apymg5zlvwq3g1zl417gkjrlvxmndgp";
+    # https://github.com/dajobe/raptor/pull/52
+    (fetchpatch {
+      name = "fix-cmake-generated-pc-file";
+      url = "https://github.com/dajobe/raptor/commit/fa1ef9a27d8762f5588ac2e92554a188e73dee9f.diff";
+      sha256 = "sha256-zXIbrYGgC9oTpiD0WUikT4vRdc9b6bsyfnDkwUSlqao=";
     })
   ];
 
+  nativeBuildInputs = [ pkg-config cmake perl bison flex ];
   buildInputs = [ libxml2 libxslt ];
 
-  postInstall = "rm -rvf $out/share/gtk-doc";
-
   meta = {
     description = "The RDF Parser Toolkit";
     homepage = "https://librdf.org/raptor";
diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix
index b04012cec28..24a34a92f3c 100644
--- a/pkgs/development/libraries/libsecret/default.nix
+++ b/pkgs/development/libraries/libsecret/default.nix
@@ -31,6 +31,10 @@ stdenv.mkDerivation rec {
     sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00=";
   };
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -48,6 +52,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     libgcrypt
+    gobject-introspection
   ];
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 83fb0c4a029..9976f4109f0 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -8,16 +8,13 @@
 , pkg-config
 , gnome
 , libsysprof-capture
-, gnomeSupport ? true
-, sqlite
-, glib-networking
 , gobject-introspection
-, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
 , vala
-, withVala ? stdenv.buildPlatform == stdenv.hostPlatform
 , libpsl
-, python3
 , brotli
+, gnomeSupport ? true
+, sqlite
+, glib-networking
 }:
 
 stdenv.mkDerivation rec {
@@ -31,19 +28,21 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-8KQnZW5f4Z4d9xwQfojfobLmc8JcVHt4I7YBi0DQEVk=";
   };
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
     pkg-config
     glib
-  ] ++ lib.optionals withIntrospection [
     gobject-introspection
-  ] ++ lib.optionals withVala [
     vala
   ];
 
   buildInputs = [
-    python3
+    gobject-introspection
     sqlite
     libpsl
     glib.out
@@ -60,8 +59,6 @@ stdenv.mkDerivation rec {
   mesonFlags = [
     "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency
     "-Dgssapi=disabled"
-    "-Dvapi=${if withVala then "enabled" else "disabled"}"
-    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
     "-Dgnome=${lib.boolToString gnomeSupport}"
     "-Dntlm=disabled"
   ] ++ lib.optionals (!stdenv.isLinux) [
@@ -73,6 +70,12 @@ stdenv.mkDerivation rec {
   doCheck = false; # ERROR:../tests/socket-test.c:37:do_unconnected_socket_test: assertion failed (res == SOUP_STATUS_OK): (2 == 200)
 
   postPatch = ''
+    # fixes finding vapigen when cross-compiling
+    # the commit is in 3.0.6
+    # https://gitlab.gnome.org/GNOME/libsoup/-/commit/5280e936d0a76f94dbc5d8489cfbdc0a06343f65
+    substituteInPlace meson.build \
+      --replace "required: vapi_opt)" "required: vapi_opt, native: false)"
+
     patchShebangs libsoup/
   '';
 
diff --git a/pkgs/development/libraries/neon/default.nix b/pkgs/development/libraries/neon/default.nix
index 1521c1a6389..5250dcddf84 100644
--- a/pkgs/development/libraries/neon/default.nix
+++ b/pkgs/development/libraries/neon/default.nix
@@ -35,6 +35,10 @@ stdenv.mkDerivation rec {
     (lib.withFeature sslSupport "ssl")
   ];
 
+  preConfigure = ''
+    export PKG_CONFIG="$(command -v "$PKG_CONFIG")"
+  '';
+
   passthru = {inherit compressionSupport sslSupport;};
 
   meta = with lib; {
diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix
index c84740ebcdc..edc8acaa92b 100644
--- a/pkgs/development/libraries/opencv/4.x.nix
+++ b/pkgs/development/libraries/opencv/4.x.nix
@@ -13,6 +13,7 @@
 , protobuf
 , config
 , ocl-icd
+, buildPackages
 
 , enableJPEG ? true
 , libjpeg
@@ -291,11 +292,15 @@ stdenv.mkDerivation {
     "-DOPENCV_GENERATE_PKGCONFIG=ON"
     "-DWITH_OPENMP=ON"
     "-DBUILD_PROTOBUF=OFF"
+    "-DProtobuf_PROTOC_EXECUTABLE=${lib.getExe buildPackages.protobuf}"
     "-DPROTOBUF_UPDATE_FILES=ON"
     "-DOPENCV_ENABLE_NONFREE=${printEnabled enableUnfree}"
     "-DBUILD_TESTS=OFF"
     "-DBUILD_PERF_TESTS=OFF"
     "-DBUILD_DOCS=${printEnabled enableDocs}"
+    # "OpenCV disables pkg-config to avoid using of host libraries. Consider using PKG_CONFIG_LIBDIR to specify target SYSROOT"
+    # but we have proper separation of build and host libs :), fixes cross
+    "-DOPENCV_ENABLE_PKG_CONFIG=ON"
     (opencvFlag "IPP" enableIpp)
     (opencvFlag "TIFF" enableTIFF)
     (opencvFlag "WEBP" enableWebP)
diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix
index 13dd24b5482..4f5f84702f9 100644
--- a/pkgs/development/libraries/pango/default.nix
+++ b/pkgs/development/libraries/pango/default.nix
@@ -16,26 +16,21 @@
 , ninja
 , glib
 , python3
-, x11Support? !stdenv.isDarwin, libXft
-, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
 , gobject-introspection
-, withDocs ? (stdenv.buildPlatform == stdenv.hostPlatform)
+, x11Support? !stdenv.isDarwin, libXft
 }:
 
 stdenv.mkDerivation rec {
   pname = "pango";
   version = "1.50.7";
 
-  outputs = [ "bin" "out" "dev" ]
-    ++ lib.optionals withDocs [ "devdoc" ];
+  outputs = [ "bin" "out" "dev" "devdoc" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "BHfzaaPUxpXfcpmmmJ3ABHVqf03ifuysQFxnkLfjrTM=";
   };
 
-  strictDeps = !withIntrospection;
-
   depsBuildBuild = [
     pkg-config
   ];
@@ -44,9 +39,7 @@ stdenv.mkDerivation rec {
     meson ninja
     glib # for glib-mkenum
     pkg-config
-  ] ++ lib.optionals withIntrospection [
     gobject-introspection
-  ] ++ lib.optionals withDocs [
     gi-docgen
     python3
   ];
@@ -54,6 +47,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     fribidi
     libthai
+    gobject-introspection
   ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
     ApplicationServices
     Carbon
@@ -71,8 +65,7 @@ stdenv.mkDerivation rec {
   ];
 
   mesonFlags = [
-    "-Dgtk_doc=${lib.boolToString withDocs}"
-    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
+    "-Dgtk_doc=true"
   ] ++ lib.optionals (!x11Support) [
     "-Dxft=disabled" # only works with x11
   ];
@@ -82,9 +75,20 @@ stdenv.mkDerivation rec {
     fontDirectories = [ freefont_ttf ];
   };
 
+  # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
+  # it should be a build-time dep for build
+  # TODO: send upstream
+  postPatch = ''
+    substituteInPlace meson.build \
+      --replace "dependency('gi-docgen', ver" "dependency('gi-docgen', native:true, ver"
+
+    substituteInPlace docs/meson.build \
+      --replace "'gi-docgen', req" "'gi-docgen', native:true, req"
+  '';
+
   doCheck = false; # test-font: FAIL
 
-  postFixup = lib.optionalString withDocs ''
+  postFixup = ''
     # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
     moveToOutput "share/doc" "$devdoc"
   '';
diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index 9c49f89c2ca..ff025fb5210 100644
--- a/pkgs/development/libraries/polkit/default.nix
+++ b/pkgs/development/libraries/polkit/default.nix
@@ -6,6 +6,7 @@
 , expat
 , pam
 , meson
+, mesonEmulatorHook
 , ninja
 , perl
 , rsync
@@ -23,10 +24,6 @@
 , useSystemd ? stdenv.isLinux
 , systemd
 , elogind
-# needed until gobject-introspection does cross-compile (https://github.com/NixOS/nixpkgs/pull/88222)
-, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
-# cross build fails on polkit-1-scan (https://github.com/NixOS/nixpkgs/pull/152704)
-, withGtkDoc ? (stdenv.buildPlatform == stdenv.hostPlatform)
 # A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault).
 # Not yet investigated; it may be due to the "Make netgroup support optional"
 # patch not updating the tests correctly yet, or doing something wrong,
@@ -88,6 +85,10 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     glib
     gtk-doc
@@ -97,7 +98,8 @@ stdenv.mkDerivation rec {
     ninja
     perl
     rsync
-    (python3.withPackages (pp: with pp; [
+    gobject-introspection
+    (python3.pythonForBuild.withPackages (pp: with pp; [
       dbus-python
       (python-dbusmock.overridePythonAttrs (attrs: {
         # Avoid dependency cycle.
@@ -109,17 +111,19 @@ stdenv.mkDerivation rec {
     libxslt
     docbook-xsl-nons
     docbook_xml_dtd_412
+  ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
+    mesonEmulatorHook
   ];
 
   buildInputs = [
+    gobject-introspection
     expat
     pam
     spidermonkey_78
+    dbus
   ] ++ lib.optionals stdenv.isLinux [
     # On Linux, fall back to elogind when systemd support is off.
     (if useSystemd then systemd else elogind)
-  ] ++ lib.optionals withIntrospection [
-    gobject-introspection
   ];
 
   propagatedBuildInputs = [
@@ -136,9 +140,7 @@ stdenv.mkDerivation rec {
     "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
     "-Dpolkitd_user=polkituser" #TODO? <nixos> config.ids.uids.polkituser
     "-Dos_type=redhat" # only affects PAM includes
-    "-Dintrospection=${lib.boolToString withIntrospection}"
     "-Dtests=${lib.boolToString doCheck}"
-    "-Dgtk_doc=${lib.boolToString withGtkDoc}"
     "-Dman=true"
   ] ++ lib.optionals stdenv.isLinux [
     "-Dsession_tracking=${if useSystemd then "libsystemd-login" else "libelogind"}"
diff --git a/pkgs/development/libraries/tracker/default.nix b/pkgs/development/libraries/tracker/default.nix
index 835f38ff509..a643fd6e415 100644
--- a/pkgs/development/libraries/tracker/default.nix
+++ b/pkgs/development/libraries/tracker/default.nix
@@ -25,6 +25,7 @@
 , json-glib
 , systemd
 , dbus
+, writeText
 }:
 
 stdenv.mkDerivation rec {
@@ -46,6 +47,10 @@ stdenv.mkDerivation rec {
     patchShebangs utils/data-generators/cc/generate
   '';
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -58,13 +63,11 @@ stdenv.mkDerivation rec {
     gobject-introspection
     docbook-xsl-nons
     docbook_xml_dtd_45
-    python3 # for data-generators
-    systemd # used for checks to install systemd user service
-    dbus # used for checks and pkg-config to install dbus service/s
-  ] ++ checkInputs; # gi is in the main meson.build and checked regardless of
-                    # whether tests are enabled
+    (python3.pythonForBuild.withPackages (p: [ p.pygobject3 ]))
+  ];
 
   buildInputs = [
+    gobject-introspection
     glib
     libxml2
     sqlite
@@ -74,15 +77,24 @@ stdenv.mkDerivation rec {
     libuuid
     json-glib
     libstemmer
-  ];
-
-  checkInputs = with python3.pkgs; [
-    pygobject3
+    dbus
+    systemd
   ];
 
   mesonFlags = [
     "-Ddocs=true"
-  ];
+  ] ++ (
+    let
+      # https://gitlab.gnome.org/GNOME/tracker/-/blob/master/meson.build#L159
+      crossFile = writeText "cross-file.conf" ''
+        [properties]
+        sqlite3_has_fts5 = '${lib.boolToString (lib.hasInfix "-DSQLITE_ENABLE_FTS3" sqlite.NIX_CFLAGS_COMPILE)}'
+      '';
+    in
+    [
+      "--cross-file=${crossFile}"
+    ]
+  );
 
   doCheck = true;
 
diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix
index 447d49a9442..199435c935c 100644
--- a/pkgs/development/python-modules/pygobject/3.nix
+++ b/pkgs/development/python-modules/pygobject/3.nix
@@ -12,6 +12,7 @@
 , ninja
 , isPy3k
 , gnome
+, python
 }:
 
 buildPythonPackage rec {
@@ -29,6 +30,10 @@ buildPythonPackage rec {
     sha256 = "HzS192JN415E61p+tCg1MoW9AwBNVRMaX39/qbkPPMk=";
   };
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     pkg-config
     meson
@@ -37,8 +42,9 @@ buildPythonPackage rec {
   ];
 
   buildInputs = [
-    glib
+    # # .so files link to these
     gobject-introspection
+    glib
   ] ++ lib.optionals stdenv.isDarwin [
     ncurses
   ];
@@ -48,6 +54,13 @@ buildPythonPackage rec {
     cairo
   ];
 
+  mesonFlags = [
+    # This is only used for figuring out what version of Python is in
+    # use, and related stuff like figuring out what the install prefix
+    # should be, but it does need to be able to execute Python code.
+    "-Dpython=${python.pythonForBuild.interpreter}"
+  ];
+
   passthru = {
     updateScript = gnome.updateScript {
       packageName = pname;