guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/04: gnu: guix: Fix cross-compilation.


From: guix-commits
Subject: 03/04: gnu: guix: Fix cross-compilation.
Date: Tue, 7 Apr 2020 10:17:39 -0400 (EDT)

janneke pushed a commit to branch wip-hurd-vm
in repository guix.

commit 26f2486c770a13b3c48e63998014300b20e775f9
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 | 94 ++++++++++++++++++++++++-------------
 1 file changed, 62 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index bf80d9f..aedd387 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -134,7 +134,14 @@
                 (file-name (string-append "guix-" version "-checkout"))))
       (build-system gnu-build-system)
       (arguments
-       `(#:configure-flags (list
+       `(;; TODO: simplify upon rebuild
+         ,@(if (or (not (%current-target-system))
+                   (and (not (%current-target-system))
+                        (string=? (%current-system)
+                                  "x86_64-linux")))
+               '()
+               '(#:tests? #f))
+         #:configure-flags (list
                             "--localstatedir=/var"
                             "--sysconfdir=/etc"
                             (string-append "--with-bash-completion-dir="
@@ -182,6 +189,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 ((guix (assoc-ref %build-inputs "guix")))
+                                  (substitute* "Makefile"
+                                    (("LANGUAGE= 
[$][(]top_builddir[)]/pre-inst-env")
+                                     (string-append "LANGUAGE= PATH="
+                                                    guix "/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 +225,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 +273,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 +323,7 @@ $(prefix)/etc/init.d\n")))
                        ("guile-sqlite3" ,guile-sqlite3)
                        ("guile-ssh" ,guile-ssh)
                        ("guile-git" ,guile-git)
+                       ,@(if (%current-target-system) `(("guix" ,guix)) '())
 
                        ;; XXX: Keep the development inputs here even though
                        ;; they're unnecessary, just so that 'guix environment
@@ -309,34 +336,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)



reply via email to

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