[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
31/52: gnu: guix: Fix cross-compilation.
From: |
guix-commits |
Subject: |
31/52: gnu: guix: Fix cross-compilation. |
Date: |
Thu, 9 Apr 2020 13:29:09 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 134c75b808b21369e74cbc005a94bf953a84e4c6
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Tue Apr 7 13:14:12 2020 +0200
gnu: guix: Fix cross-compilation.
* gnu/packages/package-management.scm (guix)[arguments]: Copy bootstrap
packages for host. Add i586-pc-gnu => i586-gnu aid for the Hurd.
Do not attempt to generate man-pages when cross-compiling.
---
gnu/packages/package-management.scm | 90 ++++++++++++++++++++++++-------------
1 file changed, 59 insertions(+), 31 deletions(-)
diff --git a/gnu/packages/package-management.scm
b/gnu/packages/package-management.scm
index 7ab13de..bc73e8c 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -182,6 +182,18 @@
$(prefix)/etc/init.d\n")))
(invoke "sh" "bootstrap")))
+ ,@(if (%current-target-system)
+ ;; Use guix-for-build to generate manual pages.
+ `((add-before 'build 'cross-generate-manual-pages
+ (lambda _
+ (let ((self (assoc-ref %build-inputs "self")))
+ (substitute* "Makefile"
+ (("LANGUAGE=
[$][(]top_builddir[)]/pre-inst-env")
+ (string-append "LANGUAGE= PATH="
+ self "/bin"
+ ":" (getenv "PATH"))))
+ #t))))
+ '())
(add-before 'check 'copy-bootstrap-guile
(lambda* (#:key system inputs #:allow-other-keys)
;; Copy the bootstrap guile tarball in the store used
@@ -206,8 +218,13 @@ $(prefix)/etc/init.d\n")))
(symlink item root)
(add-indirect-root store root)))))
- (invoke "./test-env" "guile" "-c"
- (object->string code)))
+ ,@(if (or (not (%current-target-system))
+ (and (not (%current-target-system))
+ (string=? (%current-system)
+ "x86_64-linux")))
+ '((invoke "./test-env" "guile" "-c"
+ (object->string code)))
+ '(#t)))
(intern (assoc-ref inputs "boot-guile") #f)
@@ -249,7 +266,9 @@ $(prefix)/etc/init.d\n")))
;; Make sure the 'guix' command finds GnuTLS,
;; Guile-JSON, and Guile-Git automatically.
(let* ((out (assoc-ref outputs "out"))
- (guile (assoc-ref inputs "guile"))
+ (guile ,@(if (%current-target-system)
+ '((assoc-ref %build-inputs
"guile"))
+ '((assoc-ref inputs "guile"))))
(gcrypt (assoc-ref inputs "guile-gcrypt"))
(json (assoc-ref inputs "guile-json"))
(sqlite (assoc-ref inputs "guile-sqlite3"))
@@ -297,6 +316,12 @@ $(prefix)/etc/init.d\n")))
("guile-sqlite3" ,guile-sqlite3)
("guile-ssh" ,guile-ssh)
("guile-git" ,guile-git)
+ ;; When cross-compiling, Guix needs a native version of
+ ;; itself to generate the manual pages (see the related
+ ;; phase above).
+ ,@(if (%current-target-system)
+ `(("self" ,this-package))
+ '())
;; XXX: Keep the development inputs here even though
;; they're unnecessary, just so that 'guix environment
@@ -309,34 +334,37 @@ $(prefix)/etc/init.d\n")))
("help2man" ,help2man)
("po4a" ,po4a)))
(inputs
- `(("bzip2" ,bzip2)
- ("gzip" ,gzip)
- ("zlib" ,zlib) ;for 'guix publish'
- ("lzlib" ,lzlib) ;for 'guix publish' and 'guix substitute'
-
- ("sqlite" ,sqlite)
- ("libgcrypt" ,libgcrypt)
-
- ("guile" ,guile-3.0)
-
- ;; Some of the tests use "unshare" when it is available.
- ("util-linux" ,util-linux)
-
- ;; Many tests rely on the 'guile-bootstrap' package, which is why we
- ;; have it here.
- ("boot-guile" ,(bootstrap-guile-origin (%current-system)))
- ,@(if (and (not (%current-target-system))
- (string=? (%current-system) "x86_64-linux"))
- `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
- '())
-
- ;; Tests also rely on these bootstrap executables.
- ("bootstrap/bash" ,(bootstrap-executable "bash" (%current-system)))
- ("bootstrap/mkdir" ,(bootstrap-executable "mkdir" (%current-system)))
- ("bootstrap/tar" ,(bootstrap-executable "tar" (%current-system)))
- ("bootstrap/xz" ,(bootstrap-executable "xz" (%current-system)))
-
- ("glibc-utf8-locales" ,glibc-utf8-locales)))
+ (let ((target (match (or (%current-target-system) (%current-system))
+ ("i586-pc-gnu" "i586-gnu")
+ (x x))))
+ `(("bzip2" ,bzip2)
+ ("gzip" ,gzip)
+ ("zlib" ,zlib) ;for 'guix publish'
+ ("lzlib" ,lzlib) ;for 'guix publish' and 'guix substitute'
+
+ ("sqlite" ,sqlite)
+ ("libgcrypt" ,libgcrypt)
+
+ ("guile" ,guile-3.0)
+
+ ;; Some of the tests use "unshare" when it is available.
+ ("util-linux" ,util-linux)
+
+ ;; Many tests rely on the 'guile-bootstrap' package, which is why we
+ ;; have it here.
+ ("boot-guile" ,(bootstrap-guile-origin target))
+ ,@(if (and (not (%current-target-system))
+ (string=? (%current-system) "x86_64-linux"))
+ `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
+ '())
+
+ ;; Tests also rely on these bootstrap executables.
+ ("bootstrap/bash" ,(bootstrap-executable "bash" target))
+ ("bootstrap/mkdir" ,(bootstrap-executable "mkdir" target))
+ ("bootstrap/tar" ,(bootstrap-executable "tar" target))
+ ("bootstrap/xz" ,(bootstrap-executable "xz" target))
+
+ ("glibc-utf8-locales" ,glibc-utf8-locales))))
(propagated-inputs
`(("gnutls" ,guile3.0-gnutls)
("guile-gcrypt" ,guile-gcrypt)
- 26/52: gnu: libgcrypt: Fix cross-compilation., (continued)
- 26/52: gnu: libgcrypt: Fix cross-compilation., guix-commits, 2020/04/09
- 23/52: database: 'reset-timestamps' can optionally preserve permissions., guix-commits, 2020/04/09
- 22/52: system: hurd: Create /etc/{hostname,motd,login} and /root., guix-commits, 2020/04/09
- 29/52: linux-boot: Add 'make-hurd-device-nodes'., guix-commits, 2020/04/09
- 28/52: gnu: guix: Apply courage for the Hurd., guix-commits, 2020/04/09
- 34/52: gnu: hurd: Add dependency on libgcrypt., guix-commits, 2020/04/09
- 32/52: system: hurd: Add guix., guix-commits, 2020/04/09
- 36/52: gnu: hurd: Install a BDF font., guix-commits, 2020/04/09
- 33/52: gnu: libdaemon: Allow cross-compilation., guix-commits, 2020/04/09
- 21/52: gnu: hurd: Install the UTF-8 motd., guix-commits, 2020/04/09
- 31/52: gnu: guix: Fix cross-compilation.,
guix-commits <=
- 27/52: gnu: openssl: Support cross-compilation to the Hurd., guix-commits, 2020/04/09
- 35/52: gnu: hurd: Add dependency on libdaemon., guix-commits, 2020/04/09
- 38/52: system: hurd: Add openssh, shepherd., guix-commits, 2020/04/09
- 37/52: gnu: openssh: Build fix for the Hurd., guix-commits, 2020/04/09
- 43/52: gnu: hurd: "/libexec/rc" spawns the console client., guix-commits, 2020/04/09
- 41/52: system: hurd: Add /etc/group., guix-commits, 2020/04/09
- 42/52: gnu: libdaemon: Cross-build with --localstatedir=/var., guix-commits, 2020/04/09
- 40/52: system: hurd: Add root profile., guix-commits, 2020/04/09
- 45/52: system: hurd: Add net-base and inetutils., guix-commits, 2020/04/09
- 39/52: gnu: guile-json: Cross-build fix., guix-commits, 2020/04/09