json-glib: re-disable introspection if no emulator

e.g. when cross compiling from Linux to FreeBSD.

Fixes: 1bd8727a4c ("various: enable gobject-introspection when cross-compiling")
This commit is contained in:
Alyssa Ross 2023-02-06 18:05:04 +00:00
parent 430a9ba130
commit ffb1b62b5f
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

@ -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)