From 69b87ae0ec53ab876263ce5bae4bc7fd9bf3aa4c Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 26 Jan 2023 12:20:11 +0000 Subject: [PATCH 01/12] libsoup_3: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. --- pkgs/development/libraries/libsoup/3.x.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libsoup/3.x.nix b/pkgs/development/libraries/libsoup/3.x.nix index 62abb162b00..2ea9978ed48 100644 --- a/pkgs/development/libraries/libsoup/3.x.nix +++ b/pkgs/development/libraries/libsoup/3.x.nix @@ -9,7 +9,9 @@ , libsysprof-capture , sqlite , glib-networking +, buildPackages , gobject-introspection +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages , vala , libpsl , python3 @@ -22,7 +24,7 @@ stdenv.mkDerivation rec { pname = "libsoup"; version = "3.2.2"; - outputs = [ "out" "dev" "devdoc" ]; + outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -39,6 +41,7 @@ stdenv.mkDerivation rec { pkg-config glib python3 + ] ++ lib.optionals withIntrospection [ gi-docgen gobject-introspection vala @@ -61,15 +64,16 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency "-Dgssapi=disabled" - "-Dvapi=enabled" - "-Dintrospection=enabled" "-Dntlm=disabled" # Requires wstest from autobahn-testsuite. "-Dautobahn=disabled" # Requires gnutls, not added for closure size. "-Dpkcs11_tests=disabled" - ] ++ lib.optionals (!stdenv.isLinux) [ - "-Dsysprof=disabled" + + (lib.mesonEnable "docs" withIntrospection) + (lib.mesonEnable "introspection" withIntrospection) + (lib.mesonEnable "sysprof" stdenv.isLinux) + (lib.mesonEnable "vapi" withIntrospection) ]; # TODO: For some reason the pkg-config setup hook does not pick this up. From 7c643c33121fd54162f7e81c148b776e903c05d2 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 6 Feb 2023 14:53:40 +0000 Subject: [PATCH 02/12] gsettings-desktop-schemas: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. Fixes: 24723644acd ("gsettings-desktop-schemas: build gir when cross") --- .../libraries/gsettings-desktop-schemas/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/gsettings-desktop-schemas/default.nix b/pkgs/development/libraries/gsettings-desktop-schemas/default.nix index 7431ca1f82a..c21b3a3e535 100644 --- a/pkgs/development/libraries/gsettings-desktop-schemas/default.nix +++ b/pkgs/development/libraries/gsettings-desktop-schemas/default.nix @@ -3,6 +3,8 @@ , pkg-config , glib , gobject-introspection +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages , meson , ninja , python3 @@ -27,9 +29,14 @@ stdenv.mkDerivation rec { ninja pkg-config python3 + ] ++ lib.optionals withIntrospection [ gobject-introspection ]; + mesonFlags = [ + (lib.mesonBool "introspection" withIntrospection) + ]; + postPatch = '' chmod +x build-aux/meson/post-install.py patchShebangs build-aux/meson/post-install.py From 8ea1ca271b3df191f8e0eef50ba03561fbca1f0d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 6 Feb 2023 15:28:47 +0000 Subject: [PATCH 03/12] at-spi2-core: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. Fixes: e31262c3eef ("at-spi2-core: make introspection unconditional") --- pkgs/development/libraries/at-spi2-core/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix index 3a2f446cf84..f34262b03f2 100644 --- a/pkgs/development/libraries/at-spi2-core/default.nix +++ b/pkgs/development/libraries/at-spi2-core/default.nix @@ -5,6 +5,8 @@ , ninja , pkg-config , gobject-introspection +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages , gsettings-desktop-schemas , makeWrapper , dbus @@ -30,11 +32,13 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ + glib meson ninja pkg-config - gobject-introspection makeWrapper + ] ++ lib.optionals withIntrospection [ + gobject-introspection ]; buildInputs = [ @@ -58,7 +62,6 @@ stdenv.mkDerivation rec { doCheck = false; mesonFlags = [ - "-Dintrospection=yes" # Provide dbus-daemon fallback when it is not already running when # at-spi2-bus-launcher is executed. This allows us to avoid # including the entire dbus closure in libraries linked with From 430a9ba1307f99ff364011915abe5d144e18b60f Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 6 Feb 2023 15:45:12 +0000 Subject: [PATCH 04/12] gdk-pixbuf: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. Fixes: 1bd8727a4ca ("various: enable gobject-introspection when cross-compiling") --- .../libraries/gdk-pixbuf/default.nix | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index ca0e8f81c4d..bece2287c05 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -14,19 +14,21 @@ , libjpeg , libpng , gnome -, gobject-introspection -, buildPackages , doCheck ? false , makeWrapper , lib , testers +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages +, gobject-introspection }: stdenv.mkDerivation (finalAttrs: { pname = "gdk-pixbuf"; version = "2.42.10"; - outputs = [ "out" "dev" "man" "devdoc" ] + outputs = [ "out" "dev" "man" ] + ++ lib.optional withIntrospection "devdoc" ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests"; src = let @@ -56,13 +58,14 @@ stdenv.mkDerivation (finalAttrs: { python3 makeWrapper glib - gi-docgen - gobject-introspection # for man pages docutils ] ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames + ] ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection ]; propagatedBuildInputs = [ @@ -74,7 +77,8 @@ stdenv.mkDerivation (finalAttrs: { mesonFlags = [ "-Dgio_sniffing=false" - "-Dgtk_doc=true" + (lib.mesonBool "gtk_doc" withIntrospection) + (lib.mesonEnable "introspection" withIntrospection) ]; postPatch = '' @@ -104,7 +108,7 @@ stdenv.mkDerivation (finalAttrs: { 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 withIntrospection '' # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/ ${stdenv.hostPlatform.emulator buildPackages} $dev/bin/gdk-pixbuf-query-loaders --update-cache ''; @@ -116,7 +120,7 @@ stdenv.mkDerivation (finalAttrs: { done ''; - postFixup = '' + postFixup = lib.optionalString withIntrospection '' # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. moveToOutput "share/doc" "$devdoc" ''; From ffb1b62b5f338a27232bac210c9dc22831f6d151 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 6 Feb 2023 18:05:04 +0000 Subject: [PATCH 05/12] json-glib: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. Fixes: 1bd8727a4ca ("various: enable gobject-introspection when cross-compiling") --- pkgs/development/libraries/json-glib/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix index efac3690851..4b54ccc0664 100644 --- a/pkgs/development/libraries/json-glib/default.nix +++ b/pkgs/development/libraries/json-glib/default.nix @@ -7,6 +7,8 @@ , nixosTests , pkg-config , gettext +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages +, buildPackages , gobject-introspection , gi-docgen , libxslt @@ -18,7 +20,8 @@ stdenv.mkDerivation rec { pname = "json-glib"; version = "1.6.6"; - outputs = [ "out" "dev" "devdoc" "installedTests" ]; + outputs = [ "out" "dev" "installedTests" ] + ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -43,10 +46,11 @@ stdenv.mkDerivation rec { gettext glib libxslt - gobject-introspection - gi-docgen ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames + ] ++ lib.optionals withIntrospection [ + gobject-introspection + gi-docgen ]; propagatedBuildInputs = [ @@ -55,6 +59,8 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dinstalled_test_prefix=${placeholder "installedTests"}" + (lib.mesonEnable "introspection" withIntrospection) + (lib.mesonEnable "gtk_doc" withIntrospection) ]; # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) From e1bd8afb0794c0af1b35bcd623e0d9e88cf845b4 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 6 Feb 2023 20:33:43 +0000 Subject: [PATCH 06/12] libsoup: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. Fixes: 1bd8727a4ca ("various: enable gobject-introspection when cross-compiling") --- pkgs/development/libraries/libsoup/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix index 05bf4b15523..df9ce5c5b6e 100644 --- a/pkgs/development/libraries/libsoup/default.nix +++ b/pkgs/development/libraries/libsoup/default.nix @@ -15,6 +15,8 @@ , gnomeSupport ? true , sqlite , glib-networking +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages }: stdenv.mkDerivation rec { @@ -37,6 +39,7 @@ stdenv.mkDerivation rec { ninja pkg-config glib + ] ++ lib.optionals withIntrospection [ gobject-introspection vala ]; @@ -58,6 +61,8 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency "-Dgssapi=disabled" + "-Dvapi=${if withIntrospection then "enabled" else "disabled"}" + "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" "-Dgnome=${lib.boolToString gnomeSupport}" "-Dntlm=disabled" ] ++ lib.optionals (!stdenv.isLinux) [ From 5ecef164cb5c0edd7368f816812ca8d3f889e60b Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 1 Mar 2023 16:02:57 +0000 Subject: [PATCH 07/12] libsecret: disable introspection if no emulator --- pkgs/development/libraries/libsecret/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix index 4a2ad99af4d..607f038b884 100644 --- a/pkgs/development/libraries/libsecret/default.nix +++ b/pkgs/development/libraries/libsecret/default.nix @@ -12,6 +12,8 @@ , docbook_xml_dtd_42 , libgcrypt , gobject-introspection +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages , vala , gi-docgen , gnome @@ -24,7 +26,7 @@ stdenv.mkDerivation rec { pname = "libsecret"; version = "0.20.5"; - outputs = [ "out" "dev" "devdoc" ]; + outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -44,10 +46,11 @@ stdenv.mkDerivation rec { docbook-xsl-nons docbook_xml_dtd_42 libintl - gobject-introspection vala - gi-docgen glib + ] ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection ]; buildInputs = [ @@ -66,7 +69,12 @@ stdenv.mkDerivation rec { gjs ]; - doCheck = stdenv.isLinux; + mesonFlags = [ + (lib.mesonBool "introspection" withIntrospection) + (lib.mesonBool "gtk_doc" withIntrospection) + ]; + + doCheck = stdenv.isLinux && withIntrospection; postPatch = '' patchShebangs ./tool/test-*.sh From 9144866bb79628ffd0a92875474429664d70250f Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 1 Mar 2023 16:08:08 +0000 Subject: [PATCH 08/12] libical: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. We have to get the build libical from pkgsBuildBuild, to avoid picking up a propagated gobject-introspection host dependency. Fixes: 1bd8727a4ca ("various: enable gobject-introspection when cross-compiling") --- .../development/libraries/libical/default.nix | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix index f85181d376a..2cb8642ca87 100644 --- a/pkgs/development/libraries/libical/default.nix +++ b/pkgs/development/libraries/libical/default.nix @@ -1,7 +1,8 @@ { lib , stdenv , fetchFromGitHub -, buildPackages +, pkgsBuildBuild +, pkgsBuildHost , cmake , glib , icu @@ -13,6 +14,7 @@ , python3 , tzdata , fixDarwinDylibNames +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable pkgsBuildHost , gobject-introspection , vala }: @@ -31,20 +33,24 @@ stdenv.mkDerivation rec { }; strictDeps = true; + + depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # provides ical-glib-src-generator that runs during build + libical + ]; + nativeBuildInputs = [ cmake ninja perl pkg-config + ] ++ lib.optionals withIntrospection [ gobject-introspection vala # Docs building fails: # https://github.com/NixOS/nixpkgs/pull/67204 # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # provides ical-glib-src-generator that runs during build - libical ] ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ]; @@ -63,10 +69,10 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DENABLE_GTK_DOC=False" - "-DGOBJECT_INTROSPECTION=True" - "-DICAL_GLIB_VAPI=True" + "-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" + "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev pkgsBuildBuild.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake" ]; patches = [ From 2654807c757bc23c52863307775000535b8576bf Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 1 Mar 2023 16:18:53 +0000 Subject: [PATCH 09/12] tracker: disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. --- pkgs/development/libraries/tracker/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/tracker/default.nix b/pkgs/development/libraries/tracker/default.nix index 9027c14de90..f66c08684d1 100644 --- a/pkgs/development/libraries/tracker/default.nix +++ b/pkgs/development/libraries/tracker/default.nix @@ -7,6 +7,8 @@ , pkg-config , asciidoc , gobject-introspection +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages , python3 , docbook-xsl-nons , docbook_xml_dtd_45 @@ -52,12 +54,14 @@ stdenv.mkDerivation rec { pkg-config asciidoc gettext + glib libxslt wrapGAppsNoGuiHook - gobject-introspection docbook-xsl-nons docbook_xml_dtd_45 (python3.pythonForBuild.withPackages (p: [ p.pygobject3 ])) + ] ++ lib.optionals withIntrospection [ + gobject-introspection ]; buildInputs = [ @@ -77,6 +81,8 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Ddocs=true" + (lib.mesonEnable "introspection" withIntrospection) + (lib.mesonBool "test_utils" withIntrospection) ] ++ ( let # https://gitlab.gnome.org/GNOME/tracker/-/blob/master/meson.build#L159 From fef0a52db9b674209e22162ff89f7602ba98c148 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 1 Mar 2023 16:45:08 +0000 Subject: [PATCH 10/12] libmanette: disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. --- .../development/libraries/libmanette/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libmanette/default.nix b/pkgs/development/libraries/libmanette/default.nix index 7629dd8a6f1..0bc649780c8 100644 --- a/pkgs/development/libraries/libmanette/default.nix +++ b/pkgs/development/libraries/libmanette/default.nix @@ -6,6 +6,8 @@ , pkg-config , vala , gobject-introspection +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages , gtk-doc , docbook-xsl-nons , docbook_xml_dtd_43 @@ -19,7 +21,7 @@ stdenv.mkDerivation rec { pname = "libmanette"; version = "0.2.6"; - outputs = [ "out" "dev" "devdoc" ]; + outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -30,23 +32,29 @@ stdenv.mkDerivation rec { meson ninja pkg-config + glib + ] ++ lib.optionals withIntrospection [ vala gobject-introspection gtk-doc docbook-xsl-nons docbook_xml_dtd_43 - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + ] ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; buildInputs = [ glib - libgudev libevdev + ] ++ lib.optionals withIntrospection [ + libgudev ]; mesonFlags = [ - "-Ddoc=true" + (lib.mesonBool "doc" withIntrospection) + (lib.mesonEnable "gudev" withIntrospection) + (lib.mesonBool "introspection" withIntrospection) + (lib.mesonBool "vapi" withIntrospection) ]; doCheck = true; From 52a479d024e6eba3ce7bc3178d3b53591d9a92ba Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 1 Mar 2023 17:03:30 +0000 Subject: [PATCH 11/12] polkit: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. Fixes: 1bd8727a4ca ("various: enable gobject-introspection when cross-compiling") --- pkgs/development/libraries/polkit/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix index ec05f890f77..e5a55651712 100644 --- a/pkgs/development/libraries/polkit/default.nix +++ b/pkgs/development/libraries/polkit/default.nix @@ -24,6 +24,8 @@ , useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal , systemdMinimal , elogind +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages # 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, @@ -65,14 +67,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ glib - gtk-doc pkg-config gettext meson ninja perl rsync - gobject-introspection (python3.pythonForBuild.withPackages (pp: with pp; [ dbus-python (python-dbusmock.overridePythonAttrs (attrs: { @@ -85,7 +85,10 @@ stdenv.mkDerivation rec { libxslt docbook-xsl-nons docbook_xml_dtd_412 - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + ] ++ lib.optionals withIntrospection [ + gobject-introspection + gtk-doc + ] ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; @@ -113,7 +116,9 @@ stdenv.mkDerivation rec { "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" "-Dpolkitd_user=polkituser" #TODO? config.ids.uids.polkituser "-Dos_type=redhat" # only affects PAM includes + "-Dintrospection=${lib.boolToString withIntrospection}" "-Dtests=${lib.boolToString doCheck}" + "-Dgtk_doc=${lib.boolToString withIntrospection}" "-Dman=true" ] ++ lib.optionals stdenv.isLinux [ "-Dsession_tracking=${if useSystemd then "libsystemd-login" else "libelogind"}" From 0913507b1360c55a62f48a82b13314db001a1f3e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 1 Mar 2023 17:07:03 +0000 Subject: [PATCH 12/12] gtk3: re-disable introspection if no emulator e.g. when cross compiling from Linux to FreeBSD. --- pkgs/development/libraries/gtk/3.x.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index af81a55fcaa..5a1cc8ca9c5 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -8,6 +8,7 @@ , docbook_xml_dtd_43 , gtk-doc , meson +, mesonEmulatorHook , ninja , python3 , makeWrapper @@ -21,6 +22,8 @@ , atk , at-spi2-atk , gobject-introspection +, buildPackages +, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages , fribidi , xorg , libepoxy @@ -39,7 +42,6 @@ , wayland-protocols , xineramaSupport ? stdenv.isLinux , cupsSupport ? stdenv.isLinux -, withGtkDoc ? stdenv.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform) , cups , AppKit , Cocoa @@ -63,7 +65,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "gtk+3"; version = "3.24.36"; - outputs = [ "out" "dev" ] ++ lib.optional withGtkDoc "devdoc"; + outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc"; outputBin = "dev"; setupHooks = [ @@ -94,7 +96,6 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ gettext - gobject-introspection makeWrapper meson ninja @@ -102,12 +103,15 @@ stdenv.mkDerivation (finalAttrs: { python3 sassc gdk-pixbuf - ] ++ finalAttrs.setupHooks ++ lib.optionals withGtkDoc [ + ] ++ finalAttrs.setupHooks ++ lib.optionals withIntrospection [ + gobject-introspection docbook_xml_dtd_43 docbook-xsl-nons gtk-doc # For xmllint libxml2 + ] ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook ] ++ lib.optionals waylandSupport [ wayland-scanner ]; @@ -157,12 +161,13 @@ stdenv.mkDerivation (finalAttrs: { ]; mesonFlags = [ - "-Dgtk_doc=${lib.boolToString withGtkDoc}" + "-Dgtk_doc=${lib.boolToString withIntrospection}" "-Dtests=false" "-Dtracker3=${lib.boolToString trackerSupport}" "-Dbroadway_backend=${lib.boolToString broadwaySupport}" "-Dx11_backend=${lib.boolToString x11Support}" "-Dquartz_backend=${lib.boolToString (stdenv.isDarwin && !x11Support)}" + "-Dintrospection=${lib.boolToString withIntrospection}" ]; doCheck = false; # needs X11