From 6e56cbffebf5e510150c23d2f3ff5eb0361f6d46 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 21 Dec 2023 17:26:11 +0100 Subject: [PATCH] pkgsStatic.graphene: fix build --- .../libraries/graphene/default.nix | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/graphene/default.nix b/pkgs/development/libraries/graphene/default.nix index 2972d5712cba..23b617d4a610 100644 --- a/pkgs/development/libraries/graphene/default.nix +++ b/pkgs/development/libraries/graphene/default.nix @@ -11,10 +11,13 @@ , mutest , nixosTests , glib +, withDocumentation ? !stdenv.hostPlatform.isStatic , gtk-doc , docbook_xsl , docbook_xml_dtd_43 +, buildPackages , gobject-introspection +, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages , makeWrapper }: @@ -22,7 +25,8 @@ stdenv.mkDerivation rec { pname = "graphene"; version = "1.10.8"; - outputs = [ "out" "dev" "devdoc" ] + outputs = [ "out" "dev" ] + ++ lib.optionals withDocumentation [ "devdoc" ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "installedTests" ]; src = fetchFromGitHub { @@ -51,15 +55,17 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ - docbook_xml_dtd_43 - docbook_xsl - gtk-doc meson ninja pkg-config - gobject-introspection python3 makeWrapper + ] ++ lib.optionals withDocumentation [ + docbook_xml_dtd_43 + docbook_xsl + gtk-doc + ] ++ lib.optionals withIntrospection [ + gobject-introspection ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; @@ -73,8 +79,8 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=true" - "-Dintrospection=enabled" + (lib.mesonBool "gtk_doc" withDocumentation) + (lib.mesonEnable "introspection" withIntrospection) "-Dinstalled_test_datadir=${placeholder "installedTests"}/share" "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec" ] ++ lib.optionals stdenv.isAarch32 [ @@ -87,12 +93,13 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs tests/gen-installed-test.py + '' + lib.optionalString withIntrospection '' PATH=${python3.withPackages (pp: [ pp.pygobject3 pp.tappy ])}/bin:$PATH patchShebangs tests/introspection.py ''; postFixup = let introspectionPy = "${placeholder "installedTests"}/libexec/installed-tests/graphene-1.0/introspection.py"; - in '' + in lib.optionalString withIntrospection '' if [ -x '${introspectionPy}' ] ; then wrapProgram '${introspectionPy}' \ --prefix GI_TYPELIB_PATH : "$out/lib/girepository-1.0"