GNU bug report logs -
#50201
[PATCH core-updates-frozen 0/52] Support cross-compilation in glib-or-gtk-build-system and fix cross-compilation errors
Previous Next
Reported by: Maxime Devos <maximedevos <at> telenet.be>
Date: Wed, 25 Aug 2021 17:59:01 UTC
Severity: normal
Tags: patch
Done: Mathieu Othacehe <othacehe <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
* gnu/packages/glib.scm
(gobject-introspection)[arguments]<#:phases>{rename-library}:
Correct the name of the python extension when cross-compiling.
---
gnu/packages/glib.scm | 37 ++++++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index ac38cd40d2..0c2f548f62 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -411,21 +411,40 @@ functions for strings and common data structures.")
"-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: []")))))
- '())
+ #$@(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"
(("#!@PYTHON_CMD@")
(string-append "#!" (which "python3"))))
- #t)))))
+ #t))
+ #$@(if (%current-target-system)
+ ;; Meson gives python extensions an incorrect name, see
+ ;; <https://github.com/mesonbuild/meson/issues/7049>.
+ #~((add-after 'install 'rename-library
+ (lambda* (#:key build target #:allow-other-keys)
+ (define dir
+ (string-append #$output
+ "/lib/gobject-introspection/giscanner"))
+ ;; python uses strings like 'x86_64-linux-gnu', not
+ ;; 'x86_64-unknown-linux-gnu'.
+ (define (normalise-system system)
+ ((@ (ice-9 string-fun) string-replace-substring)
+ system "-unknown-" "-"))
+ (define (extension system)
+ (string-append dir "/_giscanner.cpython-39-"
+ (normalise-system system) ".so"))
+ (rename-file (extension build) (extension target)))))
+ #~()))))
(native-inputs
`(("glib" ,glib "bin")
("pkg-config" ,pkg-config)
--
2.33.0
This bug report was last modified 3 years and 239 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.