[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/44: gnu: autoconf: Support cross-build.
From: |
guix-commits |
Subject: |
01/44: gnu: autoconf: Support cross-build. |
Date: |
Tue, 21 Apr 2020 15:48:18 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit d192d886eb0f76222f6bf7a04744dcff3bc48731
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sat Apr 18 19:49:54 2020 +0200
gnu: autoconf: Support cross-build.
Autoconf cannot be cross-built properly: it lacks the concept of
<tool>-for-build. It runs the host `autom4te' (a perl script) during build.
* gnu/packages/autotools.scm (autoconf)[inputs]: When cross-building, add
perl
and m4.
[native-inputs]: when cross-building, use -for-build names.
[arguments]: When cross-building, add `patch-non-shebang-references' phase
to
substitute m4 and perl.
---
gnu/packages/autotools.scm | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index 99ca527..fa3ced1 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -55,12 +55,38 @@
(base32
"113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
(build-system gnu-build-system)
+ (inputs
+ ;; TODO: remove `if' in the next rebuild cycle.
+ (if (%current-target-system)
+ `(("perl" ,perl)
+ ("m4" ,m4))
+ '()))
(native-inputs
`(("perl" ,perl)
("m4" ,m4)))
;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
;; should use our own "cpp" instead of "/lib/cpp".
- (arguments `(#:tests? #f))
+ (arguments
+ `(#:tests? #f
+ ,@(if (%current-target-system)
+ `(#:phases
+ (modify-phases %standard-phases
+ ;; `patch-shebangs' patches shebangs only, and the Perl
+ ;; scripts use a re-exec feature that references the build
+ ;; hosts' perl. Also, M4 store references hide in the
+ ;; scripts.
+ (add-after 'install 'patch-non-shebang-references
+ (lambda* (#:key build inputs outputs #:allow-other-keys)
+ (let ((m4 (assoc-ref inputs "m4"))
+ (perl (assoc-ref inputs "perl"))
+ (out (assoc-ref outputs "out"))
+ (store-directory (%store-directory)))
+ (substitute* (find-files (string-append out "/bin"))
+ (((string-append store-directory "/[^/]*-m4-[^/]*"))
m4)
+ (((string-append store-directory "/[^/]*-perl-[^/]*"))
+ perl))
+ #t)))))
+ '())))
(home-page "https://www.gnu.org/software/autoconf/")
(synopsis "Create source code configuration scripts")
(description
- branch wip-hurd-vm created (now 2c35684), guix-commits, 2020/04/21
- 01/44: gnu: autoconf: Support cross-build.,
guix-commits <=
- 05/44: vm: Make the device node procedure a parameter., guix-commits, 2020/04/21
- 04/44: tests: Update expected values for package->code., guix-commits, 2020/04/21
- 09/44: gnu: Add dde-sources., guix-commits, 2020/04/21
- 02/44: gnu: automake: Support cross-build., guix-commits, 2020/04/21
- 03/44: gnu: texinfo: Cross-build fix: Use host perl in host scripts., guix-commits, 2020/04/21
- 06/44: gnu: hurd: Build DDE libraries., guix-commits, 2020/04/21
- 10/44: gnu: Add netdde., guix-commits, 2020/04/21
- 16/44: services: Add hurd-console-service-type., guix-commits, 2020/04/21
- 15/44: services: Add hurd., guix-commits, 2020/04/21
- 14/44: system: hurd: Add /etc/group., guix-commits, 2020/04/21