[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
39/48: gnu: guix: Fix cross-compilation.
From: |
guix-commits |
Subject: |
39/48: gnu: guix: Fix cross-compilation. |
Date: |
Sun, 19 Apr 2020 10:22:18 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 59383a4d187d4fb22afe88a761dd5c7679295d31
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 3a1c8c4..d8bcfa5 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -180,6 +180,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
@@ -204,8 +216,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)
@@ -247,7 +264,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"))
@@ -295,6 +314,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
@@ -307,34 +332,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" ,(if (%current-target-system)
(@@ (gnu packages tls) gnutls-3.6.13)
- 21/48: services: hurd: Add dummy loopback., (continued)
- 21/48: services: hurd: Add dummy loopback., guix-commits, 2020/04/19
- 25/48: system: gnu: Populate "/etc" from "/boot/activation"., guix-commits, 2020/04/19
- 19/48: services: Add guix-daemon-service as a Hurd service., guix-commits, 2020/04/19
- 29/48: system: gnu: Add %bootstrap-{gcc, binutils, glibc} for devel profile., guix-commits, 2020/04/19
- 30/48: guile: Disable web-server test on the Hurd., guix-commits, 2020/04/19
- 31/48: gnu: tar: Disable troublesome tests on the Hurd., guix-commits, 2020/04/19
- 32/48: gnu: tls: Remove datefudge and disable tests on the Hurd., guix-commits, 2020/04/19
- 20/48: services: hurd: Add dummy syslog., guix-commits, 2020/04/19
- 35/48: HACK gnu: python: Disable tests on the Hurd., guix-commits, 2020/04/19
- 36/48: system: hurd: Add guix., guix-commits, 2020/04/19
- 39/48: gnu: guix: Fix cross-compilation.,
guix-commits <=
- 38/48: gnu: guix: Use gnutls-3.6.13 when cross-compiling., guix-commits, 2020/04/19
- 42/48: gnu: guix: Apply courage for the Hurd., guix-commits, 2020/04/19
- 43/48: gnu: guix: Add dependency on `hurd' when building for the Hurd., guix-commits, 2020/04/19
- 07/48: gnu: hurd: Build DDE libraries., guix-commits, 2020/04/19
- 26/48: system: hurd: Add openssh service., guix-commits, 2020/04/19
- 37/48: gnu: coreutils: Mark three more tests XFAIL on the Hurd., guix-commits, 2020/04/19
- 34/48: gnu: tcl: Disable troublesome test on the Hurd., guix-commits, 2020/04/19
- 47/48: REMOVEME gnu: guix: Bugfix for cross compiling to the Hurd., guix-commits, 2020/04/19
- 44/48: gnu: guix: Avoid loading (gnu installer) when cross compiling., guix-commits, 2020/04/19
- 46/48: Revert "records: Have ABI check work well for cross-compilation.", guix-commits, 2020/04/19