summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMaxime Devos <maximedevos@telenet.be>2021-08-24 12:26:36 +0200
committerMathieu Othacehe <othacehe@gnu.org>2021-09-20 11:15:04 +0000
commitc185e5ad6720aa5196fec849e1145cc492f0ed27 (patch)
tree77867bdd0fe9bd069a0d6af90d81693d37a51a0f /gnu/packages
parenta1b3597ab8538376be0e9bbbe49882c21e78b6df (diff)
gnu: gobject-introspection: Don't build introspection data when cross-compiling.
* gnu/packages/glib.scm (gobject-introspection)[arguments]<#:configure-flags>: Set gi_cross_use_prebuilt_gi to 'true'. (gobject-introspection)[arguments]<#:phases>{set-typelibs}: New phase, avoid undefined variable in "meson.build".
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/glib.scm20
1 files changed, 19 insertions, 1 deletions
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index cf54b3187a..829ef32221 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -410,8 +410,26 @@ functions for strings and common data structures.")
"gobject-introspection-absolute-shlib-path.patch"))))
(build-system meson-build-system)
(arguments
- `(#:phases
+ `(,@(if (%current-target-system)
+ `(#:configure-flags
+ '("-Dgi_cross_use_prebuilt_gi=true"
+ ;; Building introspection data requires running binaries
+ ;; for ‘host’ on ‘build’, so don't do that.
+ ;;
+ ;; TODO: it would be nice to have introspection data anyways
+ ;; as discussed here: https://issues.guix.gnu.org/50201#60.
+ "-Dbuild_introspection_data=false"))
+ '())
+ #:phases
(modify-phases %standard-phases
+ ,@(if (%current-target-system)
+ ;; 'typelibs' is undefined.
+ `((add-after 'unpack 'set-typelibs
+ (lambda _
+ (substitute* "meson.build"
+ (("\\bsources: typelibs\\b")
+ "sources: []")))))
+ '())
(add-after 'unpack 'do-not-use-/usr/bin/env
(lambda _
(substitute* "tools/g-ir-tool-template.in"