[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/44: gnu: automake: Support cross-build.
From: |
guix-commits |
Subject: |
02/44: gnu: automake: Support cross-build. |
Date: |
Tue, 21 Apr 2020 15:48:19 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 6e057f7c049c65c31b3a9349de6d0c847e89e897
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sat Apr 18 19:50:06 2020 +0200
gnu: automake: Support cross-build.
Automake cannot be cross-built properly: it lacks the concept of
<tool>-for-build. It runs the host `autoconf' during build.
* gnu/packages/autotools.scm (automake)[inputs]: When cross-building, add
autoconf and perl. [native-inputs]: when cross-building, use -for-build
names.
[arguments]: When cross-building, add `patch-non-shebang-references' phase
to
substitute autoconf and perl.
---
gnu/packages/autotools.scm | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index fa3ced1..38db317 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -287,15 +287,21 @@ output is indexed in many ways to simplify browsing.")
(patches
(search-patches "automake-skip-amhello-tests.patch"))))
(build-system gnu-build-system)
+ (inputs
+ ;; TODO: remove `if' in the next rebuild cycle.
+ (if (%current-target-system)
+ `(("autoconf" ,autoconf-wrapper)
+ ("perl" ,perl))
+ '()))
(native-inputs
`(("autoconf" ,autoconf-wrapper)
- ("perl" ,perl)))
+ ("perl" ,perl)))
(native-search-paths
(list (search-path-specification
(variable "ACLOCAL_PATH")
(files '("share/aclocal")))))
(arguments
- '(#:modules ((guix build gnu-build-system)
+ `(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(srfi srfi-26)
@@ -324,6 +330,25 @@ output is indexed in many ways to simplify browsing.")
(string-append "exit 77\n" all "\n")))
#t))
+ ,@(if (%current-target-system)
+ ;; `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 ((autoconf (assoc-ref inputs "autoconf"))
+ (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
"/[^/]*-autoconf-[^/]*"))
+ autoconf)
+ (((string-append store-directory
"/[^/]*-perl-[^/]*"))
+ perl))
+ #t))))
+ '())
+
;; Files like `install-sh', `mdate.sh', etc. must use
;; #!/bin/sh, otherwise users could leak erroneous shebangs
;; in the wild. See <http://bugs.gnu.org/14201> for an
- branch wip-hurd-vm created (now 2c35684), guix-commits, 2020/04/21
- 01/44: gnu: autoconf: Support cross-build., guix-commits, 2020/04/21
- 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 <=
- 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
- 11/44: gnu: hurd: Add NFS support., guix-commits, 2020/04/21
- 18/44: services: Add hurd-user-services-service-type., guix-commits, 2020/04/21
- 22/44: services: Add openssh-service as a Hurd service., guix-commits, 2020/04/21
- 21/44: services: hurd: Add dummy loopback., guix-commits, 2020/04/21