graphene: support cross-compilation

Disable introspection and doc building.
Disable the requirement for pygobject (only used for tests) when cross-compiling.
This commit is contained in:
Rick van Schijndel 2021-11-21 17:06:40 +01:00
parent 1debd0c754
commit 70e4672c91

View File

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