Merge pull request #146883 from Mindavi/graphene/cross

graphene: support cross-compilation
This commit is contained in:
Guillaume Girol 2021-11-25 19:22:14 +00:00 committed by GitHub
commit 1de042bc0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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