libmanette: disable introspection if no emulator

e.g. when cross compiling from Linux to FreeBSD.
This commit is contained in:
Alyssa Ross 2023-03-01 16:45:08 +00:00
parent 2654807c75
commit fef0a52db9
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

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