unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#35244] [PATCH 0/6] Fix some cross-compilation issues.
@ 2019-04-12 13:13 Mathieu Othacehe
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
  2019-06-26  8:19 ` [bug#35244] [PATCH] gnu: perl: " Mathieu Othacehe
  0 siblings, 2 replies; 17+ messages in thread
From: Mathieu Othacehe @ 2019-04-12 13:13 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

Hello,

Here's a first step in the guix system cross compilation support direction.

Thanks,

Mathieu

Mathieu Othacehe (6):
  gnu: bash-completion: Fix cross-compilation.
  gnu: groff: Fix cross compilation.
  gnu: glibc-utf8-locales: Always use native package.
  gnu: firmware: Fix cross compilation.
  linux-initrd: Fix cross compilation.
  gnu: python: Fix cross compilation.

 gnu/installer.scm                   |  4 ++--
 gnu/packages/bash.scm               |  8 ++++++--
 gnu/packages/firmware.scm           |  5 +++--
 gnu/packages/groff.scm              | 31 +++++++++++++++++++++++++++--
 gnu/packages/package-management.scm | 16 +++++++++------
 gnu/packages/python.scm             |  5 ++++-
 gnu/services/base.scm               |  6 +++---
 gnu/system/linux-initrd.scm         |  7 +++++--
 guix/profiles.scm                   |  3 ++-
 guix/self.scm                       |  3 ++-
 10 files changed, 66 insertions(+), 22 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation.
  2019-04-12 13:13 [bug#35244] [PATCH 0/6] Fix some cross-compilation issues Mathieu Othacehe
@ 2019-04-12 13:15 ` Mathieu Othacehe
  2019-04-12 13:15   ` [bug#35244] [PATCH 2/6] gnu: groff: Fix cross compilation Mathieu Othacehe
                     ` (5 more replies)
  2019-06-26  8:19 ` [bug#35244] [PATCH] gnu: perl: " Mathieu Othacehe
  1 sibling, 6 replies; 17+ messages in thread
From: Mathieu Othacehe @ 2019-04-12 13:15 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

* gnu/packages/bash.scm (bash-completion)[arguments]: Search for util-linux in
native-inputs and inputs during "remove-redundant-completions" phase.
---
 gnu/packages/bash.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index fb4e3f4be3..ef93a11085 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -291,13 +292,16 @@ without modification.")
      `(#:phases (modify-phases %standard-phases
                   (add-after
                    'install 'remove-redundant-completions
-                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (lambda* (#:key
+                             inputs native-inputs
+                             outputs #:allow-other-keys)
                      ;; Util-linux comes with a bunch of completion files for
                      ;; its own commands which are more sophisticated and
                      ;; up-to-date than those of bash-completion.  Remove those
                      ;; from bash-completion.
                      (let* ((out         (assoc-ref outputs "out"))
-                            (util-linux  (assoc-ref inputs "util-linux"))
+                            (util-linux  (assoc-ref (or native-inputs inputs)
+                                                    "util-linux"))
                             (completions (string-append out
                                                         "/share/bash-completion"
                                                         "/completions"))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 2/6] gnu: groff: Fix cross compilation.
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
@ 2019-04-12 13:15   ` Mathieu Othacehe
  2019-04-14 15:22     ` Ludovic Courtès
  2019-04-12 13:15   ` [bug#35244] [PATCH 3/6] gnu: glibc-utf8-locales: Always use native package Mathieu Othacehe
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Mathieu Othacehe @ 2019-04-12 13:15 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

* gnu/packages/groff.scm (groff)[arguments]: Replace build phase to pass
GROFF_BIN_PATH and GROFFBIN variables when cross-compiling.

Also add native groff as an input.
---
 gnu/packages/groff.scm | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm
index cf392f5468..6f01395691 100644
--- a/gnu/packages/groff.scm
+++ b/gnu/packages/groff.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -53,6 +54,7 @@
    ;; own HTML doc, nor does it change its capabilities, so we removed netpbm
    ;; from 'inputs'.
 
+   (self-native-input? #t)
    (inputs `(("ghostscript" ,ghostscript)))
    (native-inputs `(("bison" ,bison)
                     ("perl" ,perl)
@@ -65,7 +67,31 @@
         (add-after 'unpack 'setenv
           (lambda _
             (setenv "GS_GENERATE_UUIDS" "0")
-            #t)))))
+            #t))
+         (replace 'build
+           (lambda* (#:key
+                     make-flags parallel-build?
+                     native-inputs target #:allow-other-keys)
+             ;; When cross-compiling, native groff is needed, see:
+             ;; http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html
+             (let ((parallel
+                    (if parallel-build?
+                        `("-j" ,(number->string (parallel-job-count)))
+                        '()))
+                   (flags
+                    (if target
+                        (let ((groff (or
+                                      (assoc-ref native-inputs "groff")
+                                      (assoc-ref native-inputs "self"))))
+                          (append
+                           make-flags
+                           (list
+                            (string-append "GROFF_BIN_PATH=" groff)
+                            (string-append "GROFFBIN=" groff
+                                           "/bin/groff"))))
+                        make-flags)))
+               (apply invoke `("make" ,@parallel ,@flags)))
+             #t)))))
    (synopsis "Typesetting from plain text mixed with formatting commands")
    (description
     "Groff is a typesetting package that reads plain text and produces
@@ -86,7 +112,8 @@ is usually the formatter of \"man\" documentation pages.")
     ;; Omit the DVI, PS, PDF, and HTML backends.
     (inputs '())
     (native-inputs `(("bison" ,bison)
-                     ("perl" ,perl)))
+                     ("perl" ,perl)
+                     ("groff" ,groff)))
 
     (arguments
      `(#:disallowed-references (,perl)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 3/6] gnu: glibc-utf8-locales: Always use native package.
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
  2019-04-12 13:15   ` [bug#35244] [PATCH 2/6] gnu: groff: Fix cross compilation Mathieu Othacehe
@ 2019-04-12 13:15   ` Mathieu Othacehe
  2019-04-14 15:24     ` Ludovic Courtès
  2019-04-12 13:15   ` [bug#35244] [PATCH 4/6] gnu: firmware: Fix cross compilation Mathieu Othacehe
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Mathieu Othacehe @ 2019-04-12 13:15 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

* gnu/installer.scm (build-compiled-file): Use native glibc-utf8-locales.
* gnu/services/base.scm (guix-shepherd-service): Ditto,
(guix-publish-shepherd-service): ditto.
* guix/profiles.scm (profile-derivation): Ditto.
* guix/self.scm (guix-command): Ditto.
* gnu/packages/package-management.scm (guix)[inputs]: Move glibc-utf8-locales
from here ...,
[native-inputs]: ... to here,
[phases]: search for glibc-utf8-locales in native-inputs and inputs in
'wrap-program phase.
---
 gnu/installer.scm                   |  4 ++--
 gnu/packages/package-management.scm | 16 ++++++++++------
 gnu/services/base.scm               |  6 +++---
 guix/profiles.scm                   |  3 ++-
 guix/self.scm                       |  3 ++-
 5 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/gnu/installer.scm b/gnu/installer.scm
index 50e2e7d85e..bbf2441061 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2018, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -62,7 +62,7 @@ version of this file."
   (define set-utf8-locale
     #~(begin
         (setenv "LOCPATH"
-                #$(file-append glibc-utf8-locales "/lib/locale/"
+                #+(file-append glibc-utf8-locales "/lib/locale/"
                                (version-major+minor
                                 (package-version glibc-utf8-locales))))
         (setlocale LC_ALL "en_US.utf8")))
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 4808687227..6720cac783 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2019 Vagrant Cascadian <vagrant@reproducible-builds.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -217,7 +218,10 @@
                         (setenv "SHELL" (which "sh"))
                         #t))
                     (add-after 'install 'wrap-program
-                      (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (lambda* (#:key
+                                inputs native-inputs
+                                outputs
+                                #:allow-other-keys)
                         ;; Make sure the 'guix' command finds GnuTLS,
                         ;; Guile-JSON, and Guile-Git automatically.
                         (let* ((out    (assoc-ref outputs "out"))
@@ -230,7 +234,8 @@
                                                   "guile-bytestructures"))
                                (ssh    (assoc-ref inputs "guile-ssh"))
                                (gnutls (assoc-ref inputs "gnutls"))
-                               (locales (assoc-ref inputs "glibc-utf8-locales"))
+                               (locales (assoc-ref (or native-inputs inputs)
+                                                   "glibc-utf8-locales"))
                                (deps   (list gcrypt json sqlite gnutls
                                              git bs ssh))
                                (effective
@@ -258,7 +263,8 @@
                             `("GUIX_LOCPATH" ":" suffix (,locpath)))
 
                           #t))))))
-      (native-inputs `(("pkg-config" ,pkg-config)
+      (native-inputs `(("glibc-utf8-locales" ,glibc-utf8-locales)
+                       ("pkg-config" ,pkg-config)
 
                        ;; XXX: Keep the development inputs here even though
                        ;; they're unnecessary, just so that 'guix environment
@@ -288,9 +294,7 @@
          ,@(if (and (not (%current-target-system))
                     (string=? (%current-system) "x86_64-linux"))
                `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
-               '())
-
-         ("glibc-utf8-locales" ,glibc-utf8-locales)))
+               '())))
       (propagated-inputs
        `(("gnutls" ,gnutls)
          ("guile-gcrypt" ,guile-gcrypt)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 65f7ff29c8..760d65e5ca 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2018, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -1638,7 +1638,7 @@ archive' public keys, with GUIX."
                      ;; file names such as 'nss-certs'.  See
                      ;; <https://bugs.gnu.org/32942>.
                      (string-append "GUIX_LOCPATH="
-                                    #$glibc-utf8-locales "/lib/locale")
+                                    #+glibc-utf8-locales "/lib/locale")
                      "LC_ALL=en_US.utf8")
 
                #:log-file #$log-file))
@@ -1774,7 +1774,7 @@ archive' public keys, with GUIX."
                       ;; as 'nss-certs'.  See <https://bugs.gnu.org/26948>.
                       #:environment-variables
                       (list (string-append "GUIX_LOCPATH="
-                                           #$glibc-utf8-locales "/lib/locale")
+                                           #+glibc-utf8-locales "/lib/locale")
                             "LC_ALL=en_US.utf8")))
             (stop #~(make-kill-destructor)))))))
 
diff --git a/guix/profiles.scm b/guix/profiles.scm
index dfc9ba1ca0..252910d0e5 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
 ;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1477,7 +1478,7 @@ are cross-built for TARGET."
       ;; install a UTF-8 locale.
       #~(begin
           (setenv "LOCPATH"
-                  #$(file-append glibc-utf8-locales "/lib/locale/"
+                  #+(file-append glibc-utf8-locales "/lib/locale/"
                                  (version-major+minor
                                   (package-version glibc-utf8-locales))))
           (setlocale LC_ALL "en_US.utf8")))
diff --git a/guix/self.scm b/guix/self.scm
index 7ba2764eb9..dc0aba8987 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -421,7 +422,7 @@ load path."
                               (string-append (if locpath
                                                  (string-append locpath ":")
                                                  "")
-                                             #$(file-append glibc-utf8-locales
+                                             #+(file-append glibc-utf8-locales
                                                             "/lib/locale"))))
 
                     (let ((guix-main (module-ref (resolve-interface '(guix ui))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 4/6] gnu: firmware: Fix cross compilation.
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
  2019-04-12 13:15   ` [bug#35244] [PATCH 2/6] gnu: groff: Fix cross compilation Mathieu Othacehe
  2019-04-12 13:15   ` [bug#35244] [PATCH 3/6] gnu: glibc-utf8-locales: Always use native package Mathieu Othacehe
@ 2019-04-12 13:15   ` Mathieu Othacehe
  2019-04-14 15:26     ` Ludovic Courtès
  2019-04-12 13:15   ` [bug#35244] [PATCH 5/6] linux-initrd: " Mathieu Othacehe
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Mathieu Othacehe @ 2019-04-12 13:15 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

* gnu/packages/firmware.scm (ath9k-htc-firmware)[phases]: Search for
"cross-gcc" in native-inputs in "configure" phase.
---
 gnu/packages/firmware.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 4df4b22843..68476ed826 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -59,7 +60,7 @@
      '(#:phases
        (modify-phases %standard-phases
          (add-before 'configure 'pre-configure
-           (lambda* (#:key inputs #:allow-other-keys)
+           (lambda* (#:key native-inputs #:allow-other-keys)
              (chdir "target_firmware")
 
              ;; 'configure' is a simple script that runs 'cmake' with
@@ -67,7 +68,7 @@
              (substitute* "configure"
                (("^TOOLCHAIN=.*$")
                 (string-append "TOOLCHAIN="
-                               (assoc-ref inputs "cross-gcc")
+                               (assoc-ref native-inputs "cross-gcc")
                                "\n")))
              #t))
          (replace 'install
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 5/6] linux-initrd: Fix cross compilation.
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
                     ` (2 preceding siblings ...)
  2019-04-12 13:15   ` [bug#35244] [PATCH 4/6] gnu: firmware: Fix cross compilation Mathieu Othacehe
@ 2019-04-12 13:15   ` Mathieu Othacehe
  2019-04-14 15:29     ` Ludovic Courtès
  2019-04-12 13:15   ` [bug#35244] [PATCH 6/6] gnu: python: " Mathieu Othacehe
  2019-04-14 15:19   ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Ludovic Courtès
  5 siblings, 1 reply; 17+ messages in thread
From: Mathieu Othacehe @ 2019-04-12 13:15 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

* gnu/system/linux-initrd.scm (default-initrd-modules): Check system name
against %current-target-system first in case we are cross-compiling.
---
 gnu/system/linux-initrd.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 656afd1ddb..c90b87c023 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -273,7 +273,10 @@ FILE-SYSTEMS."
   (append-map (compose file-system-type-modules file-system-type)
               file-systems))
 
-(define* (default-initrd-modules #:optional (system (%current-system)))
+(define* (default-initrd-modules
+           #:optional
+           (system (or (%current-target-system)
+                       (%current-system))))
   "Return the list of modules included in the initrd by default."
   (define virtio-modules
     ;; Modules for Linux para-virtualized devices, for use in QEMU guests.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 6/6] gnu: python: Fix cross compilation.
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
                     ` (3 preceding siblings ...)
  2019-04-12 13:15   ` [bug#35244] [PATCH 5/6] linux-initrd: " Mathieu Othacehe
@ 2019-04-12 13:15   ` Mathieu Othacehe
  2019-04-14 15:27     ` Ludovic Courtès
  2019-04-14 15:19   ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Ludovic Courtès
  5 siblings, 1 reply; 17+ messages in thread
From: Mathieu Othacehe @ 2019-04-12 13:15 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

* gnu/packages/python.scm (python-2.7)[arguments]: Add a configure flag to
disable a check failing when cross-compiling. This is covered here:

https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
---
 gnu/packages/python.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 57ced499cb..e3a484f5cd 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -38,7 +38,7 @@
 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
 ;;; Copyright © 2017, 2018 Adriano Peluso <catonano@gmail.com>
 ;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
-;;; Copyright © 2017, 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2018, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
@@ -134,6 +134,9 @@
              "--with-system-ffi"                  ;build ctypes
              "--with-ensurepip=install"           ;install pip and setuptools
              "--enable-unicode=ucs4"
+             ;; Disable runtime check failing if cross-compiling, see:
+             ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+             "ac_cv_buggy_getaddrinfo=no"
              (string-append "LDFLAGS=-Wl,-rpath="
                             (assoc-ref %outputs "out") "/lib"))
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation.
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
                     ` (4 preceding siblings ...)
  2019-04-12 13:15   ` [bug#35244] [PATCH 6/6] gnu: python: " Mathieu Othacehe
@ 2019-04-14 15:19   ` Ludovic Courtès
  2019-06-25 19:42     ` Mathieu Othacehe
  5 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2019-04-14 15:19 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35244

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/packages/bash.scm (bash-completion)[arguments]: Search for util-linux in
> native-inputs and inputs during "remove-redundant-completions" phase.

LGTM!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 2/6] gnu: groff: Fix cross compilation.
  2019-04-12 13:15   ` [bug#35244] [PATCH 2/6] gnu: groff: Fix cross compilation Mathieu Othacehe
@ 2019-04-14 15:22     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2019-04-14 15:22 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35244

Hi,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/packages/groff.scm (groff)[arguments]: Replace build phase to pass
> GROFF_BIN_PATH and GROFFBIN variables when cross-compiling.
>
> Also add native groff as an input.

You’d need to mention ‘self-native-input?’ explicitly.

> +   (self-native-input? #t)

However, this field no longer exists: see commit
a7646bc5e17a829d23519d0b199a576fb1edbd04, and see
528ea990c3a815cb4b0ded913ea22cdc778839bd for how to adjust your package.

> +         (replace 'build
> +           (lambda* (#:key
> +                     make-flags parallel-build?
> +                     native-inputs target #:allow-other-keys)
> +             ;; When cross-compiling, native groff is needed, see:
> +             ;; http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html
> +             (let ((parallel
> +                    (if parallel-build?
> +                        `("-j" ,(number->string (parallel-job-count)))
> +                        '()))
> +                   (flags
> +                    (if target
> +                        (let ((groff (or
> +                                      (assoc-ref native-inputs "groff")
> +                                      (assoc-ref native-inputs "self"))))
> +                          (append
> +                           make-flags
> +                           (list
> +                            (string-append "GROFF_BIN_PATH=" groff)
> +                            (string-append "GROFFBIN=" groff
> +                                           "/bin/groff"))))
> +                        make-flags)))
> +               (apply invoke `("make" ,@parallel ,@flags)))

If you make it conditional on (%current-target-system) , that’ll avoid a
massive rebuild of the 4K packages that depend on ‘groff’, and thus
it’ll be applicable on ‘master’.

Could you send an updated patch?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 3/6] gnu: glibc-utf8-locales: Always use native package.
  2019-04-12 13:15   ` [bug#35244] [PATCH 3/6] gnu: glibc-utf8-locales: Always use native package Mathieu Othacehe
@ 2019-04-14 15:24     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2019-04-14 15:24 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35244

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/installer.scm (build-compiled-file): Use native glibc-utf8-locales.
> * gnu/services/base.scm (guix-shepherd-service): Ditto,
> (guix-publish-shepherd-service): ditto.
> * guix/profiles.scm (profile-derivation): Ditto.
> * guix/self.scm (guix-command): Ditto.
> * gnu/packages/package-management.scm (guix)[inputs]: Move glibc-utf8-locales
> from here ...,
> [native-inputs]: ... to here,
> [phases]: search for glibc-utf8-locales in native-inputs and inputs in
> 'wrap-program phase.

Do you have evidence that locale data is architecture-independent?

It’s not all that clear to me; that it goes to $libdir, not $datadir,
suggests it’s indeed architecture-dependent.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 4/6] gnu: firmware: Fix cross compilation.
  2019-04-12 13:15   ` [bug#35244] [PATCH 4/6] gnu: firmware: Fix cross compilation Mathieu Othacehe
@ 2019-04-14 15:26     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2019-04-14 15:26 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35244

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/packages/firmware.scm (ath9k-htc-firmware)[phases]: Search for
> "cross-gcc" in native-inputs in "configure" phase.

The subject line should mention ‘ath9k-htc-firmware’, not ‘firmware’.
:-)

>               (substitute* "configure"
>                 (("^TOOLCHAIN=.*$")
>                  (string-append "TOOLCHAIN="
> -                               (assoc-ref inputs "cross-gcc")
> +                               (assoc-ref native-inputs "cross-gcc")
>                                 "\n")))

It still works natively, right?

It it does, it LGTM!

Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 6/6] gnu: python: Fix cross compilation.
  2019-04-12 13:15   ` [bug#35244] [PATCH 6/6] gnu: python: " Mathieu Othacehe
@ 2019-04-14 15:27     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2019-04-14 15:27 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35244

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/packages/python.scm (python-2.7)[arguments]: Add a configure flag to
> disable a check failing when cross-compiling. This is covered here:
>
> https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html

[...]

> +             ;; Disable runtime check failing if cross-compiling, see:
> +             ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
> +             "ac_cv_buggy_getaddrinfo=no"

Can you make it conditional on (%current-target-system)?  That way we
can apply it on master without rebuilding the world.

Otherwise LGTM.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 5/6] linux-initrd: Fix cross compilation.
  2019-04-12 13:15   ` [bug#35244] [PATCH 5/6] linux-initrd: " Mathieu Othacehe
@ 2019-04-14 15:29     ` Ludovic Courtès
  2019-06-25 19:47       ` Mathieu Othacehe
  0 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2019-04-14 15:29 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35244

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * gnu/system/linux-initrd.scm (default-initrd-modules): Check system name
> against %current-target-system first in case we are cross-compiling.

LGTM!

Glad we’re making process on system cross-compilation!  Are you
targeting low-end ARMv7 devices?

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation.
  2019-04-14 15:19   ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Ludovic Courtès
@ 2019-06-25 19:42     ` Mathieu Othacehe
  0 siblings, 0 replies; 17+ messages in thread
From: Mathieu Othacehe @ 2019-06-25 19:42 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 35244


> Mathieu Othacehe <m.othacehe@gmail.com> skribis:
>
>> * gnu/packages/bash.scm (bash-completion)[arguments]: Search for util-linux in
>> native-inputs and inputs during "remove-redundant-completions" phase.
>
> LGTM!

Pushed as d8dbfbce.

Sorry for the looong reaction.

Mathieu

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 5/6] linux-initrd: Fix cross compilation.
  2019-04-14 15:29     ` Ludovic Courtès
@ 2019-06-25 19:47       ` Mathieu Othacehe
  2019-06-26  8:57         ` Ludovic Courtès
  0 siblings, 1 reply; 17+ messages in thread
From: Mathieu Othacehe @ 2019-06-25 19:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 35244


> LGTM!

Pushed as fdbf4447b.

> Glad we’re making process on system cross-compilation!  Are you
> targeting low-end ARMv7 devices?

Yes as well as more powerful aarch64 boards. I would like to use Guix as
an alternative to various tools such as Yocto/Buildroot at
work. Cross-compiling is the only viable way as target compilation and
qemu-binfmt alternatives are way too slow.

I'll try to resume the rest of the serie soon.

Mathieu

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH] gnu: perl: Fix cross-compilation.
  2019-04-12 13:13 [bug#35244] [PATCH 0/6] Fix some cross-compilation issues Mathieu Othacehe
  2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
@ 2019-06-26  8:19 ` Mathieu Othacehe
  1 sibling, 0 replies; 17+ messages in thread
From: Mathieu Othacehe @ 2019-06-26  8:19 UTC (permalink / raw)
  To: 35244; +Cc: Mathieu Othacehe

* gnu/packages/perl.scm (perl)[arguments]: Use cross-libc instead of libc when
cross-compiling.
---
 gnu/packages/perl.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 63b8e387b8..b348a3e088 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -22,6 +22,7 @@
 ;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -81,7 +82,7 @@
                        "perl-reproducible-build-date.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f
+     `(#:tests? #f
        #:configure-flags
        (let ((out  (assoc-ref %outputs "out"))
              (libc (assoc-ref %build-inputs "libc")))
@@ -130,7 +131,9 @@
          (add-after 'install 'remove-extra-references
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out     (assoc-ref outputs "out"))
-                    (libc    (assoc-ref inputs "libc"))
+                    (libc    (assoc-ref inputs
+                                        ,(if (%current-target-system)
+                                             "cross-libc" "libc")))
                     (config1 (car (find-files (string-append out "/lib/perl5")
                                               "^Config_heavy\\.pl$")))
                     (config2 (find-files (string-append out "/lib/perl5")
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#35244] [PATCH 5/6] linux-initrd: Fix cross compilation.
  2019-06-25 19:47       ` Mathieu Othacehe
@ 2019-06-26  8:57         ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2019-06-26  8:57 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35244

Hello,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

>> LGTM!
>
> Pushed as fdbf4447b.

\o/

>> Glad we’re making process on system cross-compilation!  Are you
>> targeting low-end ARMv7 devices?
>
> Yes as well as more powerful aarch64 boards. I would like to use Guix as
> an alternative to various tools such as Yocto/Buildroot at
> work. Cross-compiling is the only viable way as target compilation and
> qemu-binfmt alternatives are way too slow.

qemu-binfmt might be OK if you get enough substitutes and thus have
little to build locally.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-06-26  8:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12 13:13 [bug#35244] [PATCH 0/6] Fix some cross-compilation issues Mathieu Othacehe
2019-04-12 13:15 ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Mathieu Othacehe
2019-04-12 13:15   ` [bug#35244] [PATCH 2/6] gnu: groff: Fix cross compilation Mathieu Othacehe
2019-04-14 15:22     ` Ludovic Courtès
2019-04-12 13:15   ` [bug#35244] [PATCH 3/6] gnu: glibc-utf8-locales: Always use native package Mathieu Othacehe
2019-04-14 15:24     ` Ludovic Courtès
2019-04-12 13:15   ` [bug#35244] [PATCH 4/6] gnu: firmware: Fix cross compilation Mathieu Othacehe
2019-04-14 15:26     ` Ludovic Courtès
2019-04-12 13:15   ` [bug#35244] [PATCH 5/6] linux-initrd: " Mathieu Othacehe
2019-04-14 15:29     ` Ludovic Courtès
2019-06-25 19:47       ` Mathieu Othacehe
2019-06-26  8:57         ` Ludovic Courtès
2019-04-12 13:15   ` [bug#35244] [PATCH 6/6] gnu: python: " Mathieu Othacehe
2019-04-14 15:27     ` Ludovic Courtès
2019-04-14 15:19   ` [bug#35244] [PATCH 1/6] gnu: bash-completion: Fix cross-compilation Ludovic Courtès
2019-06-25 19:42     ` Mathieu Othacehe
2019-06-26  8:19 ` [bug#35244] [PATCH] gnu: perl: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).