[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
34/43: gnu: guix: Fix cross-compilation.
From: |
guix-commits |
Subject: |
34/43: gnu: guix: Fix cross-compilation. |
Date: |
Mon, 20 Apr 2020 07:34:10 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 96b5a709c30a6f37bc72ab355db725b117f8064f
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..9021643 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* (#:key native-inputs #:allow-other-keys)
+ (let ((self (assoc-ref native-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)
- 37/43: gnu: guix: Apply courage for the Hurd., (continued)
- 37/43: gnu: guix: Apply courage for the Hurd., guix-commits, 2020/04/20
- 18/43: services: Add hurd-user-services-service-type., guix-commits, 2020/04/20
- 33/43: gnu: guix: Use gnutls-3.6.13 when cross-compiling., guix-commits, 2020/04/20
- 27/43: system: hurd: Create system profile for guix development., guix-commits, 2020/04/20
- 29/43: guile: Disable web-server test on the Hurd., guix-commits, 2020/04/20
- 38/43: gnu: guix: Add dependency on `hurd' when building for the Hurd., guix-commits, 2020/04/20
- 39/43: gnu: guix: Avoid loading (gnu installer) when cross compiling., guix-commits, 2020/04/20
- 36/43: gnu: guix: Cross-build fix: override compressors., guix-commits, 2020/04/20
- 40/43: Revert "compile: Run the load phase within 'with-target'.", guix-commits, 2020/04/20
- 43/43: gnu: guix: Run `make update-guix-package'., guix-commits, 2020/04/20
- 34/43: gnu: guix: Fix cross-compilation.,
guix-commits <=
- 35/43: gnu: guix: Cross-build fixup for wrap-program., guix-commits, 2020/04/20
- 41/43: Revert "records: Have ABI check work well for cross-compilation.", guix-commits, 2020/04/20