guix-commits
[Top][All Lists]
Advanced

[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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]