From 70e4672c91226d8a93750e09f0697b5fb60d7b64 Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Sun, 21 Nov 2021 17:06:40 +0100 Subject: [PATCH] graphene: support cross-compilation Disable introspection and doc building. Disable the requirement for pygobject (only used for tests) when cross-compiling. --- pkgs/development/libraries/graphene/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/graphene/default.nix b/pkgs/development/libraries/graphene/default.nix index a0bfc6f017ad..7c4c072a7003 100644 --- a/pkgs/development/libraries/graphene/default.nix +++ b/pkgs/development/libraries/graphene/default.nix @@ -19,7 +19,8 @@ stdenv.mkDerivation rec { pname = "graphene"; version = "1.10.6"; - outputs = [ "out" "devdoc" "installedTests" ]; + outputs = [ "out" ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" "installedTests" ]; src = fetchFromGitHub { owner = "ebassi"; @@ -33,6 +34,10 @@ stdenv.mkDerivation rec { ./0001-meson-add-options-for-tests-installation-dirs.patch ]; + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ docbook_xml_dtd_43 docbook_xsl @@ -47,7 +52,6 @@ stdenv.mkDerivation rec { buildInputs = [ glib - gobject-introspection ]; checkInputs = [ @@ -55,7 +59,8 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=true" + "-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" + "-Dintrospection=${if (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}" "-Dinstalled_test_datadir=${placeholder "installedTests"}/share" "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec" ]; @@ -64,6 +69,7 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs tests/gen-installed-test.py + '' + lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) '' PATH=${python3.withPackages (pp: [ pp.pygobject3 pp.tappy ])}/bin:$PATH patchShebangs tests/introspection.py '';