Add Guix System cross-compilation support

  • Done
  • quality assurance status badge
Details
6 participants
  • Efraim Flashner
  • Ludovic Courtès
  • Mathieu Othacehe
  • Pierre Neidhardt
  • Marius Bakke
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Mathieu Othacehe
Severity
normal
M
M
Mathieu Othacehe wrote on 2 Jul 2019 17:18
(address . guix-patches@gnu.org)
87zhlwmpmy.fsf@gmail.com
Hey Guix,

I'm currently working on adding --target support to guix system
command. The main obstacle is that cross-compilation is broken on many
packages because of small errors in package definitions (inputs vs
native-inputs).

I created a branch on savannah called "wip-cross-system" to centralize
this work. Feel free to have a look / review some of the patches there!

Thanks,

Mathieu
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 00/31] Fix cross-compilation issues
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-1-m.othacehe@gmail.com
Hello,

Here's a batch of cross-compilation related patches. They can be seen on
wip-cross-system branch of savannah. Some of them cause mass-rebuilds so I
guess this serie is targeting core-updates.

Thanks,

Mathieu

Mathieu Othacehe (30):
gnu: perl: Fix cross-compilation.
gnu: python: Fix cross compilation.
gnu: tcl: Fix cross-compilation.
gnu: tk: Fix cross-compilation.
gnu: libxslt: Fix cross-compilation.
gnu: xorg: Fix cross-compilation of multiple packages.
gnu: libgpg-error: Fix cross compilation.
gnu: python: Fix cross-compilation.
gnu: http-parser: Fix cross-compilation.
gnu: openssl: Fix cross-compilation.
gnu: texinfo: Fix cross-compilation.
gnu: cmake: Extend CMAKE_PREFIX_PATH to non-native inputs.
gnu: libgit2: Fix cross compilation.
gnu: ath9k-htc-firmware: Fix cross compilation.
gnu: libpaper: Fix aarch64 cross-compilation.
gnu: groff: Fix cross compilation.
gnu: bc: Fix cross-compilation.
gnu: indent: Fix aarch64 cross-compilation.
gnu: libsamplerate: Fix aarch64 cross-compilation.
gnu: mit-krb5: Fix cross-compilation.
gnu: cyrus-sasl: Fix cross-compilation.
gnu: help2man: Fix cross-compilation.
gnu: xmlto: Fix cross-compilation.
gnu: libarchive: Fix cross-compilation.
gnu: tcsh: Fix cross-compilation.
gnu: pkg-config: Fix cross-compilation.
gnu: mkfontdir: Fix aarch64 cross-compilation.
gnu: alsa-utils: Fix cross-compilation.
gnu: icu4c: Fix cross-compilation.
gnu: glibc-utf8-locales: Fix cross-compilation.

Pierre-Moana Levesque (1):
gnu: texinfo-5: Fix cross-compilation.

gnu/local.mk | 3 +
gnu/packages/algebra.scm | 15 +-
gnu/packages/backup.scm | 31 ++--
gnu/packages/base.scm | 4 +-
gnu/packages/cmake.scm | 2 +-
gnu/packages/code.scm | 21 ++-
gnu/packages/commencement.scm | 11 +-
gnu/packages/cyrus-sasl.scm | 17 +-
gnu/packages/firmware.scm | 5 +-
gnu/packages/ghostscript.scm | 19 ++
gnu/packages/gnupg.scm | 22 +++
gnu/packages/groff.scm | 40 +++-
gnu/packages/icu4c.scm | 33 +++-
gnu/packages/kerberos.scm | 23 ++-
gnu/packages/linux.scm | 7 +-
gnu/packages/man.scm | 2 +-
.../patches/bc-fix-cross-compilation.patch | 171 ++++++++++++++++++
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++
.../patches/python-2.7-search-paths.patch | 10 +-
.../patches/python-3-search-paths.patch | 11 +-
.../patches/python-cross-compile.patch | 145 +++++++++++++++
gnu/packages/perl.scm | 7 +-
gnu/packages/pkg-config.scm | 11 +-
gnu/packages/pulseaudio.scm | 22 ++-
gnu/packages/python.scm | 40 +++-
gnu/packages/shells.scm | 9 +
gnu/packages/tcl.scm | 28 ++-
gnu/packages/texinfo.scm | 28 ++-
gnu/packages/tls.scm | 59 ++++--
gnu/packages/version-control.scm | 16 +-
gnu/packages/web.scm | 13 +-
gnu/packages/xml.scm | 7 +-
gnu/packages/xorg.scm | 44 ++++-
33 files changed, 794 insertions(+), 94 deletions(-)
create mode 100644 gnu/packages/patches/bc-fix-cross-compilation.patch
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
create mode 100644 gnu/packages/patches/python-cross-compile.patch

--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 01/31] gnu: perl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-2-m.othacehe@gmail.com
* 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(-)

Toggle diff (34 lines)
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
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 02/31] gnu: python: Fix cross compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-3-m.othacehe@gmail.com
* gnu/packages/python.scm (python-2.7)[arguments]: Add a configure flag to
disable a check failing when cross-compiling. This is covered here:
[native-inputs]: Add self and which when cross-compiling,
(python-3.7)[arguments]: Refer to native python when cross-compiling.
---
gnu/packages/python.scm | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)

Toggle diff (75 lines)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index aa92e82ac2..1a8cd39de2 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>
@@ -76,6 +76,7 @@
(define-module (gnu packages python)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages dbm)
@@ -134,6 +135,13 @@
"--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
+ ,@(if (%current-target-system)
+ '("ac_cv_buggy_getaddrinfo=no"
+ "ac_cv_file__dev_ptmx=no"
+ "ac_cv_file__dev_ptc=no")
+ '())
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out") "/lib"))
@@ -246,7 +254,12 @@
("tcl" ,tcl)
("tk" ,tk))) ; for tkinter
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ;; When cross-compiling, a native version of Python itself is needed.
+ ,@(if (%current-target-system)
+ `(("self" ,this-package)
+ ("which" ,which))
+ '())))
(native-search-paths
(list (search-path-specification
(variable "PYTHONPATH")
@@ -342,13 +355,16 @@ data types.")
(if (null? opt) "none" (car opt)))
(for-each (lambda (file)
(apply invoke
- `(,(string-append out "/bin/python3")
- ,@opt
- "-m" "compileall"
- "-f" ; force rebuild
- ;; Don't build lib2to3, because it's Python 2 code.
- "-x" "lib2to3/.*"
- ,file)))
+ `(,,(if (%current-target-system)
+ "python3"
+ '(string-append out
+ "/bin/python3"))
+ ,@opt
+ "-m" "compileall"
+ "-f" ; force rebuild
+ ;; Don't build lib2to3, because it's Python 2 code.
+ "-x" "lib2to3/.*"
+ ,file)))
(find-files out "\\.py$")))
(list '() '("-O") '("-OO")))
#t)))))))
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 03/31] gnu: tcl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-4-m.othacehe@gmail.com
* gnu/packages/tcl.scm (tcl)[arguments]: Add configure flags to fix
cross-compilation.
---
gnu/packages/tcl.scm | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

Toggle diff (35 lines)
diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index 4840ac4e10..fc955cf649 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -53,7 +53,7 @@
"0sprsg7wnraa4cbwgbcliylm6p0rspfymxn8ww02pr4ca70v0g64"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
+ `(#:phases (modify-phases %standard-phases
(add-before 'configure 'pre-configure
(lambda _ (chdir "unix") #t))
(add-after 'install 'install-private-headers
@@ -73,9 +73,16 @@
;; PREFIX/share/man. The 'validate-documentation-location' phase is
;; not able to fix this up because the default install populates both
;; PREFIX/man and PREFIX/share/man.
- #:configure-flags (list (string-append "--mandir="
- (assoc-ref %outputs "out")
- "/share/man"))
+ #:configure-flags
+ (list (string-append "--mandir="
+ (assoc-ref %outputs "out")
+ "/share/man")
+ ;; This is needed when cross-compiling, see:
+ ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
+ ,@(if (%current-target-system)
+ '("tcl_cv_strtod_buggy=1"
+ "ac_cv_func_strtod=yes")
+ '()))
;; XXX: There are a few test failures (related to HTTP, most
;; likely related to name resolution), but that doesn't cause
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 04/31] gnu: tk: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-5-m.othacehe@gmail.com
* gnu/packages/tcl.scm (tk)[arguments]: Add configure flags to fix
cross-compilation.
---
gnu/packages/tcl.scm | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index fc955cf649..df0f0e3a5c 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -185,9 +185,16 @@ X11 GUIs.")
"/lib -lfontconfig")))
#t))))
- #:configure-flags (list (string-append "--with-tcl="
- (assoc-ref %build-inputs "tcl")
- "/lib"))
+ #:configure-flags
+ (list (string-append "--with-tcl="
+ (assoc-ref %build-inputs "tcl")
+ "/lib")
+ ;; This is needed when cross-compiling, see:
+ ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
+ ,@(if (%current-target-system)
+ '("tcl_cv_strtod_buggy=1"
+ "ac_cv_func_strtod=yes")
+ '()))
;; The tests require a running X server, so we just skip them.
#:tests? #f))
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 05/31] gnu: libxslt: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-6-m.othacehe@gmail.com
* gnu/packages/xml.scm (libxslt)[native-inputs]: Add pkg-config.
---
gnu/packages/xml.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index fc60758724..5fefa2c1dc 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -201,6 +201,8 @@ project (but it is usable outside of the Gnome platform).")
("libxml2" ,libxml2)
("python" ,python-minimal-wrapper)
("zlib" ,zlib)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
(description
"Libxslt is an XSLT C library developed for the GNOME project. It is
based on libxml for XML parsing, tree manipulation and XPath support.")
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 06/31] gnu: xorg: Fix cross-compilation of multiple packages.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-7-m.othacehe@gmail.com
* gnu/packages/xorg.scm (libxext)[arguments]: Disable zero malloc check that
fails when cross-compiling,
(libxrender)[arguments]: ditto,
(libx11)[arguments]: ditto.
---
gnu/packages/xorg.scm | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 9577c4d2c6..e35e8be72f 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -4546,6 +4546,13 @@ cannot be adequately worked around on the client side of the wire.")
(base32
"0dbfn5bznnrhqzvkrcmw4c44yvvpwdcsrvzxf4rk27r36b9x865m"))))
(build-system gnu-build-system)
+ ;; Disable zero malloc check that fails when cross-compiling.
+ (arguments
+ `(#:configure-flags
+ (list
+ ,@(if (%current-target-system)
+ '("--disable-malloc0returnsnull")
+ '()))))
(propagated-inputs
`(("xorgproto" ,xorgproto)))
(inputs
@@ -4631,6 +4638,13 @@ cannot be adequately worked around on the client side of the wire.")
(base32
"0j89cnb06g8x79wmmnwzykgkkfdhin9j7hjpvsxwlr3fz1wmjvf0"))))
(build-system gnu-build-system)
+ ;; Disable zero malloc check that fails when cross-compiling.
+ (arguments
+ `(#:configure-flags
+ (list
+ ,@(if (%current-target-system)
+ '("--disable-malloc0returnsnull")
+ '()))))
(propagated-inputs
`(("xorgproto" ,xorgproto)))
(inputs
@@ -5248,9 +5262,14 @@ draggable titlebars and borders.")
(outputs '("out"
"doc")) ;8 MiB of man pages + XML
(arguments
- '(#:configure-flags (list (string-append "--mandir="
- (assoc-ref %outputs "doc")
- "/share/man"))))
+ `(#:configure-flags
+ (list (string-append "--mandir="
+ (assoc-ref %outputs "doc")
+ "/share/man")
+ ;; Disable zero malloc check that fails when cross-compiling.
+ ,@(if (%current-target-system)
+ '("--disable-malloc0returnsnull")
+ '()))))
(propagated-inputs
`(("xorgproto" ,xorgproto)
("libxcb" ,libxcb)))
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 07/31] gnu: libgpg-error: Fix cross compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-8-m.othacehe@gmail.com
* gnu/packages/gnupg.scm (libgpg-error)[arguments]: Add a lock-obj header to
the target platform when cross-compiling,
[native-inputs]: add gettext that is needed when cross-compiling.
---
gnu/packages/gnupg.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index f84f8d73a0..68e8270206 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -15,6 +15,7 @@
;;; Copyright © 2017 Petter <petter@mykolab.ch>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -86,6 +87,27 @@
(base32
"1jj08ns4sh1hmafqp1giskvdicdz18la516va26jycy27kkwaif3"))))
(build-system gnu-build-system)
+ (arguments
+ (if (%current-target-system)
+ `(#:modules ((ice-9 match)
+ (guix build gnu-build-system)
+ (guix build utils))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'cross-symlinks
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((target ,(%current-target-system))
+ (tuple
+ (match (string-take target (string-index target #\-))
+ ("armhf" "arm-unknown-linux-gnueabi")
+ (x
+ (string-append x "-unknown-linux-gnu")))))
+ (symlink
+ (string-append "lock-obj-pub." tuple ".h")
+ "src/syscfg/lock-obj-pub.linux-gnu.h"))
+ #t))))
+ '()))
+ (native-inputs `(("gettext" ,gettext-minimal)))
(home-page "https://gnupg.org")
(synopsis "Library of error values for GnuPG components")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 09/31] gnu: http-parser: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-10-m.othacehe@gmail.com
* gnu/packages/web.scm (http-parser)[arguments]: Set CC and AR variables in
Makefile in order to fix cross-compilation.
---
gnu/packages/web.scm | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

Toggle diff (35 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 1d9190ef63..589997e832 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -33,6 +33,7 @@
;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2019 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5171,10 +5172,18 @@ into your tests. It automatically starts up a HTTP server in a separate thread
#:make-flags
(list (string-append "PREFIX="
(assoc-ref %outputs "out"))
- "CC=gcc" "library")
+ "library")
#:phases
(modify-phases %standard-phases
- (delete 'configure))))
+ (replace 'configure
+ (lambda* (#:key target #:allow-other-keys)
+ (when ,(%current-target-system)
+ (substitute* (find-files "." "Makefile")
+ (("CC\\?=.*$")
+ (string-append "CC=" target "-gcc\n"))
+ (("AR\\?=.*$")
+ (string-append "AR=" target "-ar\n"))))
+ #t)))))
(synopsis "HTTP request/response parser for C")
(description "This is a parser for HTTP messages written in C. It parses
both requests and responses. The parser is designed to be used in
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 08/31] gnu: python: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-9-m.othacehe@gmail.com
* gnu/packages/patches/python-2.7-search-paths.patch: Add cross-compilation
support.
* gnu/packages/patches/python-3-search-paths.patch: Ditto.
* gnu/packages/patches/python-cross-compile.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add above new patch.
* gnu/packages/python.scm (python-2.7)[patches]: Add new patch above,
[arguments]: Set _PYTHON_HOST_PLATFORM env variable when cross compiling.
---
gnu/local.mk | 1 +
.../patches/python-2.7-search-paths.patch | 10 +-
.../patches/python-3-search-paths.patch | 11 +-
.../patches/python-cross-compile.patch | 145 ++++++++++++++++++
gnu/packages/python.scm | 6 +-
5 files changed, 168 insertions(+), 5 deletions(-)
create mode 100644 gnu/packages/patches/python-cross-compile.patch

Toggle diff (240 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 8be4d74dce..7d42202485 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1208,6 +1208,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-CVE-2018-14647.patch \
%D%/packages/patches/python-axolotl-AES-fix.patch \
%D%/packages/patches/python-cairocffi-dlopen-path.patch \
+ %D%/packages/patches/python-cross-compile.patch \
%D%/packages/patches/python-cffi-x87-stack-clean.patch \
%D%/packages/patches/python-fix-tests.patch \
%D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \
diff --git a/gnu/packages/patches/python-2.7-search-paths.patch b/gnu/packages/patches/python-2.7-search-paths.patch
index ba7235df27..6457819b8a 100644
--- a/gnu/packages/patches/python-2.7-search-paths.patch
+++ b/gnu/packages/patches/python-2.7-search-paths.patch
@@ -3,13 +3,17 @@ looking for headers and libraries.
--- Python-2.7.10/setup.py 2015-10-07 18:33:18.125153186 +0200
+++ Python-2.7.10/setup.py 2015-10-07 18:33:47.497347552 +0200
-@@ -526,6 +526,10 @@ class PyBuildExt(build_ext):
+@@ -526,6 +526,14 @@ class PyBuildExt(build_ext):
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ # Always honor these variables.
-+ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
++ if not cross_compiling:
++ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
++ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
++ else:
++ lib_dirs = os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep)
++ inc_dirs = os.getenv('CROSS_C_INCLUDE_PATH', '').split(os.pathsep)
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if host_platform in ['osf1', 'unixware7', 'openunix8']:
diff --git a/gnu/packages/patches/python-3-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch
index 73e3f4ccf5..70e6109f18 100644
--- a/gnu/packages/patches/python-3-search-paths.patch
+++ b/gnu/packages/patches/python-3-search-paths.patch
@@ -3,7 +3,7 @@ looking for headers and libraries.
--- setup.py 2015-10-07 23:32:58.891329173 +0200
+++ setup.py 2015-10-07 23:46:29.653349924 +0200
-@@ -575,8 +575,8 @@
+@@ -600,15 +600,15 @@
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
if not cross_compiling:
@@ -14,3 +14,12 @@ looking for headers and libraries.
else:
# Add the sysroot paths. 'sysroot' is a compiler option used to
# set the logical path of the standard system headers and
+ # libraries.
+- lib_dirs = (self.compiler.library_dirs +
++ lib_dirs = (os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep) +
+ sysroot_paths(('LDFLAGS', 'CC'), system_lib_dirs))
+- inc_dirs = (self.compiler.include_dirs +
++ inc_dirs = (os.getenv('CROSS_C_INCLUDE_PATH', '').split(os.pathsep) +
+ sysroot_paths(('CPPFLAGS', 'CFLAGS', 'CC'),
+ system_include_dirs))
+ exts = []
diff --git a/gnu/packages/patches/python-cross-compile.patch b/gnu/packages/patches/python-cross-compile.patch
new file mode 100644
index 0000000000..5a470e1852
--- /dev/null
+++ b/gnu/packages/patches/python-cross-compile.patch
@@ -0,0 +1,145 @@
+Patch taken from https://bugs.python.org/issue22724 and augmented with
+following Nix patch
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/python/cpython/2.7/cross-compile.patch
+to fix the whole cross-compilation circus.
+
+---
+ Makefile.pre.in | 14 +++++++-------
+ configure | 5 ++++-
+ setup.py | 9 ++++++---
+ 3 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 2a14f3323b..6239fc32fc 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -492,7 +492,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
+ platform: $(BUILDPYTHON) pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+@@ -503,7 +503,7 @@ platform: $(BUILDPYTHON) pybuilddir.txt
+ # or removed in case of failure.
+ pybuilddir.txt: $(BUILDPYTHON)
+ @echo "none" > ./pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
+ if test $$? -ne 0 ; then \
+ echo "generate-posix-vars failed" ; \
+ rm -f ./pybuilddir.txt ; \
+@@ -525,7 +525,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ esac; \
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
++ $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+
+ # Build static library
+ # avoid long command lines, same as LIBRARY_OBJS
+@@ -928,7 +928,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKI
+ upgrade) ensurepip="--upgrade" ;; \
+ install|*) ensurepip="" ;; \
+ esac; \
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+@@ -939,7 +939,7 @@ altinstall: commoninstall
+ upgrade) ensurepip="--altinstall --upgrade --no-default-pip" ;; \
+ install|*) ensurepip="--altinstall --no-default-pip" ;; \
+ esac; \
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+@@ -1270,7 +1270,7 @@ libainstall: @DEF_MAKE_RULE@ python-config
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
+ sharedinstall: sharedmods
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+@@ -1344,7 +1344,7 @@ frameworkinstallextras:
+ # This installs a few of the useful scripts in Tools/scripts
+ scriptsinstall:
+ SRCDIR=$(srcdir) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
++ $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --root=$(DESTDIR)/
+diff --git a/configure b/configure
+index 67300fe2b6..6050f588c5 100755
+--- a/configure
++++ b/configure
+@@ -741,6 +741,7 @@ CONFIG_ARGS
+ SOVERSION
+ VERSION
+ PYTHON_FOR_BUILD
++PY_BUILD_ENVIRON
+ PYTHON_FOR_REGEN
+ host_os
+ host_vendor
+@@ -2964,7 +2965,8 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
+ $as_echo "$interp" >&6; }
+- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++ PY_BUILD_ENVIRON='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR)'
++ PYTHON_FOR_BUILD=$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
+@@ -2974,6 +2976,7 @@ fi
+
+
+
++
+ if test "$prefix" != "/"; then
+ prefix=`echo "$prefix" | sed -e 's/\/$//g'`
+ fi
+diff --git a/setup.py b/setup.py
+index cb47a2339c..472e7e2b26 100644
+--- a/setup.py
++++ b/setup.py
+@@ -497,8 +497,6 @@ class PyBuildExt(build_ext):
+ if not cross_compiling:
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+- if cross_compiling:
+- self.add_gcc_paths()
+ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -556,7 +554,10 @@ class PyBuildExt(build_ext):
+ # be assumed that no additional -I,-L directives are needed.
+ inc_dirs = self.compiler.include_dirs[:]
+ lib_dirs = self.compiler.library_dirs[:]
+- if not cross_compiling:
++ if cross_compiling:
++ inc_dirs = []
++ lib_dirs = []
++ else:
+ for d in (
+ '/usr/include',
+ ):
+@@ -621,6 +622,8 @@ class PyBuildExt(build_ext):
+ # Some modules that are normally always on:
+ #exts.append( Extension('_weakref', ['_weakref.c']) )
+
++ self.compiler.library_dirs = lib_dirs + [ '.' ]
++
+ # array objects
+ exts.append( Extension('array', ['arraymodule.c']) )
+
+--
+2.17.1
+
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 1a8cd39de2..724260dabf 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -109,7 +109,8 @@
"python-2-deterministic-build-info.patch"
"python-2.7-site-prefixes.patch"
"python-2.7-source-date-epoch.patch"
- "python-2.7-adjust-tests.patch"))
+ "python-2.7-adjust-tests.patch"
+ "python-cross-compile.patch"))
(modules '((guix build utils)))
;; suboptimal to delete failing tests here, but if we delete them in the
;; arguments then we need to make sure to strip out that phase when it
@@ -152,6 +153,9 @@
(add-before
'configure 'patch-lib-shells
(lambda _
+ ,@(if (%current-target-system)
+ '((setenv "_PYTHON_HOST_PLATFORM" ""))
+ '())
;; Filter for existing files, since some may not exist in all
;; versions of python that are built with this recipe.
(substitute* (filter file-exists?
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 10/31] gnu: openssl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-11-m.othacehe@gmail.com
* gnu/packages/tls.scm (openssl-next)[arguments]: Pass CROSS_COMPILE
environment variable and target system to configure script.
---
gnu/packages/tls.scm | 59 +++++++++++++++++++++++++++++++++-----------
1 file changed, 45 insertions(+), 14 deletions(-)

Toggle diff (98 lines)
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 8e20101e51..4e269bcc8c 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -310,11 +311,31 @@ required structures.")
(("^MANDIR[[:blank:]]*=.*$")
(string-append "MANDIR = " out "/share/man\n")))
#t)))
+ ,@(if (%current-target-system)
+ '((add-before
+ 'configure 'set-cross-compile
+ (lambda* (#:key target outputs #:allow-other-keys)
+ (setenv "CROSS_COMPILE" (string-append target "-"))
+ (setenv "CONFIGURE_TARGET_ARCH"
+ (cond
+ ((string-prefix? "i686" target)
+ "linux-x86")
+ ((string-prefix? "x86_64" target)
+ "linux-x86_64")
+ ((string-prefix? "armhf" target)
+ "linux-armv4")
+ ((string-prefix? "aarch64" target)
+ "linux-aarch64")))
+ #t)))
+ '())
(replace
'configure
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
- (invoke "./config"
+ (invoke
+ ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
"shared" ;build shared libraries
"--libdir=lib"
@@ -323,8 +344,11 @@ required structures.")
;; conventional.
(string-append "--openssldir=" out
"/share/openssl-" ,version)
+ (string-append "--prefix=" out)
- (string-append "--prefix=" out)))))
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(add-after
'install 'make-libraries-writable
(lambda* (#:key outputs #:allow-other-keys)
@@ -444,18 +468,25 @@ required structures.")
(("/usr/bin/env")
(string-append (assoc-ref %build-inputs "coreutils")
"/bin/env")))
- (invoke "./config"
- "shared" ;build shared libraries
- "--libdir=lib"
-
- ;; The default for this catch-all directory is
- ;; PREFIX/ssl. Change that to something more
- ;; conventional.
- (string-append "--openssldir=" out
- "/share/openssl-" ,version)
-
- (string-append "--prefix=" out)
- (string-append "-Wl,-rpath," lib)))))
+ (invoke
+ ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
+ "shared" ;build shared libraries
+ "--libdir=lib"
+
+ ;; The default for this catch-all directory is
+ ;; PREFIX/ssl. Change that to something more
+ ;; conventional.
+ (string-append "--openssldir=" out
+ "/share/openssl-" ,version)
+
+ (string-append "--prefix=" out)
+ (string-append "-Wl,-rpath," lib)
+
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(delete 'move-man3-pages)
(add-after 'install 'move-extra-documentation
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 11/31] gnu: texinfo: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-12-m.othacehe@gmail.com
* gnu/packages/texinfo.scm (texinfo)[arguments]: Do not reset environment
before running configure with the native compiler, in a cross-compilation
context,
[inputs]: move perl from here ...
[native-inputs]: ... to here. Also add ncurses that is needed in a
cross-compilation context to build texinfo native tools.
---
gnu/packages/texinfo.scm | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index fa98bd56b8..36bb9132d9 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -42,8 +42,28 @@
(base32
"0qjzvbvnv9003xdrcpi3jp7y68j4hq2ciw9frh2hghh698zlnxvp"))))
(build-system gnu-build-system)
- (inputs `(("ncurses" ,ncurses)
- ("perl" ,perl)))
+ (arguments
+ ;; When cross-compiling, the package is configured twice: once with the
+ ;; native compiler and once with the cross-compiler. During the configure
+ ;; with the native compiler, the environment is reset. This leads to
+ ;; multiple environment variables missing. Do not reset the environment
+ ;; to prevent that.
+ `(,@(if (%current-target-system)
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'fix-cross-configure
+ (lambda _
+ (substitute* "configure"
+ (("env -i")
+ "env "))
+ #t))))
+ '())))
+ (inputs `(("ncurses" ,ncurses)))
+ ;; When cross-compiling, texinfo will build some of it's own binaries with
+ ;; the native compiler. This means ncurses is needed both in both inputs
+ ;; and native-inputs.
+ (native-inputs `(("perl" ,perl)
+ ("ncurses" ,ncurses)))
(native-search-paths
;; This is the variable used by the standalone Info reader.
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 12/31] gnu: cmake: Extend CMAKE_PREFIX_PATH to non-native inputs.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-13-m.othacehe@gmail.com
* gnu/packages/cmake.scm (cmake)[native-search-paths]: Turn to search-paths.
This allows libraries using cmake functions "find_file" or "find_library" to
search in non-native inputs while cross-compiling.
---
gnu/packages/cmake.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 7186cf98df..3969d309af 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -147,7 +147,7 @@
("ncurses" ,ncurses) ; required for ccmake
("rhash" ,rhash)
("zlib" ,zlib)))
- (native-search-paths
+ (search-paths
(list (search-path-specification
(variable "CMAKE_PREFIX_PATH")
(files '("")))))
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 13/31] gnu: libgit2: Fix cross compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-14-m.othacehe@gmail.com
* gnu/packages/version-control.scm (libgit2)[arguments]: Set
PKG_CONFIG_EXECUTABLE variable when cross-compiling.
Also do not run test suite if cross-compiling.
---
gnu/packages/version-control.scm | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 8effe1d502..ca5a019105 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -545,7 +545,14 @@ everything from small to very large projects with speed and efficiency.")
(build-system cmake-build-system)
(outputs '("out" "debug"))
(arguments
- `(#:configure-flags '("-DUSE_SHA1DC=ON") ; SHA-1 collision detection
+ `(#:configure-flags
+ (list "-DUSE_SHA1DC=ON" ; SHA-1 collision detection
+ ,@(if (%current-target-system)
+ `((string-append
+ "-DPKG_CONFIG_EXECUTABLE="
+ (assoc-ref %build-inputs "pkg-config")
+ "/bin/" ,(%current-target-system) "-pkg-config"))
+ '()))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fix-hardcoded-paths
@@ -560,9 +567,12 @@ everything from small to very large projects with speed and efficiency.")
(lambda _
(for-each make-file-writable (find-files "."))
#t))
- ;; Run checks more verbosely.
+ ;; Run checks more verbosely, unless we are cross-compiling.
(replace 'check
- (lambda _ (invoke "./libgit2_clar" "-v" "-Q"))))))
+ (lambda _
+ ,@(if (%current-target-system)
+ '(#t)
+ '((invoke "./libgit2_clar" "-v" "-Q"))))))))
(inputs
`(("libssh2" ,libssh2)
("http-parser" ,http-parser)))
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 14/31] gnu: ath9k-htc-firmware: Fix cross compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-15-m.othacehe@gmail.com
* gnu/packages/firmware.scm (ath9k-htc-firmware)[phases]: Search for
"cross-gcc" in native-inputs and inputs in "configure" phase.
---
gnu/packages/firmware.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 90cb8845cf..e72a8d2cbd 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 inputs 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 (or native-inputs inputs) "cross-gcc")
"\n")))
#t))
(replace 'install
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 15/31] gnu: libpaper: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-16-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/ghostscript.scm (libpaper)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/ghostscript.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index 53a9b60fdb..ad035170a2 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -91,6 +92,24 @@ Consortium standard (ICC), approved as ISO 15076-1.")
(sha256 (base32
"0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (for-each (lambda (file)
+ (install-file
+ (string-append (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess"))
+ #t)))))
(synopsis "Library for handling paper sizes")
(description
"The paper library and accompanying files are intended to provide a simple
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 16/31] gnu: groff: Fix cross compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-17-m.othacehe@gmail.com
* 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 a native-input when cross-compiling.
---
gnu/packages/groff.scm | 40 +++++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)

Toggle diff (74 lines)
diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm
index cf392f5468..27f796eb98 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.
;;;
@@ -54,7 +55,13 @@
;; from 'inputs'.
(inputs `(("ghostscript" ,ghostscript)))
- (native-inputs `(("bison" ,bison)
+
+ ;; When cross-compiling, this package depends upon a native install of
+ ;; itself.
+ (native-inputs `(,@(if (%current-target-system)
+ `(("self" ,this-package))
+ '())
+ ("bison" ,bison)
("perl" ,perl)
("psutils" ,psutils)
("texinfo" ,texinfo)))
@@ -65,7 +72,33 @@
(add-after 'unpack 'setenv
(lambda _
(setenv "GS_GENERATE_UUIDS" "0")
- #t)))))
+ #t))
+ ,@(if (%current-target-system)
+ '((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 +119,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
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:58
[PATCH 17/31] gnu: texinfo-5: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Pierre-Moana Levesque)(address . pierre.moana.levesque@gmail.com)
20190708095913.3460-18-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/texinfo.scm (texinfo-5)[native-inputs]: Keep
native-inputs from inherited package texinfo.
---
gnu/packages/texinfo.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index 36bb9132d9..9ec6685d68 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -92,8 +93,7 @@ is on expressing the content semantically, avoiding physical markup commands.")
(patches (search-patches "texinfo-5-perl-compat.patch"))
(sha256
(base32
- "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))
- (native-inputs '())))
+ "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))))
(define-public texinfo-4
(package (inherit texinfo)
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 19/31] gnu: indent: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-20-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/code.scm (indent)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
(indent-2.2.12)[native-inputs]: Inherit from indent native-inputs to keep
automake that is added above.
---
gnu/packages/code.scm | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)

Toggle diff (55 lines)
diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index c5dfa4aa7a..22111f7b09 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -29,6 +29,7 @@
(define-module (gnu packages code)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
@@ -634,6 +635,8 @@ the C, C++, C++/CLI, Objective?C, C#, and Java programming languages.")
(sha256 (base32
"0f9655vqdvfwbxvs1gpa7py8k1z71aqh8hp73f65vazwbfz436wa"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
(arguments
`(#:phases
(modify-phases %standard-phases
@@ -644,6 +647,20 @@ the C, C++, C++/CLI, Objective?C, C#, and Java programming languages.")
;; overrides this to be in PREFIX/doc. Fix this.
(substitute* "doc/Makefile.in"
(("^docdir = .*$") "docdir = @docdir@\n"))
+ #t))
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "config"
+ (for-each (lambda (file)
+ (install-file
+ (string-append (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
#t)))))
(synopsis "Code reformatter")
(description
@@ -666,7 +683,9 @@ extensions over the standard utility.")
(sha256
(base32
"12xvcd16cwilzglv9h7sgh4h1qqjd1h8s48ji2dla58m4706hzg7"))))
- (native-inputs `(("texinfo" ,texinfo)))))
+ (native-inputs
+ `(("texinfo" ,texinfo)
+ ,@(package-native-inputs indent)))))
(define-public amalgamate
(let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208")
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 20/31] gnu: libsamplerate: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-21-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/pulseaudio.scm (libsamplerate)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/pulseaudio.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm
index 96d15bdf9c..7c91ec201a 100644
--- a/gnu/packages/pulseaudio.scm
+++ b/gnu/packages/pulseaudio.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -27,6 +28,7 @@
(define-module (gnu packages pulseaudio)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix utils)
#:use-module ((guix licenses) #:prefix l:)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
@@ -96,10 +98,28 @@ for reading and writing new sound file formats.")
"1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
(build-system gnu-build-system)
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
(propagated-inputs
`(("libsndfile" ,libsndfile)
("fftw" ,fftw)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "Cfg"
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t)))))
(home-page "http://www.mega-nerd.com/SRC/index.html")
(synopsis "Audio sample rate conversion library")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 21/31] gnu: mit-krb5: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-22-m.othacehe@gmail.com
* gnu/packages/kerberos.scm (mit-krb5)[arguments]: Disable tests when
cross-compiling. Add cross-compilation specific configure-flags and
make-flags. Search for perl in native-inputs or inputs.
---
gnu/packages/kerberos.scm | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/packages/kerberos.scm b/gnu/packages/kerberos.scm
index 873f5d8a37..8be4bd1ccc 100644
--- a/gnu/packages/kerberos.scm
+++ b/gnu/packages/kerberos.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -68,9 +69,23 @@
("perl" ,perl)))
(arguments
`(;; XXX: On 32-bit systems, 'kdb5_util' hangs on an fcntl/F_SETLKW call
- ;; while running the tests in 'src/tests'.
- #:tests? ,(string=? (%current-system) "x86_64-linux")
+ ;; while running the tests in 'src/tests'. Also disable tests when
+ ;; cross-compiling.
+ #:tests? ,(and (not (%current-target-system))
+ (string=? (%current-system) "x86_64-linux"))
+ #:configure-flags
+ (list ,@(if (%current-target-system)
+ '("krb5_cv_attr_constructor_destructor=yes"
+ "ac_cv_func_regcomp=yes"
+ "ac_cv_printf_positional=yes"
+ "ac_cv_file__etc_environment=yes"
+ "ac_cv_file__etc_TIMEZONE=no")
+ '()))
+ #:make-flags
+ (list ,@(if (%current-target-system)
+ '("CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1")
+ '()))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'enter-source-directory
@@ -78,8 +93,8 @@
(chdir "src")
#t))
(add-before 'check 'pre-check
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((perl (assoc-ref inputs "perl")))
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (let ((perl (assoc-ref (or native-inputs inputs) "perl")))
(substitute* "plugins/kdb/db2/libdb2/test/run.test"
(("/bin/cat") (string-append perl "/bin/perl"))
(("D/bin/sh") (string-append "D" (which "sh")))
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 23/31] gnu: help2man: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-24-m.othacehe@gmail.com
* gnu/packages/man.scm (help2man)[inputs]: Turn into ...
[native-inputs]: ... that.
---
gnu/packages/man.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index 04c800e95f..6b5de3d033 100644
--- a/gnu/packages/man.scm
+++ b/gnu/packages/man.scm
@@ -210,7 +210,7 @@ Linux kernel and C library interfaces employed by user-space programs.")
(build-system gnu-build-system)
(arguments `(;; There's no `check' target.
#:tests? #f))
- (inputs
+ (native-inputs
`(("perl" ,perl)
;; TODO: Add these optional dependencies.
;; ("perl-LocaleGettext" ,perl-LocaleGettext)
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 22/31] gnu: cyrus-sasl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-23-m.othacehe@gmail.com
* gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/cyrus-sasl.scm (cyrus-sasl)[origin]: Apply it.
[native-tools]: Add autoconf, automake and libtool.
[arguments]: Run autoconf to apply m4 modification in patch above.
---
gnu/local.mk | 1 +
gnu/packages/cyrus-sasl.scm | 17 +++++++++++++++--
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch

Toggle diff (82 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index e22f8af3cc..d5cd00c0ed 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -740,6 +740,7 @@ dist_patch_DATA = \
%D%/packages/patches/cube-nocheck.patch \
%D%/packages/patches/cursynth-wave-rand.patch \
%D%/packages/patches/cvs-2017-12836.patch \
+ %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch \
%D%/packages/patches/dbus-helper-search-path.patch \
%D%/packages/patches/dbus-CVE-2019-12749.patch \
%D%/packages/patches/dealii-mpi-deprecations.patch \
diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm
index f84136e631..3e65a1faf6 100644
--- a/gnu/packages/cyrus-sasl.scm
+++ b/gnu/packages/cyrus-sasl.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,6 +21,7 @@
(define-module (gnu packages cyrus-sasl)
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages dbm)
#:use-module (gnu packages kerberos)
#:use-module (gnu packages tls)
@@ -41,8 +43,13 @@
"ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-"
version ".tar.gz")))
(sha256 (base32
- "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))))
+ "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))
+ (patches (search-patches "cyrus-sasl-ac-try-run-fix.patch"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
(inputs `(("gdbm" ,gdbm)
("openssl" ,openssl)))
(propagated-inputs
@@ -57,7 +64,13 @@
;; 'plugin_common.c'. When building the shared libraries there, libtool
;; ends up doing "ln -s plugin_common.lo plugin_common.o", which can
;; fail with EEXIST when building things in parallel.
- #:parallel-build? #f))
+ #:parallel-build? #f
+
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'autogen
+ (lambda _
+ (invoke "autoreconf" "-vif"))))))
(synopsis "Simple Authentication Security Layer implementation")
(description
"SASL (Simple Authentication Security Layer) is an Internet
diff --git a/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
new file mode 100644
index 0000000000..8662e812e9
--- /dev/null
+++ b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
@@ -0,0 +1,12 @@
+--- a/m4/sasl2.m4 2018-11-18 22:33:29.902625600 +0300
++++ b/m4/sasl2.m4 2018-11-18 22:33:59.828746176 +0300
+@@ -339,7 +339,8 @@
+ ],
+ [ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
+ AC_MSG_RESULT(yes) ],
+- AC_MSG_RESULT(no))
++ AC_MSG_RESULT(no),
++ AC_MSG_RESULT(no))
+ LIBS="$cmu_save_LIBS"
+
+ else
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 24/31] gnu: xmlto: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-25-m.othacehe@gmail.com
* gnu/packages/xml.scm (xmlto)[inputs]: Move util-linux from here ...
[native-inputs]: ... to here.
---
gnu/packages/xml.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 5fefa2c1dc..5239070b1c 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -915,9 +915,10 @@ code for classes that correspond to data structures defined by XMLSchema.")
(assoc-ref %build-inputs
"util-linux")
"/bin/getopt"))))
+ (native-inputs
+ `(("util-linux" ,util-linux))) ; for 'getopt'
(inputs
- `(("util-linux" ,util-linux) ; for 'getopt'
- ("libxml2" ,libxml2) ; for 'xmllint'
+ `(("libxml2" ,libxml2) ; for 'xmllint'
("libxslt" ,libxslt))) ; for 'xsltproc'
(home-page "http://cyberelk.net/tim/software/xmlto/")
(synopsis "Front-end to an XSL toolchain")
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 25/31] gnu: libarchive: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-26-m.othacehe@gmail.com
* gnu/packages/backup.scm (libarchive)[arguments]: Do not build and run tests
when cross-compiling.
---
gnu/packages/backup.scm | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 0bd894f958..783ca7a674 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -226,17 +227,25 @@ backups (called chunks) to allow easy burning to CD/DVD.")
(("/bin/pwd") (which "pwd")))
#t))
(replace 'check
- (lambda _
- ;; XXX: The test_owner_parse, test_read_disk, and
- ;; test_write_disk_lookup tests expect user 'root' to exist, but
- ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
- ;;
- ;; The tests allow one to disable tests matching a globbing pattern.
- (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
- ;; XXX: This glob disables too much.
- (invoke "./libarchive_test" "^test_*_disk*")
- (invoke "./bsdcpio_test" "^test_owner_parse")
- (invoke "./bsdtar_test")))
+ ,@(if (%current-target-system)
+ '((lambda _
+ #t))
+ '((lambda _
+ ;; XXX: The test_owner_parse, test_read_disk, and
+ ;; test_write_disk_lookup tests expect user 'root' to
+ ;; exist, but the chroot's /etc/passwd doesn't have it.
+ ;; Turn off those tests.
+ ;;
+ ;; The tests allow one to disable tests matching a
+ ;; globbing pattern.
+ (invoke "make"
+ "libarchive_test"
+ "bsdcpio_test"
+ "bsdtar_test")
+ ;; XXX: This glob disables too much.
+ (invoke "./libarchive_test" "^test_*_disk*")
+ (invoke "./bsdcpio_test" "^test_owner_parse")
+ (invoke "./bsdtar_test")))))
(add-after 'install 'add--L-in-libarchive-pc
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 26/31] gnu: tcsh: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-27-m.othacehe@gmail.com
* gnu/packages/shells.scm (tcsh)[arguments]: Replace "cc" by "gcc" as
native gethost compiler when cross-compiling.
---
gnu/packages/shells.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (29 lines)
diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
index f8c0fdf71f..6eed89396e 100644
--- a/gnu/packages/shells.scm
+++ b/gnu/packages/shells.scm
@@ -11,6 +11,7 @@
;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com>
;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -356,6 +357,14 @@ written by Paul Haahr and Byron Rakitzis.")
(arguments
`(#:phases
(modify-phases %standard-phases
+ ,@(if (%current-target-system)
+ '((add-before 'configure 'set-cross-cc
+ (lambda _
+ (substitute* "configure"
+ (("CC_FOR_GETHOST=\"cc\"")
+ "CC_FOR_GETHOST=\"gcc\""))
+ #t)))
+ '())
(add-before 'check 'patch-test-scripts
(lambda _
;; Take care of pwd
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 18/31] gnu: bc: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-19-m.othacehe@gmail.com
* gnu/packages/patches/bc-fix-cross-compilation.patch: New patch file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/algebra.scm (bc)[origin]: Apply it,
[native-inputs]: Add automake and autoconf,
[arguments]: Add a new 'autogen phase that is needed by the new patch.
---
gnu/local.mk | 1 +
gnu/packages/algebra.scm | 15 +-
.../patches/bc-fix-cross-compilation.patch | 171 ++++++++++++++++++
3 files changed, 184 insertions(+), 3 deletions(-)
create mode 100644 gnu/packages/patches/bc-fix-cross-compilation.patch

Toggle diff (230 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 7d42202485..e22f8af3cc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -689,6 +689,7 @@ dist_patch_DATA = \
%D%/packages/patches/bash-completion-directories.patch \
%D%/packages/patches/bastet-change-source-of-unordered_set.patch \
%D%/packages/patches/bazaar-CVE-2017-14176.patch \
+ %D%/packages/patches/bc-fix-cross-compilation.patch \
%D%/packages/patches/beets-python-3.7-fix.patch \
%D%/packages/patches/beignet-correct-file-names.patch \
%D%/packages/patches/benchmark-unbundle-googletest.patch \
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 95189401f7..7f951b6fdc 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -668,15 +669,23 @@ binary.")
(uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
(sha256
(base32
- "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
+ "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))
+ (patches (search-patches "bc-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
(native-inputs
- `(("ed" ,ed)
+ `(("automake" ,automake)
+ ("autoconf" ,autoconf)
+ ("ed" ,ed)
("flex" ,flex)
("texinfo" ,texinfo)))
(arguments
'(#:configure-flags
- (list "--with-readline")))
+ (list "--with-readline")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'autogen
+ (lambda _
+ (invoke "autoreconf" "-vif"))))))
(home-page "https://www.gnu.org/software/bc/")
(synopsis "Arbitrary precision numeric processing language")
(description
diff --git a/gnu/packages/patches/bc-fix-cross-compilation.patch b/gnu/packages/patches/bc-fix-cross-compilation.patch
new file mode 100644
index 0000000000..14dfecdbde
--- /dev/null
+++ b/gnu/packages/patches/bc-fix-cross-compilation.patch
@@ -0,0 +1,171 @@
+Patch taken from nix.
+
+commit fdda59736ddc048cf38a2c7103f4f5d9eeaf995e
+Author: Ben Gamari <ben@smart-cactus.org>
+Date: Tue Oct 17 10:51:34 2017 -0400
+
+ Try implementing cross-compilation
+
+diff --git a/bc/Makefile.am b/bc/Makefile.am
+index d9d412e..fdef633 100644
+--- a/bc/Makefile.am
++++ b/bc/Makefile.am
+@@ -17,6 +17,7 @@ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \
+
+ AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../h
+ LIBBC = ../lib/libbc.a
++LIBBC_HOST = ../lib/libbc_host.a
+ LIBL = @LEXLIB@
+ LDADD = $(LIBBC) $(LIBL) @READLINELIB@
+
+@@ -29,12 +30,20 @@ $(PROGRAMS): libmath.h $(LIBBC)
+ scan.o: bc.h
+ global.o: libmath.h
++
++main_host.c : main.c
++ cp $< $@
+
+-fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
++fbcOBJ = $(addsuffix _host,main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o)
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+
+-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
++libmath.h: libmath.b $(fbcOBJ) $(LIBBC_HOST)
+ echo '{0}' > libmath.h
+- $(MAKE) global.o
+- $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
++ $(MAKE) global.o_host
++ $(CC_FOR_BUILD) -o fbc $(fbcOBJ) global.o_host $(LIBBC_HOST) $(LIBL) ${READLINELIB} $(LIBS)
+ ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
+ $(srcdir)/fix-libmath_h
+ rm -f ./fbc ./global.o
+diff --git a/configure.ac b/configure.ac
+index fc74573..5cabb73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,6 +20,7 @@ m4_define([dc_version], 1.4.1)
+
+ AC_INIT([bc],[bc_version])
+ AC_CONFIG_SRCDIR(doc/bc.1)
++AC_CONFIG_MACRO_DIR([m4])
+ AM_INIT_AUTOMAKE([dist-bzip2])
+ AC_CONFIG_HEADERS(config.h)
+
+@@ -35,6 +36,7 @@ AC_DEFINE([DC_COPYRIGHT],
+ [Define the dc copyright line.])
+
+ AC_PROG_CC
++AX_CC_FOR_BUILD
+ AC_USE_SYSTEM_EXTENSIONS
+
+ AM_PROG_LEX
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index ec4bf59..c670f5b 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -1,5 +1,5 @@
+ ## Process this file with automake to produce Makefile.in
+-noinst_LIBRARIES = libbc.a
++noinst_LIBRARIES = libbc.a libbc_host.a
+
+ AM_CPPFLAGS = -I. -I.. -I$(srcdir)/../h
+
+@@ -24,3 +24,11 @@ testmul: testmul.o number.o
+
+ specialnumber: newnumber.o
+ cp newnumber.o number.o
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
++
++libbc_host.a : $(addsuffix _host,$(libbc_a_OBJECTS))
++ ar cru $@ $+
++ ranlib $@
+diff --git a/m4/cc_for_build.m4 b/m4/cc_for_build.m4
+new file mode 100644
+index 0000000..c62ffad
+--- /dev/null
++++ b/m4/cc_for_build.m4
+@@ -0,0 +1,77 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_cc_for_build.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CC_FOR_BUILD
++#
++# DESCRIPTION
++#
++# Find a build-time compiler. Sets CC_FOR_BUILD and EXEEXT_FOR_BUILD.
++#
++# LICENSE
++#
++# Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org>
++# Copyright (c) 1999 Richard Henderson <rth@redhat.com>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 3
++
++dnl Get a default for CC_FOR_BUILD to put into Makefile.
++AC_DEFUN([AX_CC_FOR_BUILD],
++[# Put a plausible default for CC_FOR_BUILD in Makefile.
++if test -z "$CC_FOR_BUILD"; then
++ if test "x$cross_compiling" = "xno"; then
++ CC_FOR_BUILD='$(CC)'
++ else
++ CC_FOR_BUILD=gcc
++ fi
++fi
++AC_SUBST(CC_FOR_BUILD)
++# Also set EXEEXT_FOR_BUILD.
++if test "x$cross_compiling" = "xno"; then
++ EXEEXT_FOR_BUILD='$(EXEEXT)'
++else
++ AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
++ [rm -f conftest*
++ echo 'int main () { return 0; }' > conftest.c
++ bfd_cv_build_exeext=
++ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
++ for file in conftest.*; do
++ case $file in
++ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
++ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
++ esac
++ done
++ rm -f conftest*
++ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
++ EXEEXT_FOR_BUILD=""
++ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
++fi
++AC_SUBST(EXEEXT_FOR_BUILD)])dnl
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 28/31] gnu: mkfontdir: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-29-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/xorg.scm (mkfontdir)[arguments]: Replace outdated config.sub and
config.guess, by the ones taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/xorg.scm | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index e35e8be72f..ef742d6a37 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
;;; Copyright © 2019 nee <nee@cock.li>
;;; Copyright © 2019 Yoshinori Arai <kumagusu08@gmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -4736,8 +4737,21 @@ protocol and arbitrary X extension protocol.")
"0c3563kw9fg15dpgx4dwvl12qz6sdqdns1pxa574hc7i5m42mman"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess"))
+ #t))
(add-after 'install 'wrap-mkfontdir
(lambda* (#:key inputs outputs #:allow-other-keys)
(wrap-program (string-append (assoc-ref outputs "out")
@@ -4749,7 +4763,8 @@ protocol and arbitrary X extension protocol.")
(inputs
`(("mkfontscale" ,mkfontscale)))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
(home-page "https://www.x.org/wiki/")
(synopsis "Create an index of X font files in a directory")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 27/31] gnu: pkg-config: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-28-m.othacehe@gmail.com
* gnu/packages/pkg-config.scm (%pkg-config)[arguments]: Add configure-flags
to disable tests that fail when cross-compiling.
---
gnu/packages/pkg-config.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

Toggle diff (30 lines)
diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm
index 6fc19a975d..0425854a75 100644
--- a/gnu/packages/pkg-config.scm
+++ b/gnu/packages/pkg-config.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -48,7 +49,15 @@
(base32
"14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg"))))
(build-system gnu-build-system)
- (arguments `(#:configure-flags '("--with-internal-glib")))
+ (arguments
+ `(#:configure-flags
+ '("--with-internal-glib"
+ ,@(if (%current-target-system)
+ '("glib_cv_stack_grows=no"
+ "glib_cv_uscore=no"
+ "ac_cv_func_posix_getpwuid_r=yes"
+ "ac_cv_func_posix_getgrgid_r=yes")
+ '()))))
(native-search-paths
(list (search-path-specification
(variable "PKG_CONFIG_PATH")
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 29/31] gnu: alsa-utils: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-30-m.othacehe@gmail.com
* gnu/packages/linux.scm (alsa-utils)[inputs]: Move gettext from here ...
[native-inputs]: ... to here, in order to fix cross-compilation.
---
gnu/packages/linux.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index f89ab6b281..8fb2abaa3c 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -22,7 +22,7 @@
;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2017 nee <nee-git@hidamari.blue>
@@ -1234,12 +1234,13 @@ MIDI functionality to the Linux-based operating system.")
(("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
"true\n"))
#t)))))
+ (native-inputs
+ `(("gettext" ,gettext-minimal)))
(inputs
`(("libsamplerate" ,libsamplerate)
("ncurses" ,ncurses)
("alsa-lib" ,alsa-lib)
- ("xmlto" ,xmlto)
- ("gettext" ,gettext-minimal)))
+ ("xmlto" ,xmlto)))
(home-page "http://www.alsa-project.org/")
(synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 30/31] gnu: icu4c: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-31-m.othacehe@gmail.com
* gnu/packages/icu4c.scm (icu4c-build-root): New variable.
(icu4c)[native-inputs]: Add it.
[arguments]: Pass it as a configure-flag.
---
gnu/packages/icu4c.scm | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)

Toggle diff (71 lines)
diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 6e93d6aed9..4d90b31c1c 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,6 +26,7 @@
#:use-module (gnu packages perl)
#:use-module (guix licenses)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix build-system ant)
#:use-module (guix build-system gnu))
@@ -44,11 +46,21 @@
(sha256
(base32 "17fbk0lm2clsxbmjzvyp245ayx0n4chji3ky1f3fbz2ljjv91i05"))))
(build-system gnu-build-system)
+ ;; When cross-compiling, this package needs a source directory of a
+ ;; native-build of itself.
+ (native-inputs (if (%current-target-system)
+ `(("icu4c-build-root" ,icu4c-build-root))
+ '()))
(inputs
`(("perl" ,perl)))
(arguments
`(#:configure-flags
- '("--enable-rpath"
+ (list
+ "--enable-rpath"
+ ,@(if (%current-target-system)
+ '((string-append "--with-cross-build="
+ (assoc-ref %build-inputs "icu4c-build-root")))
+ '())
,@(if (let ((s (or (%current-target-system)
(%current-system))))
(or (string-prefix? "arm" s)
@@ -81,6 +93,25 @@ C/C++ part.")
(license x11)
(home-page "http://site.icu-project.org/")))
+(define-public icu4c-build-root
+ (package
+ (inherit icu4c)
+ (name "icu4c-build-root")
+ (arguments
+ (substitute-keyword-arguments (package-arguments icu4c)
+ ((#:tests? _ '())
+ #f)
+ ((#:out-of-source? _ '())
+ #t)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (copy-recursively "../build" out)
+ #t)))))))
+ (native-inputs '())))
+
(define-public java-icu4j
(package
(name "java-icu4j")
--
2.17.1
M
M
Mathieu Othacehe wrote on 8 Jul 2019 11:59
[PATCH 31/31] gnu: glibc-utf8-locales: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20190708095913.3460-32-m.othacehe@gmail.com
* gnu/packages/base.scm (glibc-utf8-locales)[inputs]: Move to ...
[native-inputs]: ... here, in order to fix cross-compilation.
* gnu/packages/commencement.scm (glibc-utf8-locales-final)[inputs]: Move to ...
[native-inputs]: ... here, in order to fix cross-compilation.
---
gnu/packages/base.scm | 4 ++--
gnu/packages/commencement.scm | 11 ++++++-----
2 files changed, 8 insertions(+), 7 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 15f35009a9..216a2f1591 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1143,8 +1143,8 @@ to the @code{share/locale} sub-directory of this package.")
;; tests---e.g., in Guile's i18n tests.
'("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))
#t))))
- (inputs `(("glibc" ,glibc)
- ("gzip" ,gzip)))
+ (native-inputs `(("glibc" ,glibc)
+ ("gzip" ,gzip)))
(synopsis "Small sample of UTF-8 locales")
(description
"This package provides a small sample of UTF-8 locales mostly useful in
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index a8ec677cee..c0345aa967 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -881,11 +881,12 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; function.)
(package
(inherit glibc-utf8-locales)
- (inputs `(("glibc" ,glibc-final)
- ("gzip"
- ,(package-with-explicit-inputs gzip %boot4-inputs
- (current-source-location)
- #:guile %bootstrap-guile))))))
+ (native-inputs
+ `(("glibc" ,glibc-final)
+ ("gzip"
+ ,(package-with-explicit-inputs gzip %boot4-inputs
+ (current-source-location)
+ #:guile %bootstrap-guile))))))
(define-public ld-wrapper
;; The final 'ld' wrapper, which uses the final Guile and Binutils.
--
2.17.1
M
M
Marius Bakke wrote on 8 Jul 2019 19:36
Re: [bug#36477] [PATCH 00/31] Fix cross-compilation issues
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87r270pgwf.fsf@devup.no
Hi Mathieu,

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

Toggle quote (6 lines)
> Hello,
>
> Here's a batch of cross-compilation related patches. They can be seen on
> wip-cross-system branch of savannah. Some of them cause mass-rebuilds so I
> guess this serie is targeting core-updates.

This is very impressive work, thank you!

I'm not comfortable pulling in all of this on 'core-updates' right now.
There are already a huge pile of changes that have not really
"stabilized" yet. So my preference is to wait until the next round
(probably around October/November).

However some of these changes look really innocuous to me. I'll review
those that are OK for this 'core-updates' separately. Maybe we can work
around the remaining ones in the mean time?


Toggle quote (75 lines)
> Mathieu Othacehe (30):
> gnu: perl: Fix cross-compilation.
> gnu: python: Fix cross compilation.
> gnu: tcl: Fix cross-compilation.
> gnu: tk: Fix cross-compilation.
> gnu: libxslt: Fix cross-compilation.
> gnu: xorg: Fix cross-compilation of multiple packages.
> gnu: libgpg-error: Fix cross compilation.
> gnu: python: Fix cross-compilation.
> gnu: http-parser: Fix cross-compilation.
> gnu: openssl: Fix cross-compilation.
> gnu: texinfo: Fix cross-compilation.
> gnu: cmake: Extend CMAKE_PREFIX_PATH to non-native inputs.
> gnu: libgit2: Fix cross compilation.
> gnu: ath9k-htc-firmware: Fix cross compilation.
> gnu: libpaper: Fix aarch64 cross-compilation.
> gnu: groff: Fix cross compilation.
> gnu: bc: Fix cross-compilation.
> gnu: indent: Fix aarch64 cross-compilation.
> gnu: libsamplerate: Fix aarch64 cross-compilation.
> gnu: mit-krb5: Fix cross-compilation.
> gnu: cyrus-sasl: Fix cross-compilation.
> gnu: help2man: Fix cross-compilation.
> gnu: xmlto: Fix cross-compilation.
> gnu: libarchive: Fix cross-compilation.
> gnu: tcsh: Fix cross-compilation.
> gnu: pkg-config: Fix cross-compilation.
> gnu: mkfontdir: Fix aarch64 cross-compilation.
> gnu: alsa-utils: Fix cross-compilation.
> gnu: icu4c: Fix cross-compilation.
> gnu: glibc-utf8-locales: Fix cross-compilation.
>
> Pierre-Moana Levesque (1):
> gnu: texinfo-5: Fix cross-compilation.
>
> gnu/local.mk | 3 +
> gnu/packages/algebra.scm | 15 +-
> gnu/packages/backup.scm | 31 ++--
> gnu/packages/base.scm | 4 +-
> gnu/packages/cmake.scm | 2 +-
> gnu/packages/code.scm | 21 ++-
> gnu/packages/commencement.scm | 11 +-
> gnu/packages/cyrus-sasl.scm | 17 +-
> gnu/packages/firmware.scm | 5 +-
> gnu/packages/ghostscript.scm | 19 ++
> gnu/packages/gnupg.scm | 22 +++
> gnu/packages/groff.scm | 40 +++-
> gnu/packages/icu4c.scm | 33 +++-
> gnu/packages/kerberos.scm | 23 ++-
> gnu/packages/linux.scm | 7 +-
> gnu/packages/man.scm | 2 +-
> .../patches/bc-fix-cross-compilation.patch | 171 ++++++++++++++++++
> .../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++
> .../patches/python-2.7-search-paths.patch | 10 +-
> .../patches/python-3-search-paths.patch | 11 +-
> .../patches/python-cross-compile.patch | 145 +++++++++++++++
> gnu/packages/perl.scm | 7 +-
> gnu/packages/pkg-config.scm | 11 +-
> gnu/packages/pulseaudio.scm | 22 ++-
> gnu/packages/python.scm | 40 +++-
> gnu/packages/shells.scm | 9 +
> gnu/packages/tcl.scm | 28 ++-
> gnu/packages/texinfo.scm | 28 ++-
> gnu/packages/tls.scm | 59 ++++--
> gnu/packages/version-control.scm | 16 +-
> gnu/packages/web.scm | 13 +-
> gnu/packages/xml.scm | 7 +-
> gnu/packages/xorg.scm | 44 ++++-
> 33 files changed, 794 insertions(+), 94 deletions(-)
> create mode 100644 gnu/packages/patches/bc-fix-cross-compilation.patch
> create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
> create mode 100644 gnu/packages/patches/python-cross-compile.patch
>
> --
> 2.17.1
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jfzAACgkQoqBt8qM6
VPrn5wgAl6tfi75oJXNgxTwZjmpaKzB2+MMWa3CYguMTfDOBBwgoEdglGhf2iT0s
ejJuehPVLgGqgwyB4PqigLNrOg/OqVFuirnifgc4WDKVEyyfwy2fRDSuy02ivY47
TGLQfRJNH0BQ9v3lZCbxd4T/pLn+3Vh7yB9ue87HCqF466abshWa6bBrOleWTQ/f
PK+2hi2/OXzciXWBvg81/9C9nc9dWpq2sfHD5qugXQW2tjQMiHMqh42dL0aFKK4C
RJM/TZEhDd7BAMcNL5jRt7ywdqmm20Oj2VpgOhwHjmgMhM//DI0LKss41DuecBYa
qc1UebjvKyD0qZDAreptq+5PHwT57Q==
=8ygA
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:39
Re: [bug#36477] [PATCH 01/31] gnu: perl: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87o924pgrz.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/perl.scm (perl)[arguments]: Use cross-libc instead of libc when
> cross-compiling.

[...]

Toggle quote (21 lines)
> @@ -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")

OK!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jf9AACgkQoqBt8qM6
VPpsqgf8DUSvb/e+rV5PD4E7R076Y5H//N3GpvUfR9+20T/GtwcjPGBUdLkfuG/9
pwOpMR40OMdtvagpIYNXqUxk/2hTC//vJ2ias/0fxssgw7uV+7ELXByV3kfiWRsZ
Gv+dH6kG6Hit4jLaHhFdtPLVWMwy1m/gVekoIQLJJ5VsJeLTEweBTm7px/owmCTz
OnUVnlu3ERIzlX7Pva/s6oB3ff88AB5nYpWKZdI79FbAeJKl7P7z9pt3NT/rzS2e
dgFBx0Y9X43tcu5kP2XKRLcRqCjsvxUCWpow2qA+zOSlcd0P9GfL59NGMCFaX3tA
UxYN4ZtTQbYZIit4ljnclgpEsno5Dg==
=O5Hl
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:41
Re: [bug#36477] [PATCH 03/31] gnu: tcl: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87lfx8pgpc.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (37 lines)
> * gnu/packages/tcl.scm (tcl)[arguments]: Add configure flags to fix
> cross-compilation.
> ---
> gnu/packages/tcl.scm | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
> index 4840ac4e10..fc955cf649 100644
> --- a/gnu/packages/tcl.scm
> +++ b/gnu/packages/tcl.scm
> @@ -53,7 +53,7 @@
> "0sprsg7wnraa4cbwgbcliylm6p0rspfymxn8ww02pr4ca70v0g64"))))
> (build-system gnu-build-system)
> (arguments
> - '(#:phases (modify-phases %standard-phases
> + `(#:phases (modify-phases %standard-phases
> (add-before 'configure 'pre-configure
> (lambda _ (chdir "unix") #t))
> (add-after 'install 'install-private-headers
> @@ -73,9 +73,16 @@
> ;; PREFIX/share/man. The 'validate-documentation-location' phase is
> ;; not able to fix this up because the default install populates both
> ;; PREFIX/man and PREFIX/share/man.
> - #:configure-flags (list (string-append "--mandir="
> - (assoc-ref %outputs "out")
> - "/share/man"))
> + #:configure-flags
> + (list (string-append "--mandir="
> + (assoc-ref %outputs "out")
> + "/share/man")
> + ;; This is needed when cross-compiling, see:
> + ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
> + ,@(if (%current-target-system)
> + '("tcl_cv_strtod_buggy=1"
> + "ac_cv_func_strtod=yes")
> + '()))

OK!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgC8ACgkQoqBt8qM6
VPrtYgf9H/Vqr7ZCN9k685WgEAA2cu+VJY4nesVIcboBZ7A1cCs3bkmtoO1NY/ZT
M6Se0a93BwXftmVkIIzN9JnDS8ErO/NL7MSCbkdAeIEq/ZO0CE2+1HmxDlNXEpKH
Zq2YqzJ8zT0mSuGSlaKg9ZwKQSCn5CHMw3IM/J/JtlxN/Sx48x0i1RhUTPuDTIOQ
AhmxiyH0Cdl80i+vuwUgp6xQiGyKZchmzVrCLpTgvsD1oTT88mJ9SSLIGa1YhI8v
VmKduQWeTqyOlErUFyWvQMnooIWcQG56lNE9ghJof3L423hwSBFQ2df6QdU+9XJ+
Y+xfkzWV5PwyeLHwIToENWwCIWcAaA==
=jD+V
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:42
Re: [bug#36477] [PATCH 04/31] gnu: tk: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87imscpgn5.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (28 lines)
> * gnu/packages/tcl.scm (tk)[arguments]: Add configure flags to fix
> cross-compilation.
> ---
> gnu/packages/tcl.scm | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
> index fc955cf649..df0f0e3a5c 100644
> --- a/gnu/packages/tcl.scm
> +++ b/gnu/packages/tcl.scm
> @@ -185,9 +185,16 @@ X11 GUIs.")
> "/lib -lfontconfig")))
> #t))))
>
> - #:configure-flags (list (string-append "--with-tcl="
> - (assoc-ref %build-inputs "tcl")
> - "/lib"))
> + #:configure-flags
> + (list (string-append "--with-tcl="
> + (assoc-ref %build-inputs "tcl")
> + "/lib")
> + ;; This is needed when cross-compiling, see:
> + ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
> + ,@(if (%current-target-system)
> + '("tcl_cv_strtod_buggy=1"
> + "ac_cv_func_strtod=yes")
> + '()))

LGTM (though I guess not very useful without the Python cross fix?).
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgH4ACgkQoqBt8qM6
VPp7Fgf/XWSVZ0z4pxflJpM7AW/+2yqT0tNvEQ9j1+A+fx4N1thcFMgDOOuS3h9z
7z89/mP1schRVHRwht/JC/8D/PR4pP8zHmC+cEteGDTPalNfhYFrwpiqrqCBlJBi
qTvVcDP+6/68CpEqWA45Qa9vn06PfzoAqWypPJ7ZDnKjPeXjRgMHb5HXou6LIHMG
/eR780CYs+AwfP4Y6G0etmjRcRJxz+HLkadjsmMsOVkVEtgI+4PApz8set+0MXhR
iX3AO4qgvgH+mBqnEYgQ5CKfF1bO93dCgspSyuDw5WBd8boCS8+Nm5chUOjRprGa
pXn3DjMrztpfLmabUPF/b+O9vkLsyw==
=pjcs
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:42
Re: [bug#36477] [PATCH 05/31] gnu: libxslt: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87ftngpgmn.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (16 lines)
> * gnu/packages/xml.scm (libxslt)[native-inputs]: Add pkg-config.
> ---
> gnu/packages/xml.scm | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
> index fc60758724..5fefa2c1dc 100644
> --- a/gnu/packages/xml.scm
> +++ b/gnu/packages/xml.scm
> @@ -201,6 +201,8 @@ project (but it is usable outside of the Gnome platform).")
> ("libxml2" ,libxml2)
> ("python" ,python-minimal-wrapper)
> ("zlib" ,zlib)))
> + (native-inputs
> + `(("pkg-config" ,pkg-config)))

LGTM.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgJAACgkQoqBt8qM6
VPp4WAf9GwtX2IovWIYd5pv3NaDcSxvFJLj2K7jAE2MucWBYWHoHQrxxnPULp16i
62aq+7usUPGTjnbP5Tz0YEPOSosZWfYlyLUiy0cJg8JQXirL7cFdhhWLPdmtBUgu
OzmLkTeUwuW5OdKVdVS4nAcZh6Vc5xyGFJsa3I4QhoAT+cgxK0i1b8AGy8UBh0se
jZAFyVt5O6DIA2OVy3omixOxrrQbJNEduebDHBP8A+VabcRq8bSAoKspaMk2CDa1
mtYa8KnSmr0mMGABVZ4oY8dtbGLZ5FZSfSlHI0po6gcWMTHnVngICkE7CyrTrtRj
HO+x+aaIptjkHFp0aRuBHY4iR2938A==
=4Ui+
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:43
Re: [bug#36477] [PATCH 06/31] gnu: xorg: Fix cross-compilation of multiple packages.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87d0ikpgkx.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (5 lines)
> * gnu/packages/xorg.scm (libxext)[arguments]: Disable zero malloc check that
> fails when cross-compiling,
> (libxrender)[arguments]: ditto,
> (libx11)[arguments]: ditto.

Have you checked that this is still a problem with the newer versions of
these on core-updates?

LGTM anyway.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgM4ACgkQoqBt8qM6
VPrzJAf/SZQIg0xNJ/epgP0Zl6ah+3ubP0n7jRcCV9LjGC2VSL03YHKqlisW5Ns7
tROWqbXHemLb2J0CMmAp0/L8BWI87Y2K6JW9tt/5dJ6Q9wH6kPPMfSaobR+iUKLN
5ri2AhRANsg2E5xuz9Xf37KCisKn7XCO+E51JPlbdL2MByP5PWb4UqR40BTwwolm
67fdJFLK8QI3QTvOCxomwFhPyJ0ha+r83CZWtm9KbwiKa9iqXNFYkoHAqmJKq30A
+Gm6xPLU9uRKusDp2FEQpWGzntYBxkmwEXJlUT+Sow9FvfMd4fPlVQsHjL3uUL90
wjpdmoHcAqTJrRDPH5aKLEWPIWNGYg==
=zKsd
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:46
Re: [bug#36477] [PATCH 09/31] gnu: http-parser: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87a7dopggh.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/web.scm (http-parser)[arguments]: Set CC and AR variables in
> Makefile in order to fix cross-compilation.

[...]

Toggle quote (19 lines)
> @@ -5171,10 +5172,18 @@ into your tests. It automatically starts up a HTTP server in a separate thread
> #:make-flags
> (list (string-append "PREFIX="
> (assoc-ref %outputs "out"))
> - "CC=gcc" "library")
> + "library")
> #:phases
> (modify-phases %standard-phases
> - (delete 'configure))))
> + (replace 'configure
> + (lambda* (#:key target #:allow-other-keys)
> + (when ,(%current-target-system)
> + (substitute* (find-files "." "Makefile")
> + (("CC\\?=.*$")
> + (string-append "CC=" target "-gcc\n"))
> + (("AR\\?=.*$")
> + (string-append "AR=" target "-ar\n"))))
> + #t)))))

I would prefer to splice in this phase instead of adding a noop phase to
the native build. LGTM otherwise.

(so I guess CC=gcc was not needed for native builds?)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgW4ACgkQoqBt8qM6
VPrwcAf7BfEjfKquUef6pzfc1kl9yNM2zBtUDFThNwkRqGIbD/JAF8Iey+lNfBUA
PQtVxE2/jOQtklHX7tqDZserBX5HP7qyNKgjcZL72X0VlJQei5plHFLTUMVVnbPb
rUNRrmx5T/4B3Yhn+hrMj8P+zVEBFMq1caPhVqD/EBoQFFw4lgjQ85Q54ARndMTT
IAJArU6Xyfv32luQmpe4DCJZ09+JStdYZHCqgugFPWS5eLsVuZO3dtWyJHecGxq2
HI7b4AyX9Pc9XQCzUIo2w7ClXi8dGLDPmGN4wtg9QhxLyYR1aIgZSPk1hQmnriB3
aqUB4HazAekIWkTy8C6F+PLhSlo+Kw==
=hMcQ
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:47
Re: [bug#36477] [PATCH 12/31] gnu: cmake: Extend CMAKE_PREFIX_PATH to non-native inputs.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
877e8spgdt.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (4 lines)
> * gnu/packages/cmake.scm (cmake)[native-search-paths]: Turn to search-paths.
> This allows libraries using cmake functions "find_file" or "find_library" to
> search in non-native inputs while cross-compiling.

Does this still do the right thing in a native context?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgc4ACgkQoqBt8qM6
VPoTgwgAhkLNqRbpT2S0k4RHw+7zN+FUeKrq7q0MPYIgXGhS9kEsmv3RbKp3kBWC
sZEo04Lio+f9ANbKGnqvGe5Lp9/EOg08nLappAX8SHccByJb0VOx8XbR6zdxg4Fo
lcnzT6vJn8a+bnNND7ZbhiA7zwHxaLEwehhgZkKofMTrUuhBI2i4tXAjKAv5Yy/f
Mo85eTYMBP8DxIxE0IgH2AtiQMdjqDoIIbEEacubqT4sP06m1M5D38TnfbUR5FCy
z0/UES6mUOVOr/cqRl2Nx5Wu2LiahcN7V9KFu4u5qUePQcAudthxUIsRTOxWmLwp
3CHkEnvAStA9MosAXfwS//MoHkusLw==
=m3FG
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:49
Re: [bug#36477] [PATCH 13/31] gnu: libgit2: Fix cross compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
874l3wpgaj.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (39 lines)
> * gnu/packages/version-control.scm (libgit2)[arguments]: Set
> PKG_CONFIG_EXECUTABLE variable when cross-compiling.
> Also do not run test suite if cross-compiling.
> ---
> gnu/packages/version-control.scm | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
> index 8effe1d502..ca5a019105 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -545,7 +545,14 @@ everything from small to very large projects with speed and efficiency.")
> (build-system cmake-build-system)
> (outputs '("out" "debug"))
> (arguments
> - `(#:configure-flags '("-DUSE_SHA1DC=ON") ; SHA-1 collision detection
> + `(#:configure-flags
> + (list "-DUSE_SHA1DC=ON" ; SHA-1 collision detection
> + ,@(if (%current-target-system)
> + `((string-append
> + "-DPKG_CONFIG_EXECUTABLE="
> + (assoc-ref %build-inputs "pkg-config")
> + "/bin/" ,(%current-target-system) "-pkg-config"))
> + '()))
> #:phases
> (modify-phases %standard-phases
> (add-after 'unpack 'fix-hardcoded-paths
> @@ -560,9 +567,12 @@ everything from small to very large projects with speed and efficiency.")
> (lambda _
> (for-each make-file-writable (find-files "."))
> #t))
> - ;; Run checks more verbosely.
> + ;; Run checks more verbosely, unless we are cross-compiling.
> (replace 'check
> - (lambda _ (invoke "./libgit2_clar" "-v" "-Q"))))))
> + (lambda _
> + ,@(if (%current-target-system)
> + '(#t)

Maybe print "test suite not run" or something like that. Otherwise LGTM.

Toggle quote (6 lines)
> + '((invoke "./libgit2_clar" "-v" "-Q"))))))))
> (inputs
> `(("libssh2" ,libssh2)
> ("http-parser" ,http-parser)))
> --
> 2.17.1
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgkQACgkQoqBt8qM6
VPrnEQgAh40YQnjGRM+RjFvYoJXGLPSk9/o9Po8nBVOMBJpoMoETDJVqKk7KveG1
WKltfqQPBPSxFWYuy5Fj9D+gYuvsVLPL/3O3/QowZkpr1s+olBPrkmPMjROi4m21
ru8qJ7mjc2gDgXn2k6YyhZjq4EfnOc003GgWm+0j1fMGZbR9s4GEhJIZbYknk1uB
8N45u5tgikswgI4H5fJeTqd3Ep6AcoSXl1LXXRjCOlRDHJS7W5reTTyHej+23m49
mSz4Kv/hR+c8ij7wHz42AVD5AzvsOZYjm/7NYhPnNyL3ikbNIwdW2cGBdVWIZOOS
6tZlaT41rTQcKEU761xlQ+HbtplLfw==
=zxck
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:50
Re: [bug#36477] [PATCH 14/31] gnu: ath9k-htc-firmware: Fix cross compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
871rz0pg8x.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

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

LGTM.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgn4ACgkQoqBt8qM6
VPqcdAf/T7mwVWQmASE4U/ytHeMqRbFopZwkglJlYdKauHc6Y6BBdCnNxdgtBfHR
47HpXwhMP7lme1QXyyx4x95AuJlsB/3o7bwpjLzYxnM3BRV1U9Y9Rumn2HfIkZ2w
W/+UBJ8bm12WXitDU7+WViXa/tY8sRF1XhTZKtBsCWPywtOpOWn11XeFMYh6Qoyi
qQHl3KipbB6gw06/HYQYz9QvbfKzzsT49IZnaVIvvHH5TpvSLIdYb+yzKCSTqBD+
XBR5xGlSTk++sAC5IpiT9AmTk5g92BcAkF6S5o+KWKd7EaD/DydwTReJfVxO6VK8
QvEXW5ZXid2d0dTUDlaMo67FYYGwdw==
=/qC1
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 19:53
Re: [bug#36477] [PATCH 15/31] gnu: libpaper: Fix aarch64 cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87y318o1kt.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (7 lines)
> The packaged config.sub and config.guess do not have aarch64 support. Replace
> them by the ones from automake.
>
> * gnu/packages/ghostscript.scm (libpaper)[arguments]: Replace outdated config.sub and
> config.guess, taken from ...
> [native-inputs]: ... here, by adding automake.

Native ghostscript is fine on AArch64, right? I would prefer to hold
this patch for now, unless it's also needed for native builds.

(maybe libpaper gets fixed upstream meanwhile...)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jgwIACgkQoqBt8qM6
VPppuQf+JieyQ0cp0S3wgNNT3mQwLq9zM+h8Crpowj7s9VUx649L+55Jna685SNW
+k4zKQYE+hghot1vCrDi8UHJqd5629NTcYAx8hStCjL+ALQRV/TUoUewcYhvwyu6
Jhlq8+50AQN2koyZa1H/m+mmPwPLg5Hab7IrctO+am3mGlTgFGHnN3R1uUCAHdUh
9PgCi6AEguVBJhpo4dsEcMbDJyz6iHddwSUiUFfgw0+2yGuaottzHZ6mm6Z1Ofwa
pKa+cPDNZxzYPiC672fA/PwIlbvTeF2pIcFRk0vKWvF03FTA9RR9O/qw3agehGsx
pzGxs4boHqwccx0SRxhEpf5wbrlimA==
=0+Zd
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:13
Re: [bug#36477] [PATCH 21/31] gnu: mit-krb5: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87tvbwo0mp.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (4 lines)
> * gnu/packages/kerberos.scm (mit-krb5)[arguments]: Disable tests when
> cross-compiling. Add cross-compilation specific configure-flags and
> make-flags. Search for perl in native-inputs or inputs.

[...]

Toggle quote (20 lines)
> @@ -68,9 +69,23 @@
> ("perl" ,perl)))
> (arguments
> `(;; XXX: On 32-bit systems, 'kdb5_util' hangs on an fcntl/F_SETLKW call
> - ;; while running the tests in 'src/tests'.
> - #:tests? ,(string=? (%current-system) "x86_64-linux")
> + ;; while running the tests in 'src/tests'. Also disable tests when
> + ;; cross-compiling.
> + #:tests? ,(and (not (%current-target-system))
> + (string=? (%current-system) "x86_64-linux"))
>
> + #:configure-flags
> + (list ,@(if (%current-target-system)
> + '("krb5_cv_attr_constructor_destructor=yes"
> + "ac_cv_func_regcomp=yes"
> + "ac_cv_printf_positional=yes"
> + "ac_cv_file__etc_environment=yes"
> + "ac_cv_file__etc_TIMEZONE=no")
> + '()))

Have you checked whether these (strange!) configure flags are needed
with the newer version on 'core-updates'?

I have a slight preference for not passing #:make-flags etc at all in
the normal context. E.g.

,@(if (%current-target-system)
`(#:configure-flags ...)
'())

...but no strong opinion.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jh84ACgkQoqBt8qM6
VPosWwf+Jh/MHQq4I4m9uOSjQ1hiMOmeUhQ+VY1pkpF3YkEFKH3n2shLu0WcMiNb
9t51jo1vzGykacoX6mFBHJ/4n2JYgtNDoly22xQG/lLYlzku2Auo+/+Fp4gD0v3s
wrqTa5AwLahhL35kDnjTQbUlKNT/B1C1uVBxRKDK6yglpe/dazfLeL13scTtHfI/
Euook1vrZETddBf5LlVVlOPbG/bl67NY6nLEktAUuNJVWXJRucRQ1s2R5/9bH+EP
sszFw6Lp9FTvtrRyKgWCC6jjs9uGTapmFEfY0CLw7rT3EclT1sJTdsPWQsxTpSY3
b0LeVxSf9xe4jwJ0Z57/17XlcHVrfA==
=9xk9
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:15
Re: [bug#36477] [PATCH 23/31] gnu: help2man: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87r270o0k6.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/man.scm (help2man)[inputs]: Turn into ...
> [native-inputs]: ... that.

help2man references perl at runtime, should it not be in both inputs and
native-inputs?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jiCkACgkQoqBt8qM6
VPpKcgf/QMppPLC532rc/kw9ZY0/hwOCugifjkYBukKh2HGrlpauwti64s1mVfLJ
KKafYNEMbYq1u4t/KBSyj46nyG8e20CT8OgVYNHJmz2PK13R6QCtmZ1eYztGyXBj
uNFJv2gIULkUA8k6DKZMeMu3ja/ICB4rpgD8XW6gX9ILHYcj94DCAqd1ixra7iEL
pOZo5ojAgXg+nMGHvAkAChMAhzoZ6Knt8SOoz7A5fy6czYdpLQ5aSHbaGkA4MK1C
EyH043EE7veMa63b6xFtVASUdfS0M4eQvrXdG1r336OEN1S5QIa007wFYXN+AtAx
NNzA+UdBf2OFXHIZIFaOBuO4hdJEXw==
=Fbuj
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:18
Re: [bug#36477] [PATCH 24/31] gnu: xmlto: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87o924o0dx.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/xml.scm (xmlto)[inputs]: Move util-linux from here ...
> [native-inputs]: ... to here.

[...]

Toggle quote (11 lines)
> diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
> index 5fefa2c1dc..5239070b1c 100644
> --- a/gnu/packages/xml.scm
> +++ b/gnu/packages/xml.scm
> @@ -915,9 +915,10 @@ code for classes that correspond to data structures defined by XMLSchema.")
> (assoc-ref %build-inputs
> "util-linux")
> "/bin/getopt"))))
> + (native-inputs
> + `(("util-linux" ,util-linux))) ; for 'getopt'

The comments above this hunk suggest that util-linux must be a regular
input, since xmlto apparently needs getopt at run time.

So I suppose we need util-linux both as a native and regular input?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jiQoACgkQoqBt8qM6
VPpPgwf/QS7fNWmi8csK340SYsJF82Hy6N2qKhMxWiGyJe2Fq+m0LbJkSY2wNZ3n
9S9sKE4ARGDt+GmQpDFuj2lmnDs+o7kMqug7xLF/gBWnKFmIXt8LM5hEGzbbs91l
QMTTcgPgL725yaRETPWjdYCFVPamGVDzzTmETyOmvSyHzAuD3lHrKfrMhbgDfDVn
fqucEAAphvqjgSAbcI2m22DfC83at3kLXOa9I81i/xUFW+Zsvtse0JEkkii32G6l
TOeeOkeVLQbMgQu7du9UIJBWS+aXPh+vwcp2E09LTFUkVd5eOzcXq7D6ooIqVO1V
vnWFb83WQ/PJR6TCCNh/hmbRPPc8Nw==
=1lUS
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:37
Re: [bug#36477] [PATCH 31/31] gnu: glibc-utf8-locales: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
877e8snzid.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (5 lines)
> * gnu/packages/base.scm (glibc-utf8-locales)[inputs]: Move to ...
> [native-inputs]: ... here, in order to fix cross-compilation.
> * gnu/packages/commencement.scm (glibc-utf8-locales-final)[inputs]: Move to ...
> [native-inputs]: ... here, in order to fix cross-compilation.

Is the glibc locale data really architecture-independent?

Is it not sufficient to have only "gzip" native here?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jjXoACgkQoqBt8qM6
VPpc3Qf+K60UnTJotiQBYYKi4KZovy/lT7fGpVukmMvB6EZLZzuLlDZl7T/KSVrN
sHIxy/FX8ctQP5CX8r2A5+g1Zx3MLYlApu2tk+Kxq9PmZO/HpLHYg3Ulky9ZlNq+
ik7bWUW/vCHlhOk3wROJGZaD/rTMfsTVlqiav0aAIC2VpbzWtn8+/dLwnEbPSncq
mdrogh1TjkPZv1cJFvp5BHdeqweSQzWND7LWTVWbHJWMog6NLIP8sgGwT8UbUyJx
efrM2rFvYsaBzyUEcLNahXXHAMoVKlYER5kjYmSwNlxpn0nML5OxI1EYUrlkFd4l
WD3gQEEM+96a2WMzQxCIOs5m0vJsOA==
=m1AV
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:25
Re: [bug#36477] [PATCH 26/31] gnu: tcsh: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87imsco02c.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/shells.scm (tcsh)[arguments]: Replace "cc" by "gcc" as
> native gethost compiler when cross-compiling.

LGTM.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jiqsACgkQoqBt8qM6
VPpfVAf/dOd9gHNvJe2RY77Y2Y6ddqaM3oA+MLRWORAHBdwiuKUpaDChOCmXbJvt
HuaHhC7/OcR7CWewAFeLCTR8pZJr9sseGA9Eq0V27lqmFHzFak6Jr1Zp9W3QfXY0
tZ/K4SDFleU6kRaLBXfvoBzDMvALMDWpUEZWntd3dHHK69M5FiT9Zb/eOh/pBEsn
5TpbVqIzA0vrhCpFoGO+hG0POlpVrr1DinsQIFt8BYPIglZcwPUtOr193ScrYiex
yjYmIENAjaOEpDLscmRCxHo4/OHRrc/L3TQ0PWSsxw3NBdHUoRyWlYhJH8hls4Mo
ksx78x1OL6JSYyz/H+T3+fDPd3nV5A==
=RjY9
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:25
Re: [bug#36477] [PATCH 25/31] gnu: libarchive: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87lfx8o031.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/backup.scm (libarchive)[arguments]: Do not build and run tests
> when cross-compiling.

[...]

Toggle quote (19 lines)
> @@ -226,17 +227,25 @@ backups (called chunks) to allow easy burning to CD/DVD.")
> (("/bin/pwd") (which "pwd")))
> #t))
> (replace 'check
> - (lambda _
> - ;; XXX: The test_owner_parse, test_read_disk, and
> - ;; test_write_disk_lookup tests expect user 'root' to exist, but
> - ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
> - ;;
> - ;; The tests allow one to disable tests matching a globbing pattern.
> - (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
> - ;; XXX: This glob disables too much.
> - (invoke "./libarchive_test" "^test_*_disk*")
> - (invoke "./bsdcpio_test" "^test_owner_parse")
> - (invoke "./bsdtar_test")))
> + ,@(if (%current-target-system)
> + '((lambda _
> + #t))

When I think about it, gnu-build-system already sets #:tests? #f when
cross-compiling. So this and similar changes can be rewritten to simply
check the tests? variable:

(replace 'check
(lambda* (#:key (tests? #t) #:allow-other-keys)
(if tests?
...
(format #t "test suite not run~%"))))

(obviously, you should check that this works instead of taking my word
for it. But it looks cleaner this way. LGTM anyway.)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jipMACgkQoqBt8qM6
VPpNjwf/cE/lMgzZBdidR8JcwEUetZikxQq9l3PAxEmuIMiTIcvKSPx/81E5hHWI
z8cIaSZSmlXZXSWHHZh4diIHYSpLmjfYdHJBJb+A/w3QgzL49GeIEkMoTJPFqale
MPYNCTeyXMS6iKAY7b8bjqJQfstUSFkGHcswtCWCf1BvbnEdNkChp1hILD7ErsAy
L2n2tTziGv+dqkWrb2EcpXzaEXyfpQ3Gse+51sjGmEaEx19VDjZYH6Dj4pUFhZe+
2Pu3ff6yQN+ce0cZ4KBrY63IvIPB7ZIW7tb5vbGYbfBwvmJ8WnbXP2NIYdwSNjpH
IqsLCc0+/ZH0ALR5fazBUxbE806mbQ==
=Iulc
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:30
Re: [bug#36477] [PATCH 29/31] gnu: alsa-utils: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87a7donzuc.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/linux.scm (alsa-utils)[inputs]: Move gettext from here ...
> [native-inputs]: ... to here, in order to fix cross-compilation.

LGTM.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0ji8sACgkQoqBt8qM6
VPpuMgf9HbFx4xJCv3XC1/06dDgU19IZBtrrrq9K19XlHrRLWGUl15KY/zMFNvzl
L8nSdIf0ZkenTfsDhhKNAL5RT/wg2Z8mvz9d31UEF3ROa9zPlrS87S/mXL6qMbnG
73UjTy8Wlu7qYcK9MwXS4e9IAmHaWpntedkrvEYIyrWJbjFrNE4coGyDknvbchQJ
E6vAMPC9DDnnfUGKWddTctpFT9eoqeAp4qWyIlC4A/saCdqqg1GtlQ0ocq1ElsSV
JUynUrHFj/eLN+/uuUOM+QMflsX5K4tH54clWYEapPzVti97gmVFak/4baieRh1d
E14GJI5k4vdeH1U5Fy/Hb9UPW2800g==
=I7qj
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:29
Re: [bug#36477] [PATCH 27/31] gnu: pkg-config: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87d0iknzvw.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (32 lines)
> * gnu/packages/pkg-config.scm (%pkg-config)[arguments]: Add configure-flags
> to disable tests that fail when cross-compiling.
> ---
> gnu/packages/pkg-config.scm | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm
> index 6fc19a975d..0425854a75 100644
> --- a/gnu/packages/pkg-config.scm
> +++ b/gnu/packages/pkg-config.scm
> @@ -1,5 +1,6 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -48,7 +49,15 @@
> (base32
> "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg"))))
> (build-system gnu-build-system)
> - (arguments `(#:configure-flags '("--with-internal-glib")))
> + (arguments
> + `(#:configure-flags
> + '("--with-internal-glib"
> + ,@(if (%current-target-system)
> + '("glib_cv_stack_grows=no"
> + "glib_cv_uscore=no"
> + "ac_cv_func_posix_getpwuid_r=yes"
> + "ac_cv_func_posix_getgrgid_r=yes")
> + '()))))

Are these indicative of a problem in our cross stack, or a bug in the
pkg-config build system/code?

LGTM anyway.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0ji5MACgkQoqBt8qM6
VPpibgf+NMR5RVPlJfqxRt2gxq6CR9N5NlxQdVBI9u9chpQGPYr2Va55KQfafsKM
K+6lG1VR3pgSJyR84nEGSq6PPtQW9MDrNx/LVH3eRzPde3YhFyCxARsOspYdgf/M
E/MztFkXLFYhuJx2AxT38FcOszBUu1lJiWvxykqFwCf7cQ3uAhiE/0fi8iQbFQ22
TEZk2otpseP+ItW7f80K4sDmVpAGsR3Bb2wbL0sI/zLJEIajskVaUrYCCPkhZRDG
xEDYSyzrnOQg2+7Y2eYEV/L+Oti6+u8wtLMqd7xwPwXiin280CfCTew8bfMoRgqH
RkekPAVOKgGpPWYtcpjCEvKg3jscNw==
=G7e9
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 8 Jul 2019 20:26
Re: [bug#36477] [PATCH 26/31] gnu: tcsh: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87ftngo00s.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (31 lines)
> * gnu/packages/shells.scm (tcsh)[arguments]: Replace "cc" by "gcc" as
> native gethost compiler when cross-compiling.
> ---
> gnu/packages/shells.scm | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
> index f8c0fdf71f..6eed89396e 100644
> --- a/gnu/packages/shells.scm
> +++ b/gnu/packages/shells.scm
> @@ -11,6 +11,7 @@
> ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
> ;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com>
> ;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
> +;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -356,6 +357,14 @@ written by Paul Haahr and Byron Rakitzis.")
> (arguments
> `(#:phases
> (modify-phases %standard-phases
> + ,@(if (%current-target-system)
> + '((add-before 'configure 'set-cross-cc
> + (lambda _
> + (substitute* "configure"
> + (("CC_FOR_GETHOST=\"cc\"")
> + "CC_FOR_GETHOST=\"gcc\""))
> + #t)))
> + '())

Actually, can we pass this in #:configure-flags instead? Maybe even
also for the native build?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0jiuMACgkQoqBt8qM6
VPri2Af/YdWKCbPuMZrLLmEL1Q4dQ9Ef+19u4KnS1Sp1iVleUqVcJeukQ3GMMCfp
z3YHkXZ969LzUcufbf9fWMj56QRRjhz4BoGR+9Am1w8uomqKasqNrsIV4P5cvBzZ
wQCxfzY+jWk3bdpRE+RfgZtuGE3CHGA1RAGSL0V4CBl9FtZQJsUPe6qrCJHjVWtu
+0Poly+Taw5dikOiuaGm9e5Ihk56hkrSG36gkgEjtU2HdzpwOpaAunvaDpRbH5if
JwIM6zbA9gRhBF3Fqeee0b8iMv4EKPg3tKVRVgCxkfS9jGSHfThS6LMf2pXHxZYh
FIUOVmed7T3nsM37GNxNAOGxbykIig==
=VFeG
-----END PGP SIGNATURE-----

E
E
Efraim Flashner wrote on 9 Jul 2019 08:14
Re: [bug#36477] [PATCH 15/31] gnu: libpaper: Fix aarch64 cross-compilation.
(name . Marius Bakke)(address . mbakke@fastmail.com)
20190709061421.GL1085@macbook41
On Mon, Jul 08, 2019 at 07:53:06PM +0200, Marius Bakke wrote:
Toggle quote (14 lines)
> Mathieu Othacehe <m.othacehe@gmail.com> writes:
>
> > The packaged config.sub and config.guess do not have aarch64 support. Replace
> > them by the ones from automake.
> >
> > * gnu/packages/ghostscript.scm (libpaper)[arguments]: Replace outdated config.sub and
> > config.guess, taken from ...
> > [native-inputs]: ... here, by adding automake.
>
> Native ghostscript is fine on AArch64, right? I would prefer to hold
> this patch for now, unless it's also needed for native builds.
>
> (maybe libpaper gets fixed upstream meanwhile...)

My aarch64 machine is still down right now. I don't recall having any
issues with ghostscript compiled natively on aarch64 in the past.


--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl0kMLkACgkQQarn3Mo9
g1E7BhAAgG7JyL4mftVDZBgfB1zN6QimaGi2vJtw0jikayZtxH8FidQPJACrgxnK
jENjh7ZjW1Pw87FxtAldHQEz5FbrNcz31FzVkslCwLci7qlocOJIKwtfR+UFfPXI
jE5kj7mJ+fERyYfqeC/8ODGzn22cUegpJiqtWuDaUf2Zf0tB7PS1SsEaYMDeV194
LSAFXrAeeO92W6wu1ULn2TugH4PFdwviivTmrqzQwXTqxmfDcYA+ChcGi6StLSp3
DUrIEi+oIv8Nvk+QshK9nMM+pvTRQYNg5gLujcfzb1t4g3qT6naUdbbUYGQTF893
TaVquxHPCX/whYBqf8GuNZfn/0zBiq6YTEC1iiO6r/2E8vbzDP+v3RJlWztWdc4/
jWw5XZ5Md5OutnDB6sLXh3a5QOplolgzP0gl6cj/FXW3LqFgBRWtG/MBrXnblmFJ
JYwBXtr0tF5hqtodvmv4j5Egb0EXwAe5q0bAIu6yhkpMr8Yb5giHRu3v+c/uEQET
msIFDBts+GFaLET1nSBNxusWg5h0pkf/QiEnqt9N2TIhi+DxgUP5wWHTXQvsbxWF
voDjryh3ULhPL03ok86MQslZosBm/riLRxA6EOpTJNKBM2kq0K9Q84W87FtbohIK
XRJYs9YZaIYKyC8Vhf8sjJOrwHHEvCe4CLIYlDL9QbcwYOY3JqY=
=IJcn
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 15 Jul 2019 22:20
Re: [bug#36477] [PATCH 02/31] gnu: python: Fix cross compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . 36477@debbugs.gnu.org)
87h87nhwxk.fsf@gnu.org
Hello,

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

Toggle quote (6 lines)
> * 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,
> [native-inputs]: Add self and which when cross-compiling,
> (python-3.7)[arguments]: Refer to native python when cross-compiling.

LGTM!

If you notice that it doesn’t entail a rebuild of Python 2 or 3, you can
apply it to ‘master’. Otherwise let’s discuss it (‘core-updates’ is now
frozen.)

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 15 Jul 2019 22:24
Re: [bug#36477] [PATCH 07/31] gnu: libgpg-error: Fix cross compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . 36477@debbugs.gnu.org)
877e8jhwqh.fsf@gnu.org
Hello,

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

Toggle quote (4 lines)
> * gnu/packages/gnupg.scm (libgpg-error)[arguments]: Add a lock-obj header to
> the target platform when cross-compiling,
> [native-inputs]: add gettext that is needed when cross-compiling.

[...]

Toggle quote (16 lines)
> + (arguments
> + (if (%current-target-system)
> + `(#:modules ((ice-9 match)
> + (guix build gnu-build-system)
> + (guix build utils))
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'cross-symlinks
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let* ((target ,(%current-target-system))
> + (tuple
> + (match (string-take target (string-index target #\-))
> + ("armhf" "arm-unknown-linux-gnueabi")
> + (x
> + (string-append x "-unknown-linux-gnu")))))

Two things:

1. s/tuple/triplet/

2. The target triplet is actually passed as a keyword argument to
phases. So if I’m not mistaken, you can write:

(lambda* (#:key target …)
…)

and get rid of the ‘match’ form above.

Toggle quote (4 lines)
> + (symlink
> + (string-append "lock-obj-pub." tuple ".h")
> + "src/syscfg/lock-obj-pub.linux-gnu.h"))

If possible, a short comment or a link to some upstream discussion that
explains this would be helpful.

Could you send an updated patch?

Thank you,
Ludo’.
L
L
Ludovic Courtès wrote on 15 Jul 2019 22:29
Re: [bug#36477] [PATCH 08/31] gnu: python: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . 36477@debbugs.gnu.org)
87wogjghyr.fsf@gnu.org
This is the second patch in this series with this subject, which
suggests the subject could be adjusted. :-)

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

Toggle quote (8 lines)
> * gnu/packages/patches/python-2.7-search-paths.patch: Add cross-compilation
> support.
> * gnu/packages/patches/python-3-search-paths.patch: Ditto.
> * gnu/packages/patches/python-cross-compile.patch: New patch.
> * gnu/local.mk (dist_patch_DATA): Add above new patch.
> * gnu/packages/python.scm (python-2.7)[patches]: Add new patch above,
> [arguments]: Set _PYTHON_HOST_PLATFORM env variable when cross compiling.

[...]

Toggle quote (13 lines)
> +++ b/gnu/packages/patches/python-cross-compile.patch
> @@ -0,0 +1,145 @@
> +Patch taken from https://bugs.python.org/issue22724 and augmented with
> +following Nix patch
> +https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/python/cpython/2.7/cross-compile.patch
> +to fix the whole cross-compilation circus.
> +
> +---
> + Makefile.pre.in | 14 +++++++-------
> + configure | 5 ++++-
> + setup.py | 9 ++++++---
> + 3 files changed, 17 insertions(+), 11 deletions(-)

Heh, a non trivial patch!

Toggle quote (10 lines)
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -109,7 +109,8 @@
> "python-2-deterministic-build-info.patch"
> "python-2.7-site-prefixes.patch"
> "python-2.7-source-date-epoch.patch"
> - "python-2.7-adjust-tests.patch"))
> + "python-2.7-adjust-tests.patch"
> + "python-cross-compile.patch"))

Note that this triggers a full rebuild, so we’ll probably have to wait
for the next ‘core-updates’ branch, which we’ll hopefully open soonish.

Toggle quote (6 lines)
> 'configure 'patch-lib-shells
> (lambda _
> + ,@(if (%current-target-system)
> + '((setenv "_PYTHON_HOST_PLATFORM" ""))
> + '())

It would be great if you could add a comment saying what component
consumes this environment variable.

Otherwise LGTM.

Thanks!

Ludo’.
M
M
Mathieu Othacehe wrote on 25 Jul 2019 15:10
Re: [bug#36477] [PATCH 00/31] Fix cross-compilation issues
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87v9vqi7jx.fsf@gmail.com
Hey,

Toggle quote (2 lines)
> This is very impressive work, thank you!

Thank you for reviewing this whole serie :).

Toggle quote (6 lines)
>
> I'm not comfortable pulling in all of this on 'core-updates' right now.
> There are already a huge pile of changes that have not really
> "stabilized" yet. So my preference is to wait until the next round
> (probably around October/November).

Ok I rebased the branch on core-updates (and discovered you fixed
some issues I had with cross gcc-7 !). Now we can wait for the next
window to merge those changes in core-updates-next.

I'll send an updated version of the serie taking your remarks into
account.

Thanks,

Mathieu
M
M
Mathieu Othacehe wrote on 25 Jul 2019 15:12
Re: [bug#36477] [PATCH 06/31] gnu: xorg: Fix cross-compilation of multiple packages.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87tvbai7h3.fsf@gmail.com
Toggle quote (3 lines)
> Have you checked that this is still a problem with the newer versions of
> these on core-updates?

Yes sadly, there's the same problem with the newer versions of Xorg
packages.

Mathieu
M
M
Mathieu Othacehe wrote on 25 Jul 2019 15:25
Re: [bug#36477] [PATCH 09/31] gnu: http-parser: Fix cross-compilation.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87o91ii6ur.fsf@gmail.com
Toggle quote (3 lines)
> I would prefer to splice in this phase instead of adding a noop phase to
> the native build. LGTM otherwise.

Ok.

Toggle quote (3 lines)
>
> (so I guess CC=gcc was not needed for native builds?)

In fact it was needed for native build, I reverted this chunk.

Mathieu
M
M
Mathieu Othacehe wrote on 25 Jul 2019 15:33
Re: [bug#36477] [PATCH 12/31] gnu: cmake: Extend CMAKE_PREFIX_PATH to non-native inputs.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87muh2i6hc.fsf@gmail.com
Toggle quote (2 lines)
> Does this still do the right thing in a native context?

My understanding is that in native context CMAKE_PREFIX_PATH will still
have the same value and it will be augmented with inputs in a
cross-build context.

Mathieu
M
M
Mathieu Othacehe wrote on 25 Jul 2019 15:48
Re: [bug#36477] [PATCH 21/31] gnu: mit-krb5: Fix cross-compilation.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87lfwmi5rr.fsf@gmail.com
Toggle quote (3 lines)
> Have you checked whether these (strange!) configure flags are needed
> with the newer version on 'core-updates'?

Yup still needed!

Toggle quote (9 lines)
> I have a slight preference for not passing #:make-flags etc at all in
> the normal context. E.g.
>
> ,@(if (%current-target-system)
> `(#:configure-flags ...)
> '())
>
> ...but no strong opinion.

Ok I'll patch it.

Mathieu
M
M
Mathieu Othacehe wrote on 25 Jul 2019 16:28
Re: [bug#36477] [PATCH 23/31] gnu: help2man: Fix cross-compilation.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87k1c6i3y6.fsf@gmail.com
Toggle quote (3 lines)
> help2man references perl at runtime, should it not be in both inputs and
> native-inputs?

help2man being a perl script I guess you are right.

Mathieu
M
M
Mathieu Othacehe wrote on 25 Jul 2019 17:23
Re: [bug#36477] [PATCH 26/31] gnu: tcsh: Fix cross-compilation.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87imrqi1e8.fsf@gmail.com
Toggle quote (16 lines)
>> @@ -356,6 +357,14 @@ written by Paul Haahr and Byron Rakitzis.")
>> (arguments
>> `(#:phases
>> (modify-phases %standard-phases
>> + ,@(if (%current-target-system)
>> + '((add-before 'configure 'set-cross-cc
>> + (lambda _
>> + (substitute* "configure"
>> + (("CC_FOR_GETHOST=\"cc\"")
>> + "CC_FOR_GETHOST=\"gcc\""))
>> + #t)))
>> + '())
>
> Actually, can we pass this in #:configure-flags instead? Maybe even
> also for the native build?

Sadly I think we cannot. The problematic piece is:

Toggle snippet (9 lines)
dnl Require build CC to create gethost helper when cross building
if test "x${cross_compiling}" = xyes ; then
CC_FOR_GETHOST="cc"
else
CC_FOR_GETHOST="\$(CC)"
fi
AC_SUBST(CC_FOR_GETHOST)

CC_FOR_GETHOST cannot be overwritten by a configure-flag.

Mathieu
M
M
Mathieu Othacehe wrote on 25 Jul 2019 17:27
Re: [bug#36477] [PATCH 27/31] gnu: pkg-config: Fix cross-compilation.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
87h87ai16x.fsf@gmail.com
Toggle quote (5 lines)
> Are these indicative of a problem in our cross stack, or a bug in the
> pkg-config build system/code?
>
> LGTM anyway.

No those bits seems to be needed because of a problem in pkg-config
itself. See this nixpkg pkg-config package snippet:

Toggle snippet (11 lines)
configureFlags = [ "--with-internal-glib" ]
++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ]
# Can't run these tests while cross-compiling
++ optional (stdenv.hostPlatform != stdenv.buildPlatform)
[ "glib_cv_stack_grows=no"
"glib_cv_uscore=no"
"ac_cv_func_posix_getpwuid_r=yes"
"ac_cv_func_posix_getgrgid_r=yes"
];

Mathieu
R
R
Ricardo Wurmus wrote on 25 Jul 2019 21:04
(address . m.othacehe@gmail.com)
87tvba7x6v.fsf@elephly.net
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (20 lines)
>> Are these indicative of a problem in our cross stack, or a bug in the
>> pkg-config build system/code?
>>
>> LGTM anyway.
>
> No those bits seems to be needed because of a problem in pkg-config
> itself. See this nixpkg pkg-config package snippet:
>
> --8<---------------cut here---------------start------------->8---
> configureFlags = [ "--with-internal-glib" ]
> ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ]
> # Can't run these tests while cross-compiling
> ++ optional (stdenv.hostPlatform != stdenv.buildPlatform)
> [ "glib_cv_stack_grows=no"
> "glib_cv_uscore=no"
> "ac_cv_func_posix_getpwuid_r=yes"
> "ac_cv_func_posix_getgrgid_r=yes"
> ];
> --8<---------------cut here---------------end--------------->8---

In this case it would be good to add a comment so that our future selves
won’t be confused.

Thanks!

--
Ricardo
M
M
Mathieu Othacehe wrote on 29 Jul 2019 16:54
Re: [bug#36477] [PATCH 31/31] gnu: glibc-utf8-locales: Fix cross-compilation.
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36477@debbugs.gnu.org)
877e80j3hm.fsf@gmail.com
Hello Marius,

Toggle quote (2 lines)
> Is the glibc locale data really architecture-independent?

I compared locale data built natively for intel and arm and they are
identical. However all those platforms have the same endianess. I don't
know what would happend on a big endian platform.

Toggle quote (3 lines)
>
> Is it not sufficient to have only "gzip" native here?

No because we need to use the localedef binary from the native glibc.

Ideally, we would need to pass some kind of --target to this binary but
it doesn't seem to be supported :(.

Mathieu
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:47
[PATCH v2 00/61] Add --target support to guix system
(address . 36477@debbugs.gnu.org)
87wof6x5v4.fsf@gmail.com
Hi,

Here's a serie to add target support to guix system command. Most of the
patches were reviewed in v1 by Marius and Ludo, but this serie adds some more
patches to complete target support.

Using the dummy system in attachment, I'm able to generate a cross-built guix
system with this command:

Toggle snippet (3 lines)
./pre-inst-env guix system disk-image gnu/system/examples/mini.scm --target=aarch64-linux-gnu

Some of the patches in this serie are from a friend Pierre-Moana who
helped me much here.

Next step is to find an aarch64 board and boot it with a cross-built
guix system!

I pushed those patches to wip-cross-system branch of savannah.

Thanks,

Mathieu
Attachment: mini.scm
Mathieu Othacehe (52):
gnu: perl: Fix cross-compilation.
gnu: python: Fix cross compilation.
gnu: tcl: Fix cross-compilation.
gnu: tk: Fix cross-compilation.
gnu: libxslt: Fix cross-compilation.
gnu: xorg: Fix cross-compilation of multiple packages.
gnu: libgpg-error: Fix cross compilation.
gnu: python: Further cross-compilation fixes.
gnu: http-parser: Fix cross-compilation.
gnu: openssl: Fix cross-compilation.
gnu: texinfo: Fix cross-compilation.
gnu: cmake: Fix cross-compilation.
gnu: libgit2: Fix cross compilation.
gnu: ath9k-htc-firmware: Fix cross compilation.
gnu: libpaper: Fix aarch64 cross-compilation.
gnu: groff: Fix cross compilation.
gnu: bc: Fix cross-compilation.
gnu: indent: Fix aarch64 cross-compilation.
gnu: libsamplerate: Fix aarch64 cross-compilation.
gnu: mit-krb5: Fix cross-compilation.
gnu: cyrus-sasl: Fix cross-compilation.
gnu: help2man: Fix cross-compilation.
gnu: xmlto: Fix cross-compilation.
gnu: libarchive: Fix cross-compilation.
gnu: tcsh: Fix cross-compilation.
gnu: pkg-config: Fix cross-compilation.
gnu: mkfontdir: Fix aarch64 cross-compilation.
gnu: alsa-utils: Fix cross-compilation.
gnu: icu4c: Fix cross-compilation.
gnu: glibc-utf8-locales: Fix cross-compilation.
gnu: boost: Fix cross-compilation.
gnu: eudev: Fix cross-compilation.
gnu: lvm2: Fix cross-compilation.
gnu: openldap: Fix cross-compilation.
gnu: swig: Fix cross-compilation.
gnu: git: Fix cross-compilation.
gnu: make-linux-libre: Fix cross-compilation.
gnu: procps: Fix cross-compilation.
gnu: doxygen: Fix cross-compilation.
gnu: guile-sqlite3: Fix cross-compilation.
gnu: guile-gcrypt: Fix cross-compilation.
gnu: console-setup: Fix cross-compilation.
gnu: mdadm: Fix cross-compilation.
gnu: grub: Fix cross-compilation.
linux-initrd: Use native gzip.
gnu: linux-libre: Enable built-in ext4 support.
gexp: Use cross extensions when cross-compiling.
gexp: Pass target to compiled-modules in lower-gexp.
utils: Use target-arm64? and target-arm? helpers.
system: vm: Add arm64 support.
system: vm: Support cross-compilation.
scripts: system: Add --target option.

Pierre-Moana Levesque (9):
gnu: texinfo-5: Fix cross-compilation.
gnu: nghttp2: Fix cross-compilation.
gnu: libtool: Fix cross-compilation.
gnu: texinfo-4: Fix cross compilation
gnu: libnl: Fix cross-compilation.
gnu: crda: Fix cross-compilation
gnu: guile-xcb: Fix cross-compilation.
gnu: guile-wm: Fix cross-compilation.
gnu: cmake: Fix cross-compilation.

gnu/build/vm.scm | 22 +-
gnu/local.mk | 6 +
gnu/packages/algebra.scm | 15 +-
gnu/packages/autotools.scm | 10 +-
.../aux-files/linux-libre/5.2-arm64.conf | 2 +-
gnu/packages/backup.scm | 47 +-
gnu/packages/base.scm | 4 +-
gnu/packages/boost.scm | 28 +-
gnu/packages/bootloaders.scm | 6 +-
gnu/packages/cmake.scm | 14 +-
gnu/packages/code.scm | 18 +-
gnu/packages/commencement.scm | 11 +-
gnu/packages/cyrus-sasl.scm | 17 +-
gnu/packages/documentation.scm | 12 +-
gnu/packages/firmware.scm | 5 +-
gnu/packages/ghostscript.scm | 19 +
gnu/packages/gnupg.scm | 47 +-
gnu/packages/groff.scm | 40 +-
gnu/packages/guile-wm.scm | 8 +-
gnu/packages/guile.scm | 7 +-
gnu/packages/icu4c.scm | 35 +-
gnu/packages/kerberos.scm | 21 +-
gnu/packages/linux.scm | 127 ++++--
gnu/packages/man.scm | 2 +
gnu/packages/openldap.scm | 30 +-
.../patches/bc-fix-cross-compilation.patch | 171 +++++++
gnu/packages/patches/boost-dumpversion.patch | 24 +
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 +
.../guile-gcrypt-fix-cross-compilation.patch | 431 ++++++++++++++++++
.../guile-sqlite3-fix-cross-compilation.patch | 55 +++
.../patches/python-2.7-search-paths.patch | 10 +-
.../patches/python-3-search-paths.patch | 11 +-
.../patches/python-cross-compile.patch | 145 ++++++
gnu/packages/perl.scm | 7 +-
gnu/packages/pkg-config.scm | 13 +-
gnu/packages/pulseaudio.scm | 22 +-
gnu/packages/python.scm | 54 ++-
gnu/packages/shells.scm | 9 +
gnu/packages/swig.scm | 1 +
gnu/packages/tcl.scm | 28 +-
gnu/packages/texinfo.scm | 63 ++-
gnu/packages/tls.scm | 62 ++-
gnu/packages/version-control.scm | 40 +-
gnu/packages/web.scm | 25 +-
gnu/packages/xml.scm | 4 +
gnu/packages/xorg.scm | 60 ++-
gnu/system.scm | 15 +-
gnu/system/linux-initrd.scm | 2 +-
gnu/system/vm.scm | 42 +-
guix/build-system/cmake.scm | 9 +-
guix/gexp.scm | 5 +-
guix/scripts/system.scm | 15 +-
guix/utils.scm | 8 +
53 files changed, 1687 insertions(+), 209 deletions(-)
create mode 100644 gnu/packages/patches/bc-fix-cross-compilation.patch
create mode 100644 gnu/packages/patches/boost-dumpversion.patch
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
create mode 100644 gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch
create mode 100644 gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
create mode 100644 gnu/packages/patches/python-cross-compile.patch

--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:53
[PATCH v2 01/61] gnu: perl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-1-m.othacehe@gmail.com
* 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(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index a3f6e5d050..275cb20d89 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
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:53
[PATCH v2 02/61] gnu: python: Fix cross compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-2-m.othacehe@gmail.com
* gnu/packages/python.scm (python-2.7)[arguments]: Add a configure flag to
disable a check failing when cross-compiling. This is covered here:
[native-inputs]: Add self and which when cross-compiling,
(python-3.7)[arguments]: Refer to native python when cross-compiling.
---
gnu/packages/python.scm | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)

Toggle diff (67 lines)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 9fec18287e..09c1f7d716 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>
@@ -150,6 +150,13 @@
"INSTALL=install -c"
"MKDIR_P=mkdir -p"
+ ;; Disable runtime check failing if cross-compiling, see:
+ ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+ ,@(if (%current-target-system)
+ '("ac_cv_buggy_getaddrinfo=no"
+ "ac_cv_file__dev_ptmx=no"
+ "ac_cv_file__dev_ptc=no")
+ '())
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out") "/lib"))
;; With no -j argument tests use all available cpus, so provide one.
@@ -292,7 +299,12 @@
("tcl" ,tcl)
("tk" ,tk))) ; for tkinter
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ;; When cross-compiling, a native version of Python itself is needed.
+ ,@(if (%current-target-system)
+ `(("self" ,this-package)
+ ("which" ,which))
+ '())))
(native-search-paths
(list (search-path-specification
(variable "PYTHONPATH")
@@ -388,13 +400,16 @@ data types.")
(if (null? opt) "none" (car opt)))
(for-each (lambda (file)
(apply invoke
- `(,(string-append out "/bin/python3")
- ,@opt
- "-m" "compileall"
- "-f" ; force rebuild
- ;; Don't build lib2to3, because it's Python 2 code.
- "-x" "lib2to3/.*"
- ,file)))
+ `(,,(if (%current-target-system)
+ "python3"
+ '(string-append out
+ "/bin/python3"))
+ ,@opt
+ "-m" "compileall"
+ "-f" ; force rebuild
+ ;; Don't build lib2to3, because it's Python 2 code.
+ "-x" "lib2to3/.*"
+ ,file)))
(find-files out "\\.py$")))
(list '() '("-O") '("-OO")))
#t)))))))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:53
[PATCH v2 03/61] gnu: tcl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-3-m.othacehe@gmail.com
* gnu/packages/tcl.scm (tcl)[arguments]: Add configure flags to fix
cross-compilation.
---
gnu/packages/tcl.scm | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

Toggle diff (35 lines)
diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index 21ca185066..96f41e7928 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -53,7 +53,7 @@
"0kjzj7mkzfnb7ksxanbibibfpciyvsh5ffdlhs0bmfc75kgd435d"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
+ `(#:phases (modify-phases %standard-phases
(add-before 'configure 'pre-configure
(lambda _ (chdir "unix") #t))
(add-after 'install 'install-private-headers
@@ -73,9 +73,16 @@
;; PREFIX/share/man. The 'validate-documentation-location' phase is
;; not able to fix this up because the default install populates both
;; PREFIX/man and PREFIX/share/man.
- #:configure-flags (list (string-append "--mandir="
- (assoc-ref %outputs "out")
- "/share/man"))
+ #:configure-flags
+ (list (string-append "--mandir="
+ (assoc-ref %outputs "out")
+ "/share/man")
+ ;; This is needed when cross-compiling, see:
+ ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
+ ,@(if (%current-target-system)
+ '("tcl_cv_strtod_buggy=1"
+ "ac_cv_func_strtod=yes")
+ '()))
;; XXX: There are a few test failures (related to HTTP, most
;; likely related to name resolution), but that doesn't cause
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:53
[PATCH v2 04/61] gnu: tk: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-4-m.othacehe@gmail.com
* gnu/packages/tcl.scm (tk)[arguments]: Add configure flags to fix
cross-compilation.
---
gnu/packages/tcl.scm | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index 96f41e7928..9ef95b42ed 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -186,9 +186,16 @@ X11 GUIs.")
"/lib -lfontconfig")))
#t))))
- #:configure-flags (list (string-append "--with-tcl="
- (assoc-ref %build-inputs "tcl")
- "/lib"))
+ #:configure-flags
+ (list (string-append "--with-tcl="
+ (assoc-ref %build-inputs "tcl")
+ "/lib")
+ ;; This is needed when cross-compiling, see:
+ ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
+ ,@(if (%current-target-system)
+ '("tcl_cv_strtod_buggy=1"
+ "ac_cv_func_strtod=yes")
+ '()))
;; The tests require a running X server, so we just skip them.
#:tests? #f))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:53
[PATCH v2 05/61] gnu: libxslt: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-5-m.othacehe@gmail.com
* gnu/packages/xml.scm (libxslt)[native-inputs]: Add pkg-config.
---
gnu/packages/xml.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 78b9b713e5..ffe81fa68b 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -213,6 +213,8 @@ project (but it is usable outside of the Gnome platform).")
("libxml2" ,libxml2)
("python" ,python-minimal-wrapper)
("zlib" ,zlib)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
(description
"Libxslt is an XSLT C library developed for the GNOME project. It is
based on libxml for XML parsing, tree manipulation and XPath support.")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 06/61] gnu: xorg: Fix cross-compilation of multiple packages.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-6-m.othacehe@gmail.com
* gnu/packages/xorg.scm (libxext)[arguments]: Disable zero malloc check that
fails when cross-compiling,
(libxrender)[arguments]: ditto,
(libx11)[arguments]: ditto.
---
gnu/packages/xorg.scm | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)

Toggle diff (61 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index e4848b7bee..aa89dafe90 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -4552,6 +4552,13 @@ cannot be adequately worked around on the client side of the wire.")
(base32
"0azqxllcsfxc3ilhz6kwc6x7m8wc477p59ir9p0yrsldx766zbar"))))
(build-system gnu-build-system)
+ ;; Disable zero malloc check that fails when cross-compiling.
+ (arguments
+ `(#:configure-flags
+ (list
+ ,@(if (%current-target-system)
+ '("--disable-malloc0returnsnull")
+ '()))))
(propagated-inputs
`(("xorgproto" ,xorgproto)))
(inputs
@@ -4637,6 +4644,13 @@ cannot be adequately worked around on the client side of the wire.")
(base32
"0j89cnb06g8x79wmmnwzykgkkfdhin9j7hjpvsxwlr3fz1wmjvf0"))))
(build-system gnu-build-system)
+ ;; Disable zero malloc check that fails when cross-compiling.
+ (arguments
+ `(#:configure-flags
+ (list
+ ,@(if (%current-target-system)
+ '("--disable-malloc0returnsnull")
+ '()))))
(propagated-inputs
`(("xorgproto" ,xorgproto)))
(inputs
@@ -5245,16 +5259,22 @@ draggable titlebars and borders.")
(outputs '("out"
"doc")) ;8 MiB of man pages + XML
(arguments
- '(#:configure-flags (list (string-append "--mandir="
- (assoc-ref %outputs "doc")
- "/share/man"))))
+ `(#:configure-flags
+ (list (string-append "--mandir="
+ (assoc-ref %outputs "doc")
+ "/share/man")
+ ;; Disable zero malloc check that fails when cross-compiling.
+ ,@(if (%current-target-system)
+ '("--disable-malloc0returnsnull")
+ '()))))
(propagated-inputs
`(("xorgproto" ,xorgproto)
("libxcb" ,libxcb)))
(inputs
`(("xtrans" ,xtrans)))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("xorgproto" ,xorgproto)))
(home-page "https://www.x.org/wiki/")
(synopsis "Xorg Core X11 protocol client library")
(description "Xorg Core X11 protocol client library.")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 07/61] gnu: libgpg-error: Fix cross compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-7-m.othacehe@gmail.com
* gnu/packages/gnupg.scm (libgpg-error)[arguments]: Add a lock-obj header to
the target platform when cross-compiling,
[native-inputs]: add gettext that is needed when cross-compiling.
---
gnu/packages/gnupg.scm | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 95a35368fa..c7e6aabf79 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -15,7 +15,7 @@
;;; Copyright © 2017 Petter <petter@mykolab.ch>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -96,6 +96,31 @@
(("namespace=errnos") "pkg_namespace=errnos"))
#t))))
(build-system gnu-build-system)
+ (arguments
+ (if (%current-target-system)
+ `(#:modules ((ice-9 match)
+ (guix build gnu-build-system)
+ (guix build utils))
+ #:phases
+ (modify-phases %standard-phases
+ ;; When cross-compiling, some platform specific properties cannot
+ ;; be detected. Create a symlink to the appropriate platform
+ ;; file. See Cross-Compiling section at:
+ ;; https://github.com/gpg/libgpg-error/blob/master/README
+ (add-after 'unpack 'cross-symlinks
+ (lambda* (#:key target inputs #:allow-other-keys)
+ (let ((triplet
+ (match (string-take target
+ (string-index target #\-))
+ ("armhf" "arm-unknown-linux-gnueabi")
+ (x
+ (string-append x "-unknown-linux-gnu")))))
+ (symlink
+ (string-append "lock-obj-pub." triplet ".h")
+ "src/syscfg/lock-obj-pub.linux-gnu.h"))
+ #t))))
+ '()))
+ (native-inputs `(("gettext" ,gettext-minimal)))
(home-page "https://gnupg.org")
(synopsis "Library of error values for GnuPG components")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 08/61] gnu: python: Further cross-compilation fixes.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-8-m.othacehe@gmail.com
* gnu/packages/patches/python-2.7-search-paths.patch: Add cross-compilation
support.
* gnu/packages/patches/python-3-search-paths.patch: Ditto.
* gnu/packages/patches/python-cross-compile.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add above new patch.
* gnu/packages/python.scm (python-2.7)[patches]: Add new patch above,
[arguments]: Set _PYTHON_HOST_PLATFORM env variable when cross compiling.
---
gnu/local.mk | 1 +
.../patches/python-2.7-search-paths.patch | 10 +-
.../patches/python-3-search-paths.patch | 11 +-
.../patches/python-cross-compile.patch | 145 ++++++++++++++++++
gnu/packages/python.scm | 23 ++-
5 files changed, 181 insertions(+), 9 deletions(-)
create mode 100644 gnu/packages/patches/python-cross-compile.patch

Toggle diff (287 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0002f49409..07be1f205b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1232,6 +1232,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-CVE-2018-14647.patch \
%D%/packages/patches/python-axolotl-AES-fix.patch \
%D%/packages/patches/python-cairocffi-dlopen-path.patch \
+ %D%/packages/patches/python-cross-compile.patch \
%D%/packages/patches/python-cffi-x87-stack-clean.patch \
%D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \
%D%/packages/patches/python-configobj-setuptools.patch \
diff --git a/gnu/packages/patches/python-2.7-search-paths.patch b/gnu/packages/patches/python-2.7-search-paths.patch
index a012bc8fe0..5a345c7691 100644
--- a/gnu/packages/patches/python-2.7-search-paths.patch
+++ b/gnu/packages/patches/python-2.7-search-paths.patch
@@ -3,13 +3,17 @@ looking for headers and libraries.
--- Python-2.7.10/setup.py 2015-10-07 18:33:18.125153186 +0200
+++ Python-2.7.10/setup.py 2015-10-07 18:33:47.497347552 +0200
-@@ -526,6 +526,10 @@ class PyBuildExt(build_ext):
+@@ -526,6 +526,14 @@ class PyBuildExt(build_ext):
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ # Always honor these variables.
-+ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+ inc_dirs += os.getenv('CPATH', '').split(os.pathsep)
++ if not cross_compiling:
++ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
++ inc_dirs += os.getenv('CPATH', '').split(os.pathsep)
++ else:
++ lib_dirs = os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep)
++ inc_dirs = os.getenv('CROSS_CPATH', '').split(os.pathsep)
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if host_platform in ['osf1', 'unixware7', 'openunix8']:
diff --git a/gnu/packages/patches/python-3-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch
index 5fea9c66b6..cf1647207b 100644
--- a/gnu/packages/patches/python-3-search-paths.patch
+++ b/gnu/packages/patches/python-3-search-paths.patch
@@ -3,7 +3,7 @@ looking for headers and libraries.
--- a/setup.py 2015-10-07 23:32:58.891329173 +0200
+++ b/setup.py 2015-10-07 23:46:29.653349924 +0200
-@@ -575,8 +575,8 @@
+@@ -575,15 +575,15 @@
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
if not cross_compiling:
@@ -14,3 +14,12 @@ looking for headers and libraries.
else:
# Add the sysroot paths. 'sysroot' is a compiler option used to
# set the logical path of the standard system headers and
+ # libraries.
+- lib_dirs = (self.compiler.library_dirs +
++ lib_dirs = (os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep) +
+ sysroot_paths(('LDFLAGS', 'CC'), system_lib_dirs))
+- inc_dirs = (self.compiler.include_dirs +
++ inc_dirs = (os.getenv('CROSS_CPATH', '').split(os.pathsep) +
+ sysroot_paths(('CPPFLAGS', 'CFLAGS', 'CC'),
+ system_include_dirs))
+ exts = []
diff --git a/gnu/packages/patches/python-cross-compile.patch b/gnu/packages/patches/python-cross-compile.patch
new file mode 100644
index 0000000000..5a470e1852
--- /dev/null
+++ b/gnu/packages/patches/python-cross-compile.patch
@@ -0,0 +1,145 @@
+Patch taken from https://bugs.python.org/issue22724 and augmented with
+following Nix patch
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/python/cpython/2.7/cross-compile.patch
+to fix the whole cross-compilation circus.
+
+---
+ Makefile.pre.in | 14 +++++++-------
+ configure | 5 ++++-
+ setup.py | 9 ++++++---
+ 3 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 2a14f3323b..6239fc32fc 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -492,7 +492,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
+ platform: $(BUILDPYTHON) pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+@@ -503,7 +503,7 @@ platform: $(BUILDPYTHON) pybuilddir.txt
+ # or removed in case of failure.
+ pybuilddir.txt: $(BUILDPYTHON)
+ @echo "none" > ./pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
+ if test $$? -ne 0 ; then \
+ echo "generate-posix-vars failed" ; \
+ rm -f ./pybuilddir.txt ; \
+@@ -525,7 +525,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ esac; \
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
++ $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+
+ # Build static library
+ # avoid long command lines, same as LIBRARY_OBJS
+@@ -928,7 +928,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKI
+ upgrade) ensurepip="--upgrade" ;; \
+ install|*) ensurepip="" ;; \
+ esac; \
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+@@ -939,7 +939,7 @@ altinstall: commoninstall
+ upgrade) ensurepip="--altinstall --upgrade --no-default-pip" ;; \
+ install|*) ensurepip="--altinstall --no-default-pip" ;; \
+ esac; \
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+@@ -1270,7 +1270,7 @@ libainstall: @DEF_MAKE_RULE@ python-config
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
+ sharedinstall: sharedmods
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+@@ -1344,7 +1344,7 @@ frameworkinstallextras:
+ # This installs a few of the useful scripts in Tools/scripts
+ scriptsinstall:
+ SRCDIR=$(srcdir) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
++ $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --root=$(DESTDIR)/
+diff --git a/configure b/configure
+index 67300fe2b6..6050f588c5 100755
+--- a/configure
++++ b/configure
+@@ -741,6 +741,7 @@ CONFIG_ARGS
+ SOVERSION
+ VERSION
+ PYTHON_FOR_BUILD
++PY_BUILD_ENVIRON
+ PYTHON_FOR_REGEN
+ host_os
+ host_vendor
+@@ -2964,7 +2965,8 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
+ $as_echo "$interp" >&6; }
+- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++ PY_BUILD_ENVIRON='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR)'
++ PYTHON_FOR_BUILD=$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
+@@ -2974,6 +2976,7 @@ fi
+
+
+
++
+ if test "$prefix" != "/"; then
+ prefix=`echo "$prefix" | sed -e 's/\/$//g'`
+ fi
+diff --git a/setup.py b/setup.py
+index cb47a2339c..472e7e2b26 100644
+--- a/setup.py
++++ b/setup.py
+@@ -497,8 +497,6 @@ class PyBuildExt(build_ext):
+ if not cross_compiling:
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+- if cross_compiling:
+- self.add_gcc_paths()
+ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -556,7 +554,10 @@ class PyBuildExt(build_ext):
+ # be assumed that no additional -I,-L directives are needed.
+ inc_dirs = self.compiler.include_dirs[:]
+ lib_dirs = self.compiler.library_dirs[:]
+- if not cross_compiling:
++ if cross_compiling:
++ inc_dirs = []
++ lib_dirs = []
++ else:
+ for d in (
+ '/usr/include',
+ ):
+@@ -621,6 +622,8 @@ class PyBuildExt(build_ext):
+ # Some modules that are normally always on:
+ #exts.append( Extension('_weakref', ['_weakref.c']) )
+
++ self.compiler.library_dirs = lib_dirs + [ '.' ]
++
+ # array objects
+ exts.append( Extension('array', ['arraymodule.c']) )
+
+--
+2.17.1
+
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 09c1f7d716..8241c09d37 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -109,7 +109,8 @@
"python-2-deterministic-build-info.patch"
"python-2.7-site-prefixes.patch"
"python-2.7-source-date-epoch.patch"
- "python-2.7-adjust-tests.patch"))
+ "python-2.7-adjust-tests.patch"
+ "python-cross-compile.patch"))
(modules '((guix build utils)))
(snippet
'(begin
@@ -177,6 +178,12 @@
(add-before
'configure 'patch-lib-shells
(lambda _
+ ;; This variable is used in setup.py to enable cross compilation
+ ;; specific switches. As it is not set properly by configure
+ ;; script, set it manually.
+ ,@(if (%current-target-system)
+ '((setenv "_PYTHON_HOST_PLATFORM" ""))
+ '())
;; Filter for existing files, since some may not exist in all
;; versions of python that are built with this recipe.
(substitute* (filter file-exists?
@@ -256,7 +263,9 @@
(if (null? opt) "none" (car opt)))
(for-each (lambda (file)
(apply invoke
- `(,(string-append out "/bin/python")
+ `(,,(if (%current-target-system)
+ "python2"
+ '(string-append out "/bin/python"))
,@opt
"-m" "compileall"
"-f" ; force rebuild
@@ -302,7 +311,7 @@
`(("pkg-config" ,pkg-config)
;; When cross-compiling, a native version of Python itself is needed.
,@(if (%current-target-system)
- `(("self" ,this-package)
+ `(("python2" ,this-package)
("which" ,which))
'())))
(native-search-paths
@@ -376,10 +385,11 @@ data types.")
((#:phases phases)
`(modify-phases ,phases
(add-before 'check 'set-TZDIR
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
;; test_email requires the Olson time zone database.
(setenv "TZDIR"
- (string-append (assoc-ref inputs "tzdata")
+ (string-append (assoc-ref
+ (or native-inputs inputs) "tzdata")
"/share/zoneinfo"))
#t))
;; Unset SOURCE_DATE_EPOCH while running the test-suite and set it
@@ -415,6 +425,9 @@ data types.")
#t)))))))
(native-inputs
`(("tzdata" ,tzdata-for-tests)
+ ,@(if (%current-target-system)
+ `(("python3" ,this-package))
+ '())
,@(package-native-inputs python-2)))
(native-search-paths
(list (search-path-specification
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 11/61] gnu: texinfo: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-11-m.othacehe@gmail.com
* gnu/packages/texinfo.scm (texinfo)[arguments]: Do not reset environment
before running configure with the native compiler, in a cross-compilation
context,
[inputs]: move perl from here ...
[native-inputs]: ... to here. Also add ncurses that is needed in a
cross-compilation context to build texinfo native tools.
---
gnu/packages/texinfo.scm | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index befdd78551..c93c7fc353 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -41,8 +41,28 @@
(base32
"0rixv4c301djr0d0cnsxs8c1wjndi6bf9vi5axz6mwjkv80cmfcv"))))
(build-system gnu-build-system)
- (inputs `(("ncurses" ,ncurses)
- ("perl" ,perl)))
+ (arguments
+ ;; When cross-compiling, the package is configured twice: once with the
+ ;; native compiler and once with the cross-compiler. During the configure
+ ;; with the native compiler, the environment is reset. This leads to
+ ;; multiple environment variables missing. Do not reset the environment
+ ;; to prevent that.
+ `(,@(if (%current-target-system)
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'fix-cross-configure
+ (lambda _
+ (substitute* "configure"
+ (("env -i")
+ "env "))
+ #t))))
+ '())))
+ (inputs `(("ncurses" ,ncurses)))
+ ;; When cross-compiling, texinfo will build some of it's own binaries with
+ ;; the native compiler. This means ncurses is needed both in both inputs
+ ;; and native-inputs.
+ (native-inputs `(("perl" ,perl)
+ ("ncurses" ,ncurses)))
(native-search-paths
;; This is the variable used by the standalone Info reader.
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 10/61] gnu: openssl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-10-m.othacehe@gmail.com
* gnu/packages/tls.scm (openssl-next)[arguments]: Pass CROSS_COMPILE
environment variable and target system to configure script.
---
gnu/packages/tls.scm | 62 ++++++++++++++++++++++++++++++++------------
1 file changed, 45 insertions(+), 17 deletions(-)

Toggle diff (103 lines)
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index f2e7f4ad0c..c43b325bff 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -300,6 +301,23 @@ required structures.")
#:disallowed-references ,(list (canonical-package perl))
#:phases
(modify-phases %standard-phases
+ ,@(if (%current-target-system)
+ '((add-before
+ 'configure 'set-cross-compile
+ (lambda* (#:key target outputs #:allow-other-keys)
+ (setenv "CROSS_COMPILE" (string-append target "-"))
+ (setenv "CONFIGURE_TARGET_ARCH"
+ (cond
+ ((string-prefix? "i686" target)
+ "linux-x86")
+ ((string-prefix? "x86_64" target)
+ "linux-x86_64")
+ ((string-prefix? "armhf" target)
+ "linux-armv4")
+ ((string-prefix? "aarch64" target)
+ "linux-aarch64")))
+ #t)))
+ '())
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -309,7 +327,9 @@ required structures.")
(("/usr/bin/env")
(string-append (assoc-ref %build-inputs "coreutils")
"/bin/env")))
- (invoke "./config"
+ (invoke ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
"shared" ;build shared libraries
"--libdir=lib"
@@ -320,7 +340,10 @@ required structures.")
"/share/openssl-" ,version)
(string-append "--prefix=" out)
- (string-append "-Wl,-rpath," lib)))))
+ (string-append "-Wl,-rpath," lib)
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(add-after 'install 'move-static-libraries
(lambda* (#:key outputs #:allow-other-keys)
;; Move static libraries to the "static" output.
@@ -416,21 +439,26 @@ required structures.")
(("^MANDIR[[:blank:]]*=.*$")
(string-append "MANDIR = " out "/share/man\n")))
#t)))
- (replace 'configure
- ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (invoke "./config"
- "shared" ;build shared libraries
- "--libdir=lib"
-
- ;; The default for this catch-all directory is
- ;; PREFIX/ssl. Change that to something more
- ;; conventional.
- (string-append "--openssldir=" out
- "/share/openssl-" ,version)
-
- (string-append "--prefix=" out)))))
+ (replace 'configure
+ ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (invoke ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
+ "shared" ;build shared libraries
+ "--libdir=lib"
+
+ ;; The default for this catch-all directory is
+ ;; PREFIX/ssl. Change that to something more
+ ;; conventional.
+ (string-append "--openssldir=" out
+ "/share/openssl-" ,version)
+
+ (string-append "--prefix=" out)
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(delete 'move-extra-documentation)
(add-after 'install 'move-man3-pages
(lambda* (#:key outputs #:allow-other-keys)
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 09/61] gnu: http-parser: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-9-m.othacehe@gmail.com
* gnu/packages/web.scm (http-parser)[arguments]: Set CC and AR variables in
Makefile in order to fix cross-compilation.
---
gnu/packages/web.scm | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 9f80c404d4..06b3778be2 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -35,6 +35,7 @@
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5240,10 +5241,22 @@ into your tests. It automatically starts up a HTTP server in a separate thread
#:make-flags
(list (string-append "PREFIX="
(assoc-ref %outputs "out"))
- "CC=gcc" "library")
+ "library"
+ ,@(if (%current-target-system)
+ '()
+ '("CC=gcc")))
#:phases
(modify-phases %standard-phases
- (delete 'configure))))
+ ,@(if (%current-target-system)
+ '((replace 'configure
+ (lambda* (#:key target #:allow-other-keys)
+ (substitute* (find-files "." "Makefile")
+ (("CC\\?=.*$")
+ (string-append "CC=" target "-gcc\n"))
+ (("AR\\?=.*$")
+ (string-append "AR=" target "-ar\n")))
+ #t)))
+ '((delete 'configure))))))
(synopsis "HTTP request/response parser for C")
(description "This is a parser for HTTP messages written in C. It parses
both requests and responses. The parser is designed to be used in
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 12/61] gnu: cmake: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-12-m.othacehe@gmail.com
* gnu/packages/cmake.scm (cmake-minimal-cross): New package.
* guix/build-system/cmake.scm (default-cmake): Add new target argument and use
it to select cmake-minimal or cmake-minimal-cross.
(lower): Pass target to default-cmake.
---
gnu/packages/cmake.scm | 8 ++++++++
guix/build-system/cmake.scm | 9 ++++++---
2 files changed, 14 insertions(+), 3 deletions(-)

Toggle diff (48 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 1d8d829ec5..9bf0273f00 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -207,6 +207,14 @@ and workspaces that can be used in the compiler environment of your choice.")
(outputs '("out" "doc"))
(properties (alist-delete 'hidden? (package-properties cmake-minimal)))))
+(define-public cmake-minimal-cross
+ (package
+ (inherit cmake-minimal)
+ (name "cmake-minimal-cross")
+ (native-search-paths '())
+ (search-paths
+ (package-native-search-paths cmake-minimal))))
+
(define-public emacs-cmake-mode
(package
(inherit cmake)
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index ca88fadddf..aa0f4187ec 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -43,16 +43,19 @@
`((guix build cmake-build-system)
,@%gnu-build-system-modules))
-(define (default-cmake)
+(define (default-cmake target)
"Return the default CMake package."
;; Do not use `@' to avoid introducing circular dependencies.
(let ((module (resolve-interface '(gnu packages cmake))))
- (module-ref module 'cmake-minimal)))
+ (module-ref module
+ (if target
+ 'cmake-minimal-cross
+ 'cmake-minimal))))
(define* (lower name
#:key source inputs native-inputs outputs system target
- (cmake (default-cmake))
+ (cmake (default-cmake target))
#:allow-other-keys
#:rest arguments)
"Return a bag for NAME."
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 13/61] gnu: libgit2: Fix cross compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-13-m.othacehe@gmail.com
* gnu/packages/version-control.scm (libgit2)[arguments]: Set
PKG_CONFIG_EXECUTABLE variable when cross-compiling.
Also do not run test suite if cross-compiling.
---
gnu/packages/version-control.scm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index e83b1d95e3..0bc882d3d3 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -545,7 +545,14 @@ everything from small to very large projects with speed and efficiency.")
(build-system cmake-build-system)
(outputs '("out" "debug"))
(arguments
- `(#:configure-flags '("-DUSE_SHA1DC=ON") ; SHA-1 collision detection
+ `(#:configure-flags
+ (list "-DUSE_SHA1DC=ON" ; SHA-1 collision detection
+ ,@(if (%current-target-system)
+ `((string-append
+ "-DPKG_CONFIG_EXECUTABLE="
+ (assoc-ref %build-inputs "pkg-config")
+ "/bin/" ,(%current-target-system) "-pkg-config"))
+ '()))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fix-hardcoded-paths
@@ -560,9 +567,13 @@ everything from small to very large projects with speed and efficiency.")
(lambda _
(for-each make-file-writable (find-files "."))
#t))
- ;; Run checks more verbosely.
+ ;; Run checks more verbosely, unless we are cross-compiling.
(replace 'check
- (lambda _ (invoke "./libgit2_clar" "-v" "-Q"))))))
+ (lambda* (#:key (tests? #t) #:allow-other-keys)
+ (if tests?
+ (invoke "./libgit2_clar" "-v" "-Q")
+ ;; Tests may be disabled if cross-compiling.
+ (format #t "Test suite not run.~%")))))))
(inputs
`(("libssh2" ,libssh2)
("http-parser" ,http-parser)))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 14/61] gnu: ath9k-htc-firmware: Fix cross compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-14-m.othacehe@gmail.com
* gnu/packages/firmware.scm (ath9k-htc-firmware)[phases]: Search for
"cross-gcc" in native-inputs and inputs in "configure" phase.
---
gnu/packages/firmware.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index c473ccd920..3104d78b39 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 inputs 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 (or native-inputs inputs) "cross-gcc")
"\n")))
#t))
(replace 'install
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 15/61] gnu: libpaper: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-15-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/ghostscript.scm (libpaper)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/ghostscript.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index 817104cde1..e6879eada9 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -84,6 +85,24 @@ Consortium standard (ICC), approved as ISO 15076-1.")
(sha256 (base32
"0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (for-each (lambda (file)
+ (install-file
+ (string-append (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess"))
+ #t)))))
(synopsis "Library for handling paper sizes")
(description
"The paper library and accompanying files are intended to provide a simple
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 16/61] gnu: groff: Fix cross compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-16-m.othacehe@gmail.com
* 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 a native-input when cross-compiling.
---
gnu/packages/groff.scm | 40 +++++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)

Toggle diff (74 lines)
diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm
index 98f17914bf..65b661cd79 100644
--- a/gnu/packages/groff.scm
+++ b/gnu/packages/groff.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,7 +56,13 @@
;; from 'inputs'.
(inputs `(("ghostscript" ,ghostscript)))
- (native-inputs `(("bison" ,bison)
+
+ ;; When cross-compiling, this package depends upon a native install of
+ ;; itself.
+ (native-inputs `(,@(if (%current-target-system)
+ `(("self" ,this-package))
+ '())
+ ("bison" ,bison)
("perl" ,perl)
("psutils" ,psutils)
("texinfo" ,texinfo)))
@@ -94,7 +101,33 @@
(lambda _ ;see https://savannah.gnu.org/bugs/index.php?55461
(substitute* "Makefile.in"
(("^docdir =.*") "docdir = @docdir@\n"))
- #t)))))
+ #t))
+ ,@(if (%current-target-system)
+ '((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
@@ -115,7 +148,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
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 17/61] gnu: texinfo-5: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-17-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/texinfo.scm (texinfo-5)[native-inputs]: Keep
native-inputs from inherited package texinfo.
---
gnu/packages/texinfo.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index c93c7fc353..19f87a4de9 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -91,8 +92,7 @@ is on expressing the content semantically, avoiding physical markup commands.")
(patches (search-patches "texinfo-5-perl-compat.patch"))
(sha256
(base32
- "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))
- (native-inputs '())))
+ "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))))
(define-public texinfo-4
(package (inherit texinfo)
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 19/61] gnu: indent: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-19-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/code.scm (indent)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
(indent-2.2.12)[native-inputs]: Inherit from indent native-inputs to keep
automake that is added above.
---
gnu/packages/code.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index 13e2c4ad44..50d6870bc7 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -29,6 +29,7 @@
(define-module (gnu packages code)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
@@ -644,9 +645,24 @@ the C, C++, C++/CLI, Objective?C, C#, and Java programming languages.")
;; overrides this to be in PREFIX/doc. Fix this.
(substitute* "doc/Makefile.in"
(("^docdir = .*$") "docdir = @docdir@\n"))
+ #t))
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "config"
+ (for-each (lambda (file)
+ (install-file
+ (string-append (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
#t)))))
(native-inputs
- `(("texinfo" ,texinfo)))
+ `(("texinfo" ,texinfo)
+ ("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
(synopsis "Code reformatter")
(description
"Indent is a program that makes source code easier to read by
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 20/61] gnu: libsamplerate: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-20-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/pulseaudio.scm (libsamplerate)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/pulseaudio.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm
index ff4049d707..89773d8be2 100644
--- a/gnu/packages/pulseaudio.scm
+++ b/gnu/packages/pulseaudio.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,6 +30,7 @@
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix utils)
#:use-module ((guix licenses) #:prefix l:)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
@@ -102,10 +104,28 @@ for reading and writing new sound file formats.")
"1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
(build-system gnu-build-system)
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
(propagated-inputs
`(("libsndfile" ,libsndfile)
("fftw" ,fftw)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "Cfg"
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t)))))
(home-page "http://www.mega-nerd.com/SRC/index.html")
(synopsis "Audio sample rate conversion library")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 21/61] gnu: mit-krb5: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-21-m.othacehe@gmail.com
* gnu/packages/kerberos.scm (mit-krb5)[arguments]: Disable tests when
cross-compiling. Add cross-compilation specific configure-flags and
make-flags. Search for perl in native-inputs or inputs.
---
gnu/packages/kerberos.scm | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)

Toggle diff (49 lines)
diff --git a/gnu/packages/kerberos.scm b/gnu/packages/kerberos.scm
index 1253a58546..bf344ce8ce 100644
--- a/gnu/packages/kerberos.scm
+++ b/gnu/packages/kerberos.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -68,9 +69,21 @@
("perl" ,perl)))
(arguments
`(;; XXX: On 32-bit systems, 'kdb5_util' hangs on an fcntl/F_SETLKW call
- ;; while running the tests in 'src/tests'.
- #:tests? ,(string=? (%current-system) "x86_64-linux")
+ ;; while running the tests in 'src/tests'. Also disable tests when
+ ;; cross-compiling.
+ #:tests? ,(and (not (%current-target-system))
+ (string=? (%current-system) "x86_64-linux"))
+ ,@(if (%current-target-system)
+ '(#:configure-flags
+ (list "krb5_cv_attr_constructor_destructor=yes"
+ "ac_cv_func_regcomp=yes"
+ "ac_cv_printf_positional=yes"
+ "ac_cv_file__etc_environment=yes"
+ "ac_cv_file__etc_TIMEZONE=no")
+ #:make-flags
+ (list "CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1"))
+ '())
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'enter-source-directory
@@ -78,8 +91,8 @@
(chdir "src")
#t))
(add-before 'check 'pre-check
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((perl (assoc-ref inputs "perl")))
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (let ((perl (assoc-ref (or native-inputs inputs) "perl")))
(substitute* "plugins/kdb/db2/libdb2/test/run.test"
(("/bin/cat") (string-append perl "/bin/perl"))
(("D/bin/sh") (string-append "D" (which "sh")))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 22/61] gnu: cyrus-sasl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-22-m.othacehe@gmail.com
* gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/cyrus-sasl.scm (cyrus-sasl)[origin]: Apply it.
[native-tools]: Add autoconf, automake and libtool.
[arguments]: Run autoconf to apply m4 modification in patch above.
---
gnu/local.mk | 1 +
gnu/packages/cyrus-sasl.scm | 17 +++++++++++++++--
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch

Toggle diff (82 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index de0170ee5f..74f09ba42b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -750,6 +750,7 @@ dist_patch_DATA = \
%D%/packages/patches/cube-nocheck.patch \
%D%/packages/patches/cursynth-wave-rand.patch \
%D%/packages/patches/cvs-CVE-2017-12836.patch \
+ %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch \
%D%/packages/patches/darkice-workaround-fpermissive-error.patch \
%D%/packages/patches/dbus-helper-search-path.patch \
%D%/packages/patches/dbus-c++-gcc-compat.patch \
diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm
index f84136e631..3e65a1faf6 100644
--- a/gnu/packages/cyrus-sasl.scm
+++ b/gnu/packages/cyrus-sasl.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,6 +21,7 @@
(define-module (gnu packages cyrus-sasl)
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages dbm)
#:use-module (gnu packages kerberos)
#:use-module (gnu packages tls)
@@ -41,8 +43,13 @@
"ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-"
version ".tar.gz")))
(sha256 (base32
- "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))))
+ "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))
+ (patches (search-patches "cyrus-sasl-ac-try-run-fix.patch"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
(inputs `(("gdbm" ,gdbm)
("openssl" ,openssl)))
(propagated-inputs
@@ -57,7 +64,13 @@
;; 'plugin_common.c'. When building the shared libraries there, libtool
;; ends up doing "ln -s plugin_common.lo plugin_common.o", which can
;; fail with EEXIST when building things in parallel.
- #:parallel-build? #f))
+ #:parallel-build? #f
+
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'autogen
+ (lambda _
+ (invoke "autoreconf" "-vif"))))))
(synopsis "Simple Authentication Security Layer implementation")
(description
"SASL (Simple Authentication Security Layer) is an Internet
diff --git a/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
new file mode 100644
index 0000000000..8662e812e9
--- /dev/null
+++ b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
@@ -0,0 +1,12 @@
+--- a/m4/sasl2.m4 2018-11-18 22:33:29.902625600 +0300
++++ b/m4/sasl2.m4 2018-11-18 22:33:59.828746176 +0300
+@@ -339,7 +339,8 @@
+ ],
+ [ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
+ AC_MSG_RESULT(yes) ],
+- AC_MSG_RESULT(no))
++ AC_MSG_RESULT(no),
++ AC_MSG_RESULT(no))
+ LIBS="$cmu_save_LIBS"
+
+ else
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 23/61] gnu: help2man: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-23-m.othacehe@gmail.com
* gnu/packages/man.scm (help2man)[native-inputs]: Add perl.
---
gnu/packages/man.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index d6005c1bd3..003ca370d4 100644
--- a/gnu/packages/man.scm
+++ b/gnu/packages/man.scm
@@ -216,6 +216,8 @@ Linux kernel and C library interfaces employed by user-space programs.")
;; ("perl-LocaleGettext" ,perl-LocaleGettext)
;; ("gettext" ,gettext-minimal)
))
+ (native-inputs
+ `(("perl" ,perl)))
(home-page "https://www.gnu.org/software/help2man/")
(synopsis "Automatically generate man pages from program --help")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 24/61] gnu: xmlto: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-24-m.othacehe@gmail.com
* gnu/packages/xml.scm (xmlto)[native-inputs]: Add util-linux.
---
gnu/packages/xml.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index ffe81fa68b..485faeb8ae 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -927,6 +927,8 @@ code for classes that correspond to data structures defined by XMLSchema.")
(assoc-ref %build-inputs
"util-linux")
"/bin/getopt"))))
+ (native-inputs
+ `(("util-linux" ,util-linux)))
(inputs
`(("util-linux" ,util-linux) ; for 'getopt'
("libxml2" ,libxml2) ; for 'xmllint'
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 25/61] gnu: libarchive: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-25-m.othacehe@gmail.com
* gnu/packages/backup.scm (libarchive)[arguments]: Do not build and run tests
when cross-compiling.
---
gnu/packages/backup.scm | 47 +++++++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 18 deletions(-)

Toggle diff (67 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index a92c8c9aca..512882c17c 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -14,6 +14,7 @@
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -230,24 +231,34 @@ backups (called chunks) to allow easy burning to CD/DVD.")
(("/bin/pwd") (which "pwd")))
#t))
(replace 'check
- (lambda _
- ;; XXX: The test_owner_parse, test_read_disk, and
- ;; test_write_disk_lookup tests expect user 'root' to exist, but
- ;; the chroot's /etc/passwd doesn't have it. Turn off those tests.
- ;;
- ;; XXX: Adjust test that fails with zstd 1.4.1 because the default
- ;; options compresses two bytes better than this test expects.
- ;; https://github.com/libarchive/libarchive/issues/1226
- (substitute* "libarchive/test/test_write_filter_zstd.c"
- (("compression-level\", \"6\"")
- "compression-level\", \"7\""))
-
- ;; The tests allow one to disable tests matching a globbing pattern.
- (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
- ;; XXX: This glob disables too much.
- (invoke "./libarchive_test" "^test_*_disk*")
- (invoke "./bsdcpio_test" "^test_owner_parse")
- (invoke "./bsdtar_test")))
+ (lambda* (#:key (tests? #t) #:allow-other-keys)
+ (if tests?
+ ;; XXX: The test_owner_parse, test_read_disk, and
+ ;; test_write_disk_lookup tests expect user 'root' to
+ ;; exist, but the chroot's /etc/passwd doesn't have
+ ;; it. Turn off those tests.
+ ;;
+ ;; XXX: Adjust test that fails with zstd 1.4.1
+ ;; because the default options compresses two bytes
+ ;; better than this test expects.
+ ;; https://github.com/libarchive/libarchive/issues/1226
+ (begin
+ (substitute* "libarchive/test/test_write_filter_zstd.c"
+ (("compression-level\", \"6\"")
+ "compression-level\", \"7\""))
+
+ ;; The tests allow one to disable tests matching a globbing pattern.
+ (invoke "make"
+ "libarchive_test"
+ "bsdcpio_test"
+ "bsdtar_test")
+
+ ;; XXX: This glob disables too much.
+ (invoke "./libarchive_test" "^test_*_disk*")
+ (invoke "./bsdcpio_test" "^test_owner_parse")
+ (invoke "./bsdtar_test"))
+ ;; Tests may be disabled if cross-compiling.
+ (format #t "Test suite not run.~%"))))
(add-after 'install 'add--L-in-libarchive-pc
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 26/61] gnu: tcsh: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-26-m.othacehe@gmail.com
* gnu/packages/shells.scm (tcsh)[arguments]: Replace "cc" by "gcc" as
native gethost compiler when cross-compiling.
---
gnu/packages/shells.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (29 lines)
diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
index 0579c167fc..cf578151b4 100644
--- a/gnu/packages/shells.scm
+++ b/gnu/packages/shells.scm
@@ -11,6 +11,7 @@
;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com>
;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -356,6 +357,14 @@ written by Paul Haahr and Byron Rakitzis.")
(arguments
`(#:phases
(modify-phases %standard-phases
+ ,@(if (%current-target-system)
+ '((add-before 'configure 'set-cross-cc
+ (lambda _
+ (substitute* "configure"
+ (("CC_FOR_GETHOST=\"cc\"")
+ "CC_FOR_GETHOST=\"gcc\""))
+ #t)))
+ '())
(add-before 'check 'patch-test-scripts
(lambda _
;; Take care of pwd
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 27/61] gnu: pkg-config: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-27-m.othacehe@gmail.com
* gnu/packages/pkg-config.scm (%pkg-config)[arguments]: Add configure-flags
to disable tests that fail when cross-compiling.
---
gnu/packages/pkg-config.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm
index 6fc19a975d..329a63658a 100644
--- a/gnu/packages/pkg-config.scm
+++ b/gnu/packages/pkg-config.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -48,7 +49,17 @@
(base32
"14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg"))))
(build-system gnu-build-system)
- (arguments `(#:configure-flags '("--with-internal-glib")))
+ (arguments
+ `(#:configure-flags
+ '("--with-internal-glib"
+ ;; Those variables are guessed incorrectly when cross-compiling.
+ ;; See: https://developer.gimp.org/api/2.0/glib/glib-cross-compiling.html.
+ ,@(if (%current-target-system)
+ '("glib_cv_stack_grows=no"
+ "glib_cv_uscore=no"
+ "ac_cv_func_posix_getpwuid_r=yes"
+ "ac_cv_func_posix_getgrgid_r=yes")
+ '()))))
(native-search-paths
(list (search-path-specification
(variable "PKG_CONFIG_PATH")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 18/61] gnu: bc: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-18-m.othacehe@gmail.com
* gnu/packages/patches/bc-fix-cross-compilation.patch: New patch file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/algebra.scm (bc)[origin]: Apply it,
[native-inputs]: Add automake and autoconf,
[arguments]: Add a new 'autogen phase that is needed by the new patch.
---
gnu/local.mk | 1 +
gnu/packages/algebra.scm | 15 +-
.../patches/bc-fix-cross-compilation.patch | 171 ++++++++++++++++++
3 files changed, 184 insertions(+), 3 deletions(-)
create mode 100644 gnu/packages/patches/bc-fix-cross-compilation.patch

Toggle diff (230 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 07be1f205b..de0170ee5f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -699,6 +699,7 @@ dist_patch_DATA = \
%D%/packages/patches/bash-completion-directories.patch \
%D%/packages/patches/bastet-change-source-of-unordered_set.patch \
%D%/packages/patches/bazaar-CVE-2017-14176.patch \
+ %D%/packages/patches/bc-fix-cross-compilation.patch \
%D%/packages/patches/beets-python-3.7-fix.patch \
%D%/packages/patches/beignet-correct-file-names.patch \
%D%/packages/patches/benchmark-unbundle-googletest.patch \
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index fb9e78bf92..2b43e5f2a8 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -681,15 +682,23 @@ binary.")
(uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
(sha256
(base32
- "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
+ "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))
+ (patches (search-patches "bc-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
(native-inputs
- `(("ed" ,ed)
+ `(("automake" ,automake)
+ ("autoconf" ,autoconf)
+ ("ed" ,ed)
("flex" ,flex)
("texinfo" ,texinfo)))
(arguments
'(#:configure-flags
- (list "--with-readline")))
+ (list "--with-readline")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'autogen
+ (lambda _
+ (invoke "autoreconf" "-vif"))))))
(home-page "https://www.gnu.org/software/bc/")
(synopsis "Arbitrary precision numeric processing language")
(description
diff --git a/gnu/packages/patches/bc-fix-cross-compilation.patch b/gnu/packages/patches/bc-fix-cross-compilation.patch
new file mode 100644
index 0000000000..14dfecdbde
--- /dev/null
+++ b/gnu/packages/patches/bc-fix-cross-compilation.patch
@@ -0,0 +1,171 @@
+Patch taken from nix.
+
+commit fdda59736ddc048cf38a2c7103f4f5d9eeaf995e
+Author: Ben Gamari <ben@smart-cactus.org>
+Date: Tue Oct 17 10:51:34 2017 -0400
+
+ Try implementing cross-compilation
+
+diff --git a/bc/Makefile.am b/bc/Makefile.am
+index d9d412e..fdef633 100644
+--- a/bc/Makefile.am
++++ b/bc/Makefile.am
+@@ -17,6 +17,7 @@ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \
+
+ AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../h
+ LIBBC = ../lib/libbc.a
++LIBBC_HOST = ../lib/libbc_host.a
+ LIBL = @LEXLIB@
+ LDADD = $(LIBBC) $(LIBL) @READLINELIB@
+
+@@ -29,12 +30,20 @@ $(PROGRAMS): libmath.h $(LIBBC)
+ scan.o: bc.h
+ global.o: libmath.h
++
++main_host.c : main.c
++ cp $< $@
+
+-fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
++fbcOBJ = $(addsuffix _host,main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o)
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+
+-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
++libmath.h: libmath.b $(fbcOBJ) $(LIBBC_HOST)
+ echo '{0}' > libmath.h
+- $(MAKE) global.o
+- $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
++ $(MAKE) global.o_host
++ $(CC_FOR_BUILD) -o fbc $(fbcOBJ) global.o_host $(LIBBC_HOST) $(LIBL) ${READLINELIB} $(LIBS)
+ ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
+ $(srcdir)/fix-libmath_h
+ rm -f ./fbc ./global.o
+diff --git a/configure.ac b/configure.ac
+index fc74573..5cabb73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,6 +20,7 @@ m4_define([dc_version], 1.4.1)
+
+ AC_INIT([bc],[bc_version])
+ AC_CONFIG_SRCDIR(doc/bc.1)
++AC_CONFIG_MACRO_DIR([m4])
+ AM_INIT_AUTOMAKE([dist-bzip2])
+ AC_CONFIG_HEADERS(config.h)
+
+@@ -35,6 +36,7 @@ AC_DEFINE([DC_COPYRIGHT],
+ [Define the dc copyright line.])
+
+ AC_PROG_CC
++AX_CC_FOR_BUILD
+ AC_USE_SYSTEM_EXTENSIONS
+
+ AM_PROG_LEX
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index ec4bf59..c670f5b 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -1,5 +1,5 @@
+ ## Process this file with automake to produce Makefile.in
+-noinst_LIBRARIES = libbc.a
++noinst_LIBRARIES = libbc.a libbc_host.a
+
+ AM_CPPFLAGS = -I. -I.. -I$(srcdir)/../h
+
+@@ -24,3 +24,11 @@ testmul: testmul.o number.o
+
+ specialnumber: newnumber.o
+ cp newnumber.o number.o
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
++
++libbc_host.a : $(addsuffix _host,$(libbc_a_OBJECTS))
++ ar cru $@ $+
++ ranlib $@
+diff --git a/m4/cc_for_build.m4 b/m4/cc_for_build.m4
+new file mode 100644
+index 0000000..c62ffad
+--- /dev/null
++++ b/m4/cc_for_build.m4
+@@ -0,0 +1,77 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_cc_for_build.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CC_FOR_BUILD
++#
++# DESCRIPTION
++#
++# Find a build-time compiler. Sets CC_FOR_BUILD and EXEEXT_FOR_BUILD.
++#
++# LICENSE
++#
++# Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org>
++# Copyright (c) 1999 Richard Henderson <rth@redhat.com>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 3
++
++dnl Get a default for CC_FOR_BUILD to put into Makefile.
++AC_DEFUN([AX_CC_FOR_BUILD],
++[# Put a plausible default for CC_FOR_BUILD in Makefile.
++if test -z "$CC_FOR_BUILD"; then
++ if test "x$cross_compiling" = "xno"; then
++ CC_FOR_BUILD='$(CC)'
++ else
++ CC_FOR_BUILD=gcc
++ fi
++fi
++AC_SUBST(CC_FOR_BUILD)
++# Also set EXEEXT_FOR_BUILD.
++if test "x$cross_compiling" = "xno"; then
++ EXEEXT_FOR_BUILD='$(EXEEXT)'
++else
++ AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
++ [rm -f conftest*
++ echo 'int main () { return 0; }' > conftest.c
++ bfd_cv_build_exeext=
++ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
++ for file in conftest.*; do
++ case $file in
++ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
++ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
++ esac
++ done
++ rm -f conftest*
++ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
++ EXEEXT_FOR_BUILD=""
++ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
++fi
++AC_SUBST(EXEEXT_FOR_BUILD)])dnl
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 28/61] gnu: mkfontdir: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-28-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/xorg.scm (mkfontdir)[arguments]: Replace outdated config.sub and
config.guess, by the ones taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/xorg.scm | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index aa89dafe90..d4ea12be95 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
;;; Copyright © 2019 nee <nee@cock.li>
;;; Copyright © 2019 Yoshinori Arai <kumagusu08@gmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -4742,8 +4743,21 @@ protocol and arbitrary X extension protocol.")
"0c3563kw9fg15dpgx4dwvl12qz6sdqdns1pxa574hc7i5m42mman"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess"))
+ #t))
(add-after 'install 'wrap-mkfontdir
(lambda* (#:key inputs outputs #:allow-other-keys)
(wrap-program (string-append (assoc-ref outputs "out")
@@ -4755,7 +4769,8 @@ protocol and arbitrary X extension protocol.")
(inputs
`(("mkfontscale" ,mkfontscale)))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
(home-page "https://www.x.org/wiki/")
(synopsis "Create an index of X font files in a directory")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 30/61] gnu: icu4c: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-30-m.othacehe@gmail.com
* gnu/packages/icu4c.scm (icu4c-build-root): New variable.
(icu4c)[native-inputs]: Add it.
[arguments]: Pass it as a configure-flag.
---
gnu/packages/icu4c.scm | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)

Toggle diff (74 lines)
diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 922dfbd348..c70871f7e7 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -27,6 +28,7 @@
#:use-module (gnu packages python)
#:use-module (guix licenses)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix build-system ant)
#:use-module (guix build-system gnu))
@@ -70,13 +72,23 @@
(sha256
(base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2"))))
(build-system gnu-build-system)
+ ;; When cross-compiling, this package needs a source directory of a
+ ;; native-build of itself.
(native-inputs
- `(("python" ,python-minimal)))
+ `(("python" ,python-minimal)
+ ,@(if (%current-target-system)
+ `(("icu4c-build-root" ,icu4c-build-root))
+ '())))
(inputs
`(("perl" ,perl)))
(arguments
`(#:configure-flags
- '("--enable-rpath")
+ (list
+ "--enable-rpath"
+ ,@(if (%current-target-system)
+ '((string-append "--with-cross-build="
+ (assoc-ref %build-inputs "icu4c-build-root")))
+ '()))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'chdir-to-source
@@ -105,6 +117,25 @@ C/C++ part.")
(license x11)
(home-page "http://site.icu-project.org/")))
+(define-public icu4c-build-root
+ (package
+ (inherit icu4c)
+ (name "icu4c-build-root")
+ (arguments
+ (substitute-keyword-arguments (package-arguments icu4c)
+ ((#:tests? _ '())
+ #f)
+ ((#:out-of-source? _ '())
+ #t)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (copy-recursively "../build" out)
+ #t)))))))
+ (native-inputs '())))
+
(define-public java-icu4j
(package
(name "java-icu4j")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 29/61] gnu: alsa-utils: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-29-m.othacehe@gmail.com
* gnu/packages/linux.scm (alsa-utils)[inputs]: Move gettext from here ...
[native-inputs]: ... to here, in order to fix cross-compilation.
---
gnu/packages/linux.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index f2e36ee7b4..2f7dceca22 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -22,7 +22,7 @@
;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2017 nee <nee-git@hidamari.blue>
@@ -1518,12 +1518,13 @@ MIDI functionality to the Linux-based operating system.")
(("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
"true\n"))
#t)))))
+ (native-inputs
+ `(("gettext" ,gettext-minimal)))
(inputs
`(("libsamplerate" ,libsamplerate)
("ncurses" ,ncurses)
("alsa-lib" ,alsa-lib)
- ("xmlto" ,xmlto)
- ("gettext" ,gettext-minimal)))
+ ("xmlto" ,xmlto)))
(home-page "http://www.alsa-project.org/")
(synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
(description
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 31/61] gnu: glibc-utf8-locales: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-31-m.othacehe@gmail.com
* gnu/packages/base.scm (glibc-utf8-locales)[inputs]: Move to ...
[native-inputs]: ... here, in order to fix cross-compilation.
* gnu/packages/commencement.scm (glibc-utf8-locales-final)[inputs]: Move to ...
[native-inputs]: ... here, in order to fix cross-compilation.
---
gnu/packages/base.scm | 4 ++--
gnu/packages/commencement.scm | 11 ++++++-----
2 files changed, 8 insertions(+), 7 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 791647d848..ebaa93f092 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1112,8 +1112,8 @@ to the @code{share/locale} sub-directory of this package.")
;; tests---e.g., in Guile's i18n tests.
'("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))
#t))))
- (inputs `(("glibc" ,glibc)
- ("gzip" ,gzip)))
+ (native-inputs `(("glibc" ,glibc)
+ ("gzip" ,gzip)))
(synopsis "Small sample of UTF-8 locales")
(description
"This package provides a small sample of UTF-8 locales mostly useful in
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 69d1f87605..615d97dbd5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2350,11 +2350,12 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; function.)
(package
(inherit glibc-utf8-locales)
- (inputs `(("glibc" ,glibc-final)
- ("gzip"
- ,(package-with-explicit-inputs gzip %boot4-inputs
- (current-source-location)
- #:guile %bootstrap-guile))))))
+ (native-inputs
+ `(("glibc" ,glibc-final)
+ ("gzip"
+ ,(package-with-explicit-inputs gzip %boot4-inputs
+ (current-source-location)
+ #:guile %bootstrap-guile))))))
(define-public ld-wrapper
;; The final 'ld' wrapper, which uses the final Guile and Binutils.
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 33/61] gnu: eudev: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-33-m.othacehe@gmail.com
* gnu/packages/linux.scm (eudev)[arguments]: Look for xsltproc in both
native-inputs and inputs. Also, do not run udevadm when cross-compiling.

We need to find another way to generate hwdb.bin file for cross-built systems.
---
gnu/packages/linux.scm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 2f7dceca22..f0c0de666f 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2564,7 +2564,7 @@ from the module-init-tools project.")
(patches (search-patches "eudev-rules-directory.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'make-source-writable
(lambda _
@@ -2573,19 +2573,25 @@ from the module-init-tools project.")
(for-each make-file-writable (find-files "."))
#t))
(add-before 'bootstrap 'patch-file-names
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
(substitute* "man/make.sh"
(("/usr/bin/xsltproc")
- (string-append (assoc-ref inputs "xsltproc")
+ (string-append (assoc-ref
+ (or native-inputs inputs) "xsltproc")
"/bin/xsltproc")))
#t))
(add-after 'install 'build-hwdb
(lambda* (#:key outputs #:allow-other-keys)
;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
;; similar tools to display product names.
+ ;;
+ ;; XXX: This can't be done when cross-compiling. Find another way
+ ;; to generate hwdb.bin for cross-built systems.
(let ((out (assoc-ref outputs "out")))
- (invoke (string-append out "/bin/udevadm")
- "hwdb" "--update")))))
+ ,@(if (%current-target-system)
+ '(#t)
+ '((invoke (string-append out "/bin/udevadm")
+ "hwdb" "--update")))))))
#:configure-flags (list "--enable-manpages")))
(native-inputs
`(("autoconf" ,autoconf)
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 34/61] gnu: lvm2: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-34-m.othacehe@gmail.com
* gnu/packages/linux.scm (lvm2)[arguments]: Add cross-compilation specific
configure-flags.
---
gnu/packages/linux.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

Toggle diff (29 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index f0c0de666f..0036b85e4d 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2654,7 +2654,7 @@ time.")
(inputs
`(("udev" ,eudev)))
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'configure 'set-makefile-shell
(lambda _
@@ -2689,7 +2689,12 @@ time.")
(assoc-ref %outputs "out")
"/lib,-rpath="
(assoc-ref %outputs "out")
- "/lib/device-mapper"))
+ "/lib/device-mapper")
+ ;; This is needed when cross-compiling.
+ ,@(if (%current-target-system)
+ '("ac_cv_func_malloc_0_nonnull=yes"
+ "ac_cv_func_realloc_0_nonnull=yes")
+ '()))
;; The tests use 'mknod', which requires root access.
#:tests? #f))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 35/61] gnu: nghttp2: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-35-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/web.scm (nghttp2)[arguments]: In set-timezone-directory
phase, search in both inputs and native-inputs.
---
gnu/packages/web.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (28 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 06b3778be2..c0aab76aba 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -36,6 +36,7 @@
;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -6447,9 +6448,10 @@ derivation by David Revoy from the original MonsterID by Andreas Gohr.")
(assoc-ref outputs "lib")))
#t))
(add-before 'check 'set-timezone-directory
- (lambda* (#:key inputs #:allow-other-keys)
- (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
- "/share/zoneinfo"))
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (setenv "TZDIR" (string-append
+ (assoc-ref (or native-inputs inputs) "tzdata")
+ "/share/zoneinfo"))
#t)))))
(home-page "https://nghttp2.org/")
(synopsis "HTTP/2 protocol client, proxy, server, and library")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 36/61] gnu: openldap: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-36-m.othacehe@gmail.com
* gnu/packages/openldap.scm (openldap)[inputs]: Move groff from here to ...
[native-inputs]: ... here. Also add bdb and automake.
[arguments]: Add cross-compilation specific configure-flags. Add a new
fix-configure phase to update outdated config.sub and config.guess.
---
gnu/packages/openldap.scm | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)

Toggle diff (64 lines)
diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index 2f80920ed4..c0b1e34385 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -50,6 +51,7 @@
#:use-module (gnu packages)
#:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl))
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python))
@@ -79,16 +81,38 @@
(inputs `(("bdb" ,bdb-5.3)
("cyrus-sasl" ,cyrus-sasl)
("gnutls" ,gnutls)
- ("groff" ,groff)
("icu4c" ,icu4c)
("libgcrypt" ,libgcrypt)
("zlib" ,zlib)))
- (native-inputs `(("libtool" ,libtool)))
+ (native-inputs `(("libtool" ,libtool)
+ ("groff" ,groff)
+ ("bdb" ,bdb-5.3)
+ ;; For up to date 'config.guess' and 'config.sub'.
+ ("automake" ,automake)))
(arguments
`(#:tests? #f
- #:configure-flags '("--disable-static")
+ #:configure-flags
+ '("--disable-static"
+ ,@(if (%current-target-system)
+ '("--with-yielding_select=yes"
+ "ac_cv_func_memcmp_working=yes")
+ '()))
#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "build"
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t))
(add-after 'install 'patch-sasl-path
;; Give -L arguments for cyrus-sasl to avoid propagation.
(lambda* (#:key inputs outputs #:allow-other-keys)
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 32/61] gnu: boost: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-32-m.othacehe@gmail.com
* gnu/packages/patches/boost-dumpversion.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/boost.scm (boost)[source]: Apply it,
[arguments]: pass cross-compilation mandatory
flags and fill a user-config.jam file pointing to cross-compiler.
---
gnu/local.mk | 1 +
gnu/packages/boost.scm | 28 +++++++++++++++++++-
gnu/packages/patches/boost-dumpversion.patch | 24 +++++++++++++++++
3 files changed, 52 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/boost-dumpversion.patch

Toggle diff (104 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 74f09ba42b..a45a1a0802 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -708,6 +708,7 @@ dist_patch_DATA = \
%D%/packages/patches/binutils-loongson-workaround.patch \
%D%/packages/patches/blender-2.79-newer-ffmpeg.patch \
%D%/packages/patches/blender-2.79-python-3.7-fix.patch \
+ %D%/packages/patches/boost-dumpversion.patch \
%D%/packages/patches/byobu-writable-status.patch \
%D%/packages/patches/calibre-no-updates-dialog.patch \
%D%/packages/patches/calibre-remove-test-bs4.patch \
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index a2253a9efc..536a4bee0f 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -54,6 +55,8 @@
(string-append "https://dl.bintray.com/boostorg/release/"
version "/source/boost_"
version-with-underscores ".tar.bz2"))))
+ (patches
+ (search-patches "boost-dumpversion.patch"))
(sha256
(base32
"0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3"))))
@@ -76,7 +79,22 @@
;; Set the RUNPATH to $libdir so that the libs find each other.
(string-append "linkflags=-Wl,-rpath="
- (assoc-ref %outputs "out") "/lib"))
+ (assoc-ref %outputs "out") "/lib")
+ ,@(if (%current-target-system)
+ `("--user-config=user-config.jam"
+ "binary-format=elf"
+ "target-os=linux"
+ ,@(cond
+ ((string-prefix? "armhf" (%current-target-system))
+ '("abi=aapcs"
+ "address-model=32"
+ "architecture=arm"))
+ ((string-prefix? "aarch64" (%current-target-system))
+ '("abi=aapcs"
+ "address-model=64"
+ "architecture=arm"))
+ (else '())))
+ '()))
#:phases
(modify-phases %standard-phases
(delete 'bootstrap)
@@ -94,6 +112,14 @@
(setenv "SHELL" (which "sh"))
(setenv "CONFIG_SHELL" (which "sh"))
+ ,@(if (%current-target-system)
+ `((call-with-output-file "user-config.jam"
+ (lambda (port)
+ (format port
+ "using gcc : cross : ~a-c++ ;"
+ ,(%current-target-system)))))
+ '())
+
(invoke "./bootstrap.sh"
(string-append "--prefix=" out)
;; Auto-detection looks for ICU only in traditional
diff --git a/gnu/packages/patches/boost-dumpversion.patch b/gnu/packages/patches/boost-dumpversion.patch
new file mode 100644
index 0000000000..7df779cfe6
--- /dev/null
+++ b/gnu/packages/patches/boost-dumpversion.patch
@@ -0,0 +1,24 @@
+This issue is described here: https://github.com/openwrt/packages/pull/8685
+and has not been solved as of 1.70.0 release.
+
+--- a/tools/build/src/tools/common.jam
++++ b/tools/build/src/tools/common.jam
+@@ -973,18 +973,6 @@
+ }
+ }
+
+- # From GCC 5, versioning changes and minor becomes patch
+- if $(tag) = gcc && [ numbers.less 4 $(version[1]) ]
+- {
+- version = $(version[1]) ;
+- }
+-
+- # Ditto, from Clang 4
+- if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ]
+- {
+- version = $(version[1]) ;
+- }
+-
+ # On intel, version is not added, because it does not matter and it is the
+ # version of vc used as backend that matters. Ideally, we should encode the
+ # backend version but that would break compatibility with V1.
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 37/61] gnu: swig: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-37-m.othacehe@gmail.com
* gnu/packages/swig.scm (swig)[inputs]: Add pcre that is needed when cross-compiling.
---
gnu/packages/swig.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/swig.scm b/gnu/packages/swig.scm
index b1b17fc68d..90d698a8b4 100644
--- a/gnu/packages/swig.scm
+++ b/gnu/packages/swig.scm
@@ -62,6 +62,7 @@
(native-inputs `(("boost" ,boost)
("pcre" ,pcre "bin"))) ;for 'pcre-config'
(inputs `(;; Provide these to run the corresponding tests.
+ ("pcre" ,pcre)
("guile" ,guile-2.0)
("perl" ,perl)))
;; FIXME: reactivate input python as soon as the test failures
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 38/61] gnu: git: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-38-m.othacehe@gmail.com
* gnu/packages/version-control.scm (git-cross-configure-flags): New variable,
(git)[arguments]: add it to configure-flags. Also add cross curl-config script
to PATH.
(git-minimal): Add previous variable to configure-flags.
---
gnu/packages/version-control.scm | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 0bc882d3d3..62f91fe923 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -141,6 +141,10 @@ changes to project files over time. It supports both a distributed workflow
as well as the classic centralized workflow.")
(license license:gpl2+)))
+(define git-cross-configure-flags
+ '("ac_cv_fread_reads_directories=yes"
+ "ac_cv_snprintf_returns_bogus=no"))
+
(define-public git
(package
(name "git")
@@ -233,7 +237,10 @@ as well as the classic centralized workflow.")
;; absolute file name to 'wish'.
#:configure-flags (list (string-append "--with-tcltk="
(assoc-ref %build-inputs "tk")
- "/bin/wish8.6")) ; XXX
+ "/bin/wish8.6") ; XXX
+ ,@(if (%current-target-system)
+ git-cross-configure-flags
+ '()))
#:modules ((srfi srfi-1)
(srfi srfi-26)
@@ -250,6 +257,15 @@ as well as the classic centralized workflow.")
(remove (cut string-prefix? bash-full <>) path)
":"))
#t)))
+ ;; Add cross curl-config script to PATH when cross-compiling.
+ ,@(if (%current-target-system)
+ '((add-before 'configure 'add-cross-curl-config
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "PATH"
+ (string-append (assoc-ref inputs "curl") "/bin:"
+ (getenv "PATH")))
+ #t)))
+ '())
(add-after 'configure 'patch-makefiles
(lambda _
(substitute* "Makefile"
@@ -506,7 +522,10 @@ everything from small to very large projects with speed and efficiency.")
(string-append out "/share/gitweb"))
#t)))))
((#:configure-flags flags)
- ''())
+ `(list
+ ,@(if (%current-target-system)
+ git-cross-configure-flags
+ '())))
((#:disallowed-references lst '())
`(,perl ,@lst))))
(outputs '("out"))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 39/61] gnu: make-linux-libre: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-39-m.othacehe@gmail.com
* gnu/packages/linux.scm (make-linux-libre)[arguments]: Unset CROSS_CPATH to
make sure that cross-libc is not found. Otherwise, some of its header would
conflict with the one from linux (stdint.h and linux/types.h).
---
gnu/packages/linux.scm | 3 +++
1 file changed, 3 insertions(+)

Toggle diff (16 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 0036b85e4d..ac7312bcd0 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -665,6 +665,9 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(replace 'configure
(lambda* (#:key inputs native-inputs target #:allow-other-keys)
;; Avoid introducing timestamps
+ ,@(if (%current-target-system)
+ '((unsetenv "CROSS_CPATH"))
+ '())
(setenv "KCONFIG_NOTIMESTAMP" "1")
(setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 40/61] gnu: procps: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-40-m.othacehe@gmail.com
* gnu/packages/linux.scm (procps)[arguments]: Add configure flags needed from
cross-compilation.
---
gnu/packages/linux.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ac7312bcd0..cf403c46f1 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1138,10 +1138,16 @@ by Robert Shea and Robert Anton Wilson.")
"0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
(build-system gnu-build-system)
(arguments
- '(#:modules ((guix build utils)
+ `(#:modules ((guix build utils)
(guix build gnu-build-system)
(srfi srfi-1)
(srfi srfi-26))
+ ,@(if (%current-target-system)
+ '(#:configure-flags
+ (list
+ "ac_cv_func_malloc_0_nonnull=yes"
+ "ac_cv_func_realloc_0_nonnull=yes"))
+ '())
#:phases
(modify-phases %standard-phases
(add-after
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 41/61] gnu: doxygen: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-41-m.othacehe@gmail.com
* gnu/packages/documentation.scm (doxygen)[arguments]: Force cmake to use
iconv.h from cross-libc.
---
gnu/packages/documentation.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 19c42b00eb..eda8ca3368 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2017 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.
;;;
@@ -31,6 +32,7 @@
#:use-module (guix build-system cmake)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages python)
#:use-module (gnu packages bison)
@@ -145,7 +147,15 @@ markup) can be customized and extended by the user.")
(inputs
`(("bash" ,bash-minimal)))
(arguments
- `(#:test-target "tests"
+ ;; Force cmake to use iconv header from cross-libc instead of the one
+ ;; from native libc.
+ `(,@(if (%current-target-system)
+ '(#:configure-flags
+ (list (string-append "-DICONV_INCLUDE_DIR="
+ (assoc-ref %build-inputs "cross-libc")
+ "/include")))
+ '())
+ #:test-target "tests"
#:phases (modify-phases %standard-phases
(add-before 'configure 'patch-sh
(lambda* (#:key inputs #:allow-other-keys)
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 43/61] gnu: guile-gcrypt: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-43-m.othacehe@gmail.com
* gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gnupg.scm (guile-gcrypt)[source]: Apply previous patch,
[native-inputs]: add guile,
[arguments]: add libgcrypt-config to PATH when cross-compiling.
---
gnu/local.mk | 1 +
gnu/packages/gnupg.scm | 22 +-
.../guile-gcrypt-fix-cross-compilation.patch | 431 ++++++++++++++++++
3 files changed, 452 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch

Toggle diff (485 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1bb871a04b..9203dc4a9b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -923,6 +923,7 @@ dist_patch_DATA = \
%D%/packages/patches/guile-relocatable.patch \
%D%/packages/patches/guile-rsvg-pkgconfig.patch \
%D%/packages/patches/guile-emacs-fix-configure.patch \
+ %D%/packages/patches/guile-gcrypt-fix-cross-compilation.patch \
%D%/packages/patches/guile-sqlite3-fix-cross-compilation.patch \
%D%/packages/patches/gstreamer-buffer-reset-offset.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index c7e6aabf79..69da60b972 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -15,6 +15,7 @@
;;; Copyright © 2017 Petter <petter@mykolab.ch>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -477,13 +478,30 @@ gpgpme starting with version 1.7.")
(sha256
(base32
"1lhgh3105yi0ggrjsjibv4wp1ipz8s17pa820hk2wln3rc04wpvf"))
- (file-name (string-append name "-" version "-checkout"))))
+ (file-name (string-append name "-" version "-checkout"))
+ (patches
+ (search-patches "guile-gcrypt-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
+ (arguments
+ ;; When cross-compiling, the bash script libgcrypt-config provided by
+ ;; libgcrypt must be accessible during configure phase.
+ `(,@(if (%current-target-system)
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'add-libgrypt-config
+ (lambda _
+ (setenv "PATH" (string-append
+ (assoc-ref %build-inputs "libgcrypt")
+ "/bin:"
+ (getenv "PATH")))
+ #t))))
+ '())))
(native-inputs
`(("pkg-config" ,pkg-config)
("autoconf" ,autoconf)
("automake" ,automake)
- ("texinfo" ,texinfo)))
+ ("texinfo" ,texinfo)
+ ("guile" ,guile-2.2)))
(inputs
`(("guile" ,guile-2.2)
("libgcrypt" ,libgcrypt)))
diff --git a/gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch b/gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch
new file mode 100644
index 0000000000..cdf15b39b0
--- /dev/null
+++ b/gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch
@@ -0,0 +1,431 @@
+From 4ec6cb5209461452f7ebb0aae3ae916e28198dc9 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <m.othacehe@gmail.com>
+Date: Sun, 18 Aug 2019 09:42:39 +0200
+Subject: [PATCH] build: Fix cross-compilation.
+
+---
+ Makefile.am | 2 +-
+ configure.ac | 7 ++++++-
+ gcrypt/common.scm | 42 ++++++++++++++++++++++++++++--------------
+ gcrypt/hash.scm | 28 +++++++++++-----------------
+ gcrypt/hmac.scm | 40 +++++++++++++++++++---------------------
+ gcrypt/pk-crypto.scm | 41 ++++++++++++++++++-----------------------
+ gcrypt/random.scm | 7 ++++---
+ 7 files changed, 87 insertions(+), 80 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 0537256..7a3d1b2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -39,7 +39,7 @@ $(guile_install_go_files): install-nobase_modDATA
+ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+ SUFFIXES = .scm .go
+ .scm.go:
+- $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
++ $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
+
+ moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION)
+ godir = $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
+diff --git a/configure.ac b/configure.ac
+index e7ef6cf..7d0f569 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,6 +73,11 @@ AC_SUBST([LIBGCRYPT])
+ AC_SUBST([LIBGCRYPT_PREFIX])
+ AC_SUBST([LIBGCRYPT_LIBDIR])
+
+-GUIX_ASSERT_LIBGCRYPT_USABLE
++if test "$cross_compiling" = "no"; then
++ GUIX_ASSERT_LIBGCRYPT_USABLE
++else
++ GUILE_TARGET="--target=$host_alias"
++ AC_SUBST([GUILE_TARGET])
++fi
+
+ AC_OUTPUT
+diff --git a/gcrypt/common.scm b/gcrypt/common.scm
+index 189003f..a42f609 100644
+--- a/gcrypt/common.scm
++++ b/gcrypt/common.scm
+@@ -21,7 +21,8 @@
+ #:use-module (system foreign)
+ #:use-module (ice-9 match)
+ #:export (gcrypt-version
+- libgcrypt-func
++ libgcrypt->pointer
++ libgcrypt->procedure
+ error-source error-string))
+
+ ;;; Commentary:
+@@ -31,34 +32,47 @@
+ ;;;
+ ;;; Code:
+
+-(define libgcrypt-func
+- (let ((lib (dynamic-link %libgcrypt)))
+- (lambda (func)
+- "Return a pointer to symbol FUNC in libgcrypt."
+- (dynamic-func func lib))))
++(define (libgcrypt->pointer name)
++ "Return a pointer to symbol FUNC in libgcrypt."
++ (catch #t
++ (lambda ()
++ (dynamic-func name (dynamic-link %libgcrypt)))
++ (lambda args
++ (lambda _
++ (throw 'system-error name "~A" (list (strerror ENOSYS))
++ (list ENOSYS))))))
++
++(define (libgcrypt->procedure return name params)
++ "Return a pointer to symbol FUNC in libgcrypt."
++ (catch #t
++ (lambda ()
++ (let ((ptr (dynamic-func name (dynamic-link %libgcrypt))))
++ ;; The #:return-errno? facility was introduced in Guile 2.0.12.
++ (pointer->procedure return ptr params
++ #:return-errno? #t)))
++ (lambda args
++ (lambda _
++ (throw 'system-error name "~A" (list (strerror ENOSYS))
++ (list ENOSYS))))))
+
+ (define gcrypt-version
+ ;; According to the manual, this function must be called before any other,
+ ;; and it's not clear whether it can be called more than once. So call it
+ ;; right here from the top level.
+- (let* ((ptr (libgcrypt-func "gcry_check_version"))
+- (proc (pointer->procedure '* ptr '(*)))
+- (version (pointer->string (proc %null-pointer))))
++ (let ((proc (libgcrypt->procedure '* "gcry_check_version" '(*))))
+ (lambda ()
+ "Return the version number of libgcrypt as a string."
+- version)))
++ (pointer->string (proc %null-pointer)))))
+
+ (define error-source
+- (let* ((ptr (libgcrypt-func "gcry_strsource"))
+- (proc (pointer->procedure '* ptr (list int))))
++ (let ((proc (libgcrypt->procedure '* "gcry_strsource" (list int))))
+ (lambda (err)
+ "Return the error source (a string) for ERR, an error code as thrown
+ along with 'gcry-error'."
+ (pointer->string (proc err)))))
+
+ (define error-string
+- (let* ((ptr (libgcrypt-func "gcry_strerror"))
+- (proc (pointer->procedure '* ptr (list int))))
++ (let ((proc (libgcrypt->procedure '* "gcry_strerror" (list int))))
+ (lambda (err)
+ "Return the error description (a string) for ERR, an error code as
+ thrown along with 'gcry-error'."
+diff --git a/gcrypt/hash.scm b/gcrypt/hash.scm
+index dad06e4..1b3fa67 100644
+--- a/gcrypt/hash.scm
++++ b/gcrypt/hash.scm
+@@ -50,13 +50,13 @@
+ (identifier-syntax 2))
+
+ (define bytevector-hash
+- (let ((hash (pointer->procedure void
+- (libgcrypt-func "gcry_md_hash_buffer")
+- `(,int * * ,size_t))))
++ (let ((proc (libgcrypt->procedure void
++ "gcry_md_hash_buffer"
++ `(,int * * ,size_t))))
+ (lambda (bv type size)
+ "Return the hash TYPE, of SIZE bytes, of BV as a bytevector."
+ (let ((digest (make-bytevector size)))
+- (hash type (bytevector->pointer digest)
++ (proc type (bytevector->pointer digest)
+ (bytevector->pointer bv) (bytevector-length bv))
+ digest))))
+
+@@ -67,30 +67,24 @@
+ (cut bytevector-hash <> GCRY_MD_SHA256 (/ 256 8)))
+
+ (define open-sha256-md
+- (let ((open (pointer->procedure int
+- (libgcrypt-func "gcry_md_open")
+- `(* ,int ,unsigned-int))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_md_open"
++ `(* ,int ,unsigned-int))))
+ (lambda ()
+ (let* ((md (bytevector->pointer (make-bytevector (sizeof '*))))
+- (err (open md GCRY_MD_SHA256 0)))
++ (err (proc md GCRY_MD_SHA256 0)))
+ (if (zero? err)
+ (dereference-pointer md)
+ (throw 'gcrypt-error err))))))
+
+ (define md-write
+- (pointer->procedure void
+- (libgcrypt-func "gcry_md_write")
+- `(* * ,size_t)))
++ (libgcrypt->procedure void "gcry_md_write" `(* * ,size_t)))
+
+ (define md-read
+- (pointer->procedure '*
+- (libgcrypt-func "gcry_md_read")
+- `(* ,int)))
++ (libgcrypt->procedure '* "gcry_md_read" `(* ,int)))
+
+ (define md-close
+- (pointer->procedure void
+- (libgcrypt-func "gcry_md_close")
+- '(*)))
++ (libgcrypt->procedure void "gcry_md_close" '(*)))
+
+
+ (define (open-sha256-port)
+diff --git a/gcrypt/hmac.scm b/gcrypt/hmac.scm
+index 0d8cc61..b9e1a9e 100644
+--- a/gcrypt/hmac.scm
++++ b/gcrypt/hmac.scm
+@@ -42,11 +42,11 @@
+ (format port "#<mac ~x>"
+ (pointer-address (mac->pointer mac)))))
+
+-
+ (define %gcry-mac-open
+- (pointer->procedure int (libgcrypt-func "gcry_mac_open")
+- `(* ,int ,unsigned-int *))) ; gcry_mac_hd_t *HD, int ALGO,
+- ; unsigned int FLAGS, gcry_ctx_t CTX
++ (libgcrypt->procedure int "gcry_mac_open"
++ ;; gcry_mac_hd_t *HD, int ALGO,
++ ;; unsigned int FLAGS, gcry_ctx_t CTX
++ `(* ,int ,unsigned-int *)))
+
+ (define mac-algorithms-mapping
+ (alist->hashq-table
+@@ -59,9 +59,8 @@
+ (hashq-ref mac-algorithms-mapping sym))
+
+ (define mac-algo-maclen
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_get_algo_maclen")
+- `(,int))))
++ (let ((proc (libgcrypt->procedure
++ int "gcry_mac_get_algo_maclen" `(,int))))
+ (lambda (sym)
+ "Get expected length in bytes of mac yielded by algorithm SYM"
+ (proc (mac-algo-ref sym)))))
+@@ -76,8 +75,7 @@
+ (throw 'gcry-error 'mac-open err))))
+
+ (define %gcry-mac-setkey
+- (pointer->procedure int (libgcrypt-func "gcry_mac_setkey")
+- `(* * ,size_t)))
++ (libgcrypt->procedure int "gcry_mac_setkey" `(* * ,size_t)))
+
+ (define (mac-setkey mac key)
+ "Set the KEY on <mac> object MAC
+@@ -96,9 +94,9 @@ In our case, KEY is either a string or a bytevector."
+ (throw 'gcry-error 'mac-setkey err))))
+
+ (define mac-close
+- (let ((proc (pointer->procedure
+- void (libgcrypt-func "gcry_mac_close")
+- '(*)))) ; gcry_mac_hd_t H
++ (let ((proc (libgcrypt->procedure void
++ "gcry_mac_close"
++ '(*)))) ; gcry_mac_hd_t H
+ (lambda (mac)
+ "Release all resources of MAC.
+
+@@ -106,9 +104,9 @@ Running this on an already closed <mac> might segfault :)"
+ (proc (mac->pointer mac)))))
+
+ (define mac-write
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_write")
+- `(* * ,size_t))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_mac_write"
++ `(* * ,size_t))))
+ (lambda (mac obj)
+ "Writes string or bytevector OBJ to MAC"
+ (let* ((bv (match obj
+@@ -124,9 +122,9 @@ Running this on an already closed <mac> might segfault :)"
+ (throw 'gcry-error 'mac-write err))))))
+
+ (define mac-read
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_read")
+- `(* * *))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_mac_read"
++ `(* * *))))
+ (lambda (mac algorithm)
+ "Get bytevector representing result of MAC's written, signed data"
+ (define (int-bv* n)
+@@ -148,9 +146,9 @@ Running this on an already closed <mac> might segfault :)"
+ ;; rather than the gcry_error_t type.
+
+ (define mac-verify
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_verify")
+- `(* * ,size_t))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_mac_verify"
++ `(* * ,size_t))))
+ (lambda (mac bv)
+ "Verify that BV matches result calculated in MAC
+
+diff --git a/gcrypt/pk-crypto.scm b/gcrypt/pk-crypto.scm
+index be664a3..5d614a0 100644
+--- a/gcrypt/pk-crypto.scm
++++ b/gcrypt/pk-crypto.scm
+@@ -81,7 +81,7 @@
+ 16))))
+
+ (define finalize-canonical-sexp!
+- (libgcrypt-func "gcry_sexp_release"))
++ (libgcrypt->pointer "gcry_sexp_release"))
+
+ (define-inlinable (pointer->canonical-sexp ptr)
+ "Return a <canonical-sexp> that wraps PTR."
+@@ -96,8 +96,9 @@
+ sexp))
+
+ (define string->canonical-sexp
+- (let* ((ptr (libgcrypt-func "gcry_sexp_new"))
+- (proc (pointer->procedure int ptr `(* * ,size_t ,int))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_sexp_new"
++ `(* * ,size_t ,int))))
+ (lambda (str)
+ "Parse STR and return the corresponding gcrypt s-expression."
+
+@@ -115,8 +116,9 @@
+ (identifier-syntax 3))
+
+ (define canonical-sexp->string
+- (let* ((ptr (libgcrypt-func "gcry_sexp_sprint"))
+- (proc (pointer->procedure size_t ptr `(* ,int * ,size_t))))
++ (let ((proc (libgcrypt->procedure size_t
++ "gcry_sexp_sprint"
++ `(* ,int * ,size_t))))
+ (lambda (sexp)
+ "Return a textual representation of SEXP."
+ (let loop ((len 1024))
+@@ -134,8 +136,7 @@
+ read-string)))
+
+ (define canonical-sexp-car
+- (let* ((ptr (libgcrypt-func "gcry_sexp_car"))
+- (proc (pointer->procedure '* ptr '(*))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_car" '(*))))
+ (lambda (lst)
+ "Return the first element of LST, an sexp, if that element is a list;
+ return #f if LST or its first element is not a list (this is different from
+@@ -146,8 +147,7 @@ the usual Lisp 'car'.)"
+ (pointer->canonical-sexp result))))))
+
+ (define canonical-sexp-cdr
+- (let* ((ptr (libgcrypt-func "gcry_sexp_cdr"))
+- (proc (pointer->procedure '* ptr '(*))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_cdr" '(*))))
+ (lambda (lst)
+ "Return the tail of LST, an sexp, or #f if LST is not a list."
+ (let ((result (proc (canonical-sexp->pointer lst))))
+@@ -156,8 +156,7 @@ the usual Lisp 'car'.)"
+ (pointer->canonical-sexp result))))))
+
+ (define canonical-sexp-nth
+- (let* ((ptr (libgcrypt-func "gcry_sexp_nth"))
+- (proc (pointer->procedure '* ptr `(* ,int))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_nth" `(* ,int))))
+ (lambda (lst index)
+ "Return the INDEXth nested element of LST, an s-expression. Return #f
+ if that element does not exist, or if it's an atom. (Note: this is obviously
+@@ -174,8 +173,7 @@ different from Scheme's 'list-ref'.)"
+ (sizeof size_t)))
+
+ (define canonical-sexp-length
+- (let* ((ptr (libgcrypt-func "gcry_sexp_length"))
+- (proc (pointer->procedure int ptr '(*))))
++ (let ((proc (libgcrypt->procedure int "gcry_sexp_length" '(*))))
+ (lambda (sexp)
+ "Return the length of SEXP if it's a list (including the empty list);
+ return zero if SEXP is an atom."
+@@ -194,8 +192,7 @@ return zero if SEXP is an atom."
+ (not (char-set-contains? char-set:digit (string-ref str 0)))))))
+
+ (define canonical-sexp-nth-data
+- (let* ((ptr (libgcrypt-func "gcry_sexp_nth_data"))
+- (proc (pointer->procedure '* ptr `(* ,int *))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_nth_data" `(* ,int *))))
+ (lambda (lst index)
+ "Return as a symbol (for \"sexp tokens\") or a bytevector (for any other
+ \"octet string\") the INDEXth data element (atom) of LST, an s-expression.
+@@ -266,8 +263,7 @@ Return #f if DATA does not conform."
+ (values #f #f))))
+
+ (define sign
+- (let* ((ptr (libgcrypt-func "gcry_pk_sign"))
+- (proc (pointer->procedure int ptr '(* * *))))
++ (let ((proc (libgcrypt->procedure int "gcry_pk_sign" '(* * *))))
+ (lambda (data secret-key)
+ "Sign DATA, a canonical s-expression representing a suitable hash, with
+ SECRET-KEY (a canonical s-expression whose car is 'private-key'.) Note that
+@@ -281,8 +277,7 @@ DATA must be a 'data' s-expression, as returned by
+ (throw 'gcry-error 'sign err))))))
+
+ (define verify
+- (let* ((ptr (libgcrypt-func "gcry_pk_verify"))
+- (proc (pointer->procedure int ptr '(* * *))))
++ (let ((proc (libgcrypt->procedure int "gcry_pk_verify" '(* * *))))
+ (lambda (signature data public-key)
+ "Verify that SIGNATURE is a signature of DATA with PUBLIC-KEY, all of
+ which are gcrypt s-expressions."
+@@ -291,8 +286,7 @@ which are gcrypt s-expressions."
+ (canonical-sexp->pointer public-key))))))
+
+ (define generate-key
+- (let* ((ptr (libgcrypt-func "gcry_pk_genkey"))
+- (proc (pointer->procedure int ptr '(* *))))
++ (let ((proc (libgcrypt->procedure int "gcry_pk_genkey" '(* *))))
+ (lambda (params)
+ "Return as an s-expression a new key pair for PARAMS. PARAMS must be an
+ s-expression like: (genkey (rsa (nbits 4:2048)))."
+@@ -303,8 +297,9 @@ s-expression like: (genkey (rsa (nbits 4:2048)))."
+ (throw 'gcry-error 'generate-key err))))))
+
+ (define find-sexp-token
+- (let* ((ptr (libgcrypt-func "gcry_sexp_find_token"))
+- (proc (pointer->procedure '* ptr `(* * ,size_t))))
++ (let ((proc (libgcrypt->procedure '*
++ "gcry_sexp_find_token"
++ `(* * ,size_t))))
+ (lambda (sexp token)
+ "Find in SEXP the first element whose 'car' is TOKEN and return it;
+ return #f if not found."
+diff --git a/gcrypt/random.scm b/gcrypt/random.scm
+index 5391f94..ea6f9d3 100644
+--- a/gcrypt/random.scm
++++ b/gcrypt/random.scm
+@@ -33,7 +33,8 @@
+ (define %gcry-very-strong-random 2)
+
+ (define %gcry-randomize
+- (pointer->procedure void (libgcrypt-func "gcry_randomize")
++ (libgcrypt->procedure void
++ "gcry_randomize"
+ `(* ,size_t ,int))) ; buffer, length, level
+
+ (define* (gen-random-bv #:optional (bv-length 50)
+@@ -44,8 +45,8 @@
+ bv))
+
+ (define %gcry-create-nonce
+- (pointer->procedure void (
This message was truncated. Download the full message here.
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 42/61] gnu: guile-sqlite3: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-42-m.othacehe@gmail.com
* gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/guile.scm (guile-sqlite3)[source]: Apply previous patch,
[native-inputs]: add guile.
---
gnu/local.mk | 1 +
gnu/packages/guile.scm | 7 ++-
.../guile-sqlite3-fix-cross-compilation.patch | 55 +++++++++++++++++++
3 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch

Toggle diff (104 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index a45a1a0802..1bb871a04b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -923,6 +923,7 @@ dist_patch_DATA = \
%D%/packages/patches/guile-relocatable.patch \
%D%/packages/patches/guile-rsvg-pkgconfig.patch \
%D%/packages/patches/guile-emacs-fix-configure.patch \
+ %D%/packages/patches/guile-sqlite3-fix-cross-compilation.patch \
%D%/packages/patches/gstreamer-buffer-reset-offset.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index b07a570654..713390ada1 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -9,7 +9,7 @@
;;; Copyright © 2016, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017, 2018 Amirouche <amirouche@hypermove.net>
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
@@ -521,11 +521,14 @@ Guile's foreign function interface.")
(sha256
(base32
"1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
- (file-name (string-append name "-" version "-checkout"))))
+ (file-name (string-append name "-" version "-checkout"))
+ (patches
+ (search-patches "guile-sqlite3-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
+ ("guile" ,guile-2.2)
("pkg-config" ,pkg-config)))
(inputs
`(("guile" ,guile-2.2)
diff --git a/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
new file mode 100644
index 0000000000..9ea9a47677
--- /dev/null
+++ b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
@@ -0,0 +1,55 @@
+From a6e9e62a77ecc5012929613e20da23b2636450a5 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <mathieu.othacehe@parrot.com>
+Date: Mon, 25 Mar 2019 11:00:38 +0100
+Subject: [PATCH] cross compile
+
+---
+ build-aux/guile.am | 2 +-
+ configure.ac | 19 ++++++++++++-------
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/build-aux/guile.am b/build-aux/guile.am
+index dc1e63f..3126372 100644
+--- a/build-aux/guile.am
++++ b/build-aux/guile.am
+@@ -16,4 +16,4 @@ EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
+ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+ SUFFIXES = .scm .go
+ .scm.go:
+- $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
++ $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
+diff --git a/configure.ac b/configure.ac
+index f648fcb..2d34d0a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,15 +21,20 @@ PKG_CHECK_MODULES([SQLITE], [sqlite3])
+ SQLITE_LIBDIR="`"$PKG_CONFIG" sqlite3 --variable libdir`"
+ AC_SUBST([SQLITE_LIBDIR])
+
+-AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
+-GUILE_CHECK([retval],
+- [(dynamic-func \"sqlite3_open_v2\"
++if test "$cross_compiling" = "no"; then
++ AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
++ GUILE_CHECK([retval],
++ [(dynamic-func \"sqlite3_open_v2\"
+ (dynamic-link \"$SQLITE_LIBDIR/libsqlite3\"))])
+-if test "$retval" != 0; then
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ if test "$retval" != 0; then
++ AC_MSG_RESULT([no])
++ AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ else
++ AC_MSG_RESULT([yes])
++ fi
+ else
+- AC_MSG_RESULT([yes])
++ GUILE_TARGET="--target=$host_alias"
++ AC_SUBST([GUILE_TARGET])
+ fi
+
+ AC_CONFIG_FILES([Makefile sqlite3.scm])
+--
+2.17.1
+
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 48/61] gnu: guile-xcb: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-48-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/guile-wm.scm (guile-xcb)[native-inputs]: Add guile.
---
gnu/packages/guile-wm.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 2955c06a0d..6d17413901 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2016 Alex ter Weele <alex.ter.weele@gmail.com>
;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 ng0 <ng0@n0.is>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -57,7 +58,8 @@
"--with-guile-site-ccache-dir="
(assoc-ref %outputs "out")
"/lib/guile/2.2/site-ccache"))))
- (native-inputs `(("pkg-config" ,pkg-config)
+ (native-inputs `(("guile" ,guile-2.2)
+ ("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
(inputs `(("guile" ,guile-2.2)
("xcb" ,xcb-proto)))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 49/61] gnu: guile-wm: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-49-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/guile-wm.scm (guile-wm): Add guile and guile-xcb to native-inputs.
---
gnu/packages/guile-wm.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 6d17413901..3a6eebc91a 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -174,7 +174,9 @@ dependencies.")
Type=Application~%"
,name ,synopsis %output))))
#t)))))
- (native-inputs `(("pkg-config" ,pkg-config)
+ (native-inputs `(("guile" ,guile-2.2)
+ ("guile-xcb" ,guile-xcb)
+ ("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
(inputs `(("guile" ,guile-2.2)
("guile-xcb" ,guile-xcb)))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 44/61] gnu: libtool: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-44-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/autotools.scm (libtool)[arguments]: Do not run tests and use
bash from native-inputs when cross-compiling.
---
gnu/packages/autotools.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index ceb70dfee7..98f31f6bca 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -354,21 +355,22 @@ Makefile, simplifying the entire process for the developer.")
;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
;; <http://hydra.gnu.org/build/181662>.
- #:tests? ,(not (string-prefix? "mips64"
- (or (%current-target-system)
+ ;; Also, do not run tests when cross compiling
+ #:tests? ,(not (or (%current-target-system)
+ (string-prefix? "mips64"
(%current-system))))
#:phases
(modify-phases %standard-phases
(add-before 'check 'pre-check
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
;; Run the test suite in parallel, if possible.
(setenv "TESTSUITEFLAGS"
(string-append
"-j"
(number->string (parallel-job-count))))
;; Patch references to /bin/sh.
- (let ((bash (assoc-ref inputs "bash")))
+ (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
(substitute* "tests/testsuite"
(("/bin/sh")
(string-append bash "/bin/sh")))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 46/61] gnu: libnl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-46-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/linux.scm (libnl)[native-inputs]: Add python-2 and python-3,
[arguments]: In install-python phase, use the cross-compiler and linker to
build extensions. In install-doc phase, search libnl3-doc in both inputs and
native-inputs.
---
gnu/packages/linux.scm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

Toggle diff (54 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index cf403c46f1..7503e47805 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -36,6 +36,7 @@
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019 Stefan Stefanovi? <stefanx2ovic@gmail.com>
;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1941,6 +1942,8 @@ transparently through a bridge.")
("flex" ,flex)
("pkg-config" ,pkg-config)
("swig" ,swig)
+ ("python-2" ,python-2)
+ ("python-3" ,python-3)
("libnl3-doc"
,(origin
(method url-fetch)
@@ -1961,24 +1964,27 @@ transparently through a bridge.")
#:phases
(modify-phases %standard-phases
(add-after 'install 'install-python
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key target outputs #:allow-other-keys)
(define (python-inst python)
(invoke python "setup.py" "build")
(invoke python "setup.py" "install"
(string-append "--prefix="
(assoc-ref %outputs python)))
(invoke python "setup.py" "clean"))
+ (when target
+ (setenv "CC" (string-append target "-gcc"))
+ (setenv "LDSHARED" (string-append target "-gcc -shared")))
(setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
(assoc-ref %outputs "out")))
(with-directory-excursion "./python"
(for-each python-inst '("python2" "python3")))
#t))
(add-after 'install 'install-doc
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
(let ((dest (string-append (assoc-ref outputs "doc")
"/share/doc/libnl")))
(mkdir-p dest)
- (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
+ (invoke "tar" "xf" (assoc-ref (or native-inputs inputs) "libnl3-doc")
"--strip-components=1" "-C" dest)))))))
(home-page "https://www.infradead.org/~tgr/libnl/")
(synopsis "NetLink protocol library suite")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 45/61] gnu: texinfo-4: Fix cross compilation
(address . 36477@debbugs.gnu.org)
20190821085455.18508-45-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/texinfo.scm (texinfo-4)[native-inputs]: Add automake and
native-inputs from texinfo package,
[arguments]: Replace outdated config.sub and config.guess by the ones
taken from automake above. Also make sure native tools are built before build
phase.
---
gnu/packages/texinfo.scm | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)

Toggle diff (58 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index 19f87a4de9..fde1a12a91 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -21,9 +21,11 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages texinfo)
+ #:use-module (gnu packages autotools)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages compression)
@@ -106,8 +108,37 @@ is on expressing the content semantically, avoiding physical markup commands.")
(sha256
(base32
"1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
- (native-inputs '())
- (inputs `(("ncurses" ,ncurses) ("xz" ,xz)))))
+ (inputs `(("ncurses" ,ncurses)
+ ("xz" ,xz)))
+ (native-inputs
+ `(("automake" ,automake)
+ ,@(package-native-inputs texinfo)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments texinfo)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess.
+ (with-directory-excursion "build-aux"
+ (for-each
+ (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t))
+ ;; Build native version of tools before running 'build phase.
+ ,@(if (%current-target-system)
+ `((add-before 'build 'make-native-gnu-lib
+ (lambda* (#:key inputs #:allow-other-keys)
+ (invoke "make" "-C" "tools/gnulib/lib")
+ #t)))
+ '())))))))
(define-public info-reader
;; The idea of this package is to have the standalone Info reader without
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 47/61] gnu: crda: Fix cross-compilation
(address . 36477@debbugs.gnu.org)
20190821085455.18508-47-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/linux.scm (crda)[arguments]: Patch Makefile to use cross
pkg-config when cross-compiling. Also search for wireless-regdb in both
native-inputs and inputs. Set CC variable to cross-compiler when
cross-compiling.
---
gnu/packages/linux.scm | 67 ++++++++++++++++++++++++++----------------
1 file changed, 42 insertions(+), 25 deletions(-)

Toggle diff (100 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 7503e47805..26cba842d3 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2793,13 +2793,23 @@ interface.")
(patches (search-patches "crda-optional-gcrypt.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
+ `(#:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'gzip-determinism
(lambda _
(substitute* "Makefile"
(("gzip") "gzip --no-name"))
#t))
+ ,@(if (%current-target-system)
+ '((add-after
+ 'unpack 'fix-pkg-config
+ (lambda* (#:key target #:allow-other-keys)
+ (substitute*
+ "Makefile"
+ (("pkg-config")
+ (string-append target "-pkg-config")))
+ #t)))
+ '())
(add-before
'build 'no-werror-no-ldconfig
(lambda _
@@ -2809,37 +2819,44 @@ interface.")
#t))
(add-before
'build 'set-regulator-db-file-name
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
;; Tell CRDA where to find our database.
- (let ((regdb (assoc-ref inputs "wireless-regdb")))
+ (let ((regdb (assoc-ref (or native-inputs inputs)
+ "wireless-regdb")))
(substitute* "crda.c"
(("\"/lib/crda/regulatory.bin\"")
(string-append "\"" regdb
"/lib/crda/regulatory.bin\"")))
#t))))
#:test-target "verify"
- #:make-flags (let ((out (assoc-ref %outputs "out"))
- (regdb (assoc-ref %build-inputs "wireless-regdb")))
- (list "CC=gcc" "V=1"
-
- ;; Disable signature-checking on 'regulatory.bin'.
- ;; The reason is that this simplifies maintenance
- ;; on our side (no need to manage a distro key
- ;; pair), and we can guarantee integrity of
- ;; 'regulatory.bin' by other means anyway, such as
- ;; 'guix gc --verify'. See
- ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
- ;; for a discssion.
- "USE_OPENSSL=0"
-
- (string-append "PREFIX=" out)
- (string-append "SBINDIR=" out "/sbin/")
- (string-append "UDEV_RULE_DIR="
- out "/lib/udev/rules.d")
- (string-append "LDFLAGS=-Wl,-rpath="
- out "/lib -L.")
- (string-append "REG_BIN=" regdb
- "/lib/crda/regulatory.bin")))))
+ #:make-flags (let ((out (assoc-ref %outputs "out"))
+ (regdb (assoc-ref %build-inputs "wireless-regdb"))
+ (target ,(%current-target-system)))
+ (list
+ (string-append
+ "CC=" (if target
+ (string-append target "-gcc") "gcc"))
+ "V=1"
+
+ ;; Disable signature-checking on 'regulatory.bin'.
+ ;; The reason is that this simplifies maintenance
+ ;; on our side (no need to manage a distro key
+ ;; pair), and we can guarantee integrity of
+ ;; 'regulatory.bin' by other means anyway, such as
+ ;; 'guix gc --verify'. See
+ ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
+ ;; for a discssion.
+ "USE_OPENSSL=0"
+
+ (string-append "PREFIX=" out)
+ (string-append "SBINDIR=" out "/sbin/")
+ (string-append "UDEV_RULE_DIR="
+ out "/lib/udev/rules.d")
+ (string-append "LDFLAGS=-Wl,-rpath="
+ out "/lib -L.")
+ (string-append "REG_BIN=" regdb
+ "/lib/crda/regulatory.bin")
+ "all_noverify"))))
(native-inputs `(("pkg-config" ,pkg-config)
("python" ,python-2)
("wireless-regdb" ,wireless-regdb)))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 51/61] gnu: console-setup: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-51-m.othacehe@gmail.com
* gnu/packages/xorg.scm (console-setup)[native-inputs]: Add perl,
[arguments]: search for bash in both native-inputs and inputs.
---
gnu/packages/xorg.scm | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index d4ea12be95..c695177c9a 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -6412,25 +6412,28 @@ output.")
" ")))
#t))
(add-before 'build 'make-doubled-bdfs
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
(invoke "make" "-C" "Fonts"
"doubled_bdfs"
(string-append "SHELL="
- (assoc-ref inputs "bash")
+ (assoc-ref (or native-inputs inputs)
+ "bash")
"/bin/bash"))))
(replace 'install
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
(let ((out (assoc-ref %outputs "out")))
(invoke "make" "install-linux"
(string-append "prefix=" out)
(string-append "SHELL="
- (assoc-ref inputs "bash")
+ (assoc-ref (or native-inputs inputs)
+ "bash")
"/bin/bash"))))))))
(native-inputs
`(("pkg-config" ,pkg-config)
("bdftopcf" ,bdftopcf)
("bdfresize" ,bdfresize)
- ("sharutils" ,sharutils))) ;for 'uuencode'
+ ("sharutils" ,sharutils) ;for 'uuencode'
+ ("perl" ,perl)))
(inputs
`(("perl" ,perl))) ;used by 'ckbcomp'
(synopsis "Set up the Linux console font and keyboard")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 50/61] gnu: cmake: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-50-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/cmake.scm (cmake-minimal)[inputs]: Move all inputs to ...
[native-inputs]: ... here, except for ncurses.
---
gnu/packages/cmake.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 9bf0273f00..cae66f2525 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -145,16 +146,17 @@
(replace 'configure
(lambda* (#:key (configure-flags '()) #:allow-other-keys)
(apply invoke "./configure" configure-flags))))))
- (inputs
+ (native-inputs
`(("bzip2" ,bzip2)
("curl" ,curl)
("expat" ,expat)
("file" ,file)
("libarchive" ,libarchive)
("libuv" ,libuv)
- ("ncurses" ,ncurses) ; required for ccmake
("rhash" ,rhash)
("zlib" ,zlib)))
+ (inputs
+ `(("ncurses" ,ncurses))) ; required for ccmake
(native-search-paths
(list (search-path-specification
(variable "CMAKE_PREFIX_PATH")
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 52/61] gnu: mdadm: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-52-m.othacehe@gmail.com
* gnu/packages/linux.scm (mdadm)[arguments]: Search for coreutils in both
native-inputs and inputs.
---
gnu/packages/linux.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 26cba842d3..4283894008 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3525,8 +3525,9 @@ MPEG-2 and audio over Linux IEEE 1394.")
#:phases
(modify-phases %standard-phases
(add-before 'build 'patch-program-paths
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((coreutils (assoc-ref inputs "coreutils")))
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
+ (let ((coreutils (assoc-ref (or native-inputs inputs)
+ "coreutils")))
(substitute* "udev-md-raid-arrays.rules"
(("/usr/bin/(readlink|basename)" all program)
(string-append coreutils "/bin/" program))))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 53/61] gnu: grub: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-53-m.othacehe@gmail.com
* gnu/packages/bootloaders.scm (grub)[arguments]: Search for unifont in both
native-inputs and inputs.
---
gnu/packages/bootloaders.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 41a2de9706..b235e1bc78 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -99,7 +99,7 @@
(list "PYTHON=true")
#:phases (modify-phases %standard-phases
(add-after 'unpack 'patch-stuff
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
(substitute* "grub-core/Makefile.in"
(("/bin/sh") (which "sh")))
@@ -114,7 +114,9 @@
"/sbin/mdadm\"")))
;; Make the font visible.
- (copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz")
+ (copy-file (assoc-ref (or native-inputs inputs)
+ "unifont")
+ "unifont.bdf.gz")
(system* "gunzip" "unifont.bdf.gz")
;; Give the absolute file name of 'ckbcomp'.
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 54/61] linux-initrd: Use native gzip.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-54-m.othacehe@gmail.com
* gnu/system/linux-initrd.scm (expression->initrd): Pass native gzip to
build-initrd procedure.
---
gnu/system/linux-initrd.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index c90b87c023..34062a3517 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -99,7 +99,7 @@ the derivations referenced by EXP are automatically copied to the initrd."
#:init #$init
;; Copy everything INIT refers to into the initrd.
#:references-graphs '("closure")
- #:gzip (string-append #$gzip "/bin/gzip")))))
+ #:gzip (string-append #+gzip "/bin/gzip")))))
(file-append (computed-file name builder
#:options
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 55/61] gnu: linux-libre: Enable built-in ext4 support.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-55-m.othacehe@gmail.com
When running qemu-img from (gnu system vm) with an aarch64 kernel, mounting
ext4 partitions fails because no modprobe of ext4 module is made. Like for
other kernel configs, provide built-in support for ext4 partitions.

* gnu/packages/aux-files/linux-libre/5.2-arm64.conf: Enable built-in ext4,
like in intel and armhf configs.
---
gnu/packages/aux-files/linux-libre/5.2-arm64.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/aux-files/linux-libre/5.2-arm64.conf b/gnu/packages/aux-files/linux-libre/5.2-arm64.conf
index bfd8c18ddb..4ad652a78f 100644
--- a/gnu/packages/aux-files/linux-libre/5.2-arm64.conf
+++ b/gnu/packages/aux-files/linux-libre/5.2-arm64.conf
@@ -8023,7 +8023,7 @@ CONFIG_VALIDATE_FS_PARSER=y
CONFIG_FS_IOMAP=y
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
-CONFIG_EXT4_FS=m
+CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 56/61] gexp: Use cross extensions when cross-compiling.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-56-m.othacehe@gmail.com
---
guix/gexp.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index d9bdde2e42..514422cb08 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1513,7 +1513,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
(string-append extension
"/share/guile/site/"
(effective-version)))
- '((ungexp-native-splicing extensions)))
+ '((ungexp-splicing extensions)))
%load-path)))
(set! %load-compiled-path
(cons (ungexp compiled)
@@ -1522,7 +1522,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
"/lib/guile/"
(effective-version)
"/site-ccache"))
- '((ungexp-native-splicing extensions)))
+ '((ungexp-splicing extensions)))
%load-compiled-path)))))))))
(define* (gexp->script name exp
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 57/61] gexp: Pass target to compiled-modules in lower-gexp.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-57-m.othacehe@gmail.com
* guix/gexp.scm (lower-gexp): Pass target argument to compiled-modules.
---
guix/gexp.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 514422cb08..afa28779c8 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -727,6 +727,7 @@ derivations--e.g., code evaluated for its side effects."
(compiled (if (pair? %modules)
(compiled-modules %modules
#:system system
+ #:target target
#:module-path module-path
#:extensions extensions
#:guile guile
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 58/61] utils: Use target-arm64? and target-arm? helpers.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-58-m.othacehe@gmail.com
* guix/utils.scm (target-arm64?, target-arm?): New exported procedures.
---
guix/utils.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (28 lines)
diff --git a/guix/utils.scm b/guix/utils.scm
index f480c3291f..3eb156ad4e 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -78,6 +78,8 @@
package-name->name+version
target-mingw?
target-arm32?
+ target-arm64?
+ target-arm?
target-64bit?
version-compare
version>?
@@ -493,6 +495,12 @@ a character other than '@'."
(define (target-arm32?)
(string-prefix? "arm" (or (%current-target-system) (%current-system))))
+(define (target-arm64?)
+ (string-prefix? "aarch64" (or (%current-target-system) (%current-system))))
+
+(define (target-arm?)
+ (or (target-arm32?) (target-arm64?)))
+
(define (target-64bit?)
(let ((system (or (%current-target-system) (%current-system))))
(any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))))
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 59/61] system: vm: Add arm64 support.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-59-m.othacehe@gmail.com
* gnu/build/vm.scm (load-in-linux-vm): Add target-arm64? argument and use it
to pass correct arguments to qemu.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass the new
target-arm64? argument added above. Do not add ESP partition on all ARM
targets. Do not pass grub-efi package to initialize-hard-disk on ARM targets.
---
gnu/build/vm.scm | 22 +++++++++++++++++-----
gnu/system/vm.scm | 17 +++++++++++------
2 files changed, 28 insertions(+), 11 deletions(-)

Toggle diff (107 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a5d9fefa62..6a1c164a41 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -82,6 +82,7 @@
make-disk-image?
single-file-output?
target-arm32?
+ target-arm64?
(disk-image-size (* 100 (expt 2 20)))
(disk-image-format "qcow2")
(references-graphs '()))
@@ -97,16 +98,27 @@ access it via /dev/hda.
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
the #:references-graphs parameter of 'derivation'."
+ (define target-arm? (or target-arm32? target-arm64?))
+
(define arch-specific-flags
`(;; On ARM, a machine has to be specified. Use "virt" machine to avoid
;; hardware limits imposed by other machines.
- ,@(if target-arm32? '("-M" "virt") '())
+ ,@(if target-arm?
+ '("-M" "virt")
+ '())
+
+ ;; On ARM64, we have to specify the CPU. "max" behaves as "host" when
+ ;; KVM is enabled, and like a system CPU with the maximum possible
+ ;; feature set otherwise.
+ ,@(if target-arm64?
+ '("-cpu" "max")
+ '())
;; Only enable kvm if we see /dev/kvm exists. This allows users without
;; hardware virtualization to still use these commands. KVM support is
- ;; still buggy on some ARM32 boards. Do not use it even if available.
+ ;; still buggy on some ARM boards. Do not use it even if available.
,@(if (and (file-exists? "/dev/kvm")
- (not target-arm32?))
+ (not target-arm?))
'("-enable-kvm")
'())
@@ -117,11 +129,11 @@ the #:references-graphs parameter of 'derivation'."
;; The serial port name differs between emulated
;; architectures/machines.
" console="
- (if target-arm32? "ttyAMA0" "ttyS0"))
+ (if target-arm? "ttyAMA0" "ttyS0"))
;; NIC is not supported on ARM "virt" machine, so use a user mode
;; network stack instead.
- ,@(if target-arm32?
+ ,@(if target-arm?
'("-device" "virtio-net-pci,netdev=mynet"
"-netdev" "user,id=mynet")
'("-net" "nic,model=virtio"))))
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index ac6e4ded92..07cee2d4f5 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -235,10 +235,12 @@ made available under the /xchg CIFS share."
#:memory-size #$memory-size
#:make-disk-image? #$make-disk-image?
#:single-file-output? #$single-file-output?
- ;; FIXME: ‘target-arm32?’ may not operate on
- ;; the right system/target values. Rewrite
+ ;; FIXME: ‘target-arm32?’ and
+ ;; ‘target-arm64?’ may not operate on the
+ ;; right system/target values. Rewrite
;; using ‘let-system’ when available.
#:target-arm32? #$(target-arm32?)
+ #:target-arm64? #$(target-arm64?)
#:disk-image-format #$disk-image-format
#:disk-image-size size
#:references-graphs graphs))))))
@@ -452,10 +454,10 @@ system."
;; bootloaders if we are not targeting ARM because UEFI
;; support in U-Boot is experimental.
;;
- ;; FIXME: ‘target-arm32?’ may be not operate on the right
+ ;; FIXME: ‘target-arm?’ may be not operate on the right
;; system/target values. Rewrite using ‘let-system’ when
;; available.
- (if #$(target-arm32?)
+ (if #$(target-arm?)
'()
(list (partition
;; The standalone grub image is about 10MiB, but
@@ -466,10 +468,13 @@ system."
;; when mounting. The actual FAT-ness is based
;; on file system size (16 in this case).
(file-system "vfat")
- (flags '(esp))))))))
+ (flags '(esp)))))))
+ (grub-efi #$@(if (target-arm?)
+ '(#f)
+ #~(#$grub-efi))))
(initialize-hard-disk "/dev/vda"
#:partitions partitions
- #:grub-efi #$grub-efi
+ #:grub-efi grub-efi
#:bootloader-package
#$(bootloader-package bootloader)
#:bootcfg #$bootcfg-drv
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 60/61] system: vm: Support cross-compilation.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-60-m.othacehe@gmail.com
* gnu/system.scm (system-linux-image-file-name): Add support for cross-built
systems. Remove system argument that was ignored,
(operating-system-kernel-file): adapt by removing ignored os argument.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add target argument,
move qemu from inputs list to a new native-inputs list and adapt
set-path-environment-variable call accordingly. Pass target to qemu-command
and gexp->derivation calls.
(iso9660-image): Move qemu from inputs to a new native-inputs list and adapt
set-path-environment-variable accordingly.
(qemu-image): Add target argument, move qemu from inputs list to a new
native-inputs list and adapt set-path-environment-variable call
accordingly. Pass target argument to expression->derivation-in-linux-vm call.
---
gnu/system.scm | 15 ++++++++-------
gnu/system/vm.scm | 25 ++++++++++++++++++-------
2 files changed, 26 insertions(+), 14 deletions(-)

Toggle diff (147 lines)
diff --git a/gnu/system.scm b/gnu/system.scm
index 485896ba0a..85059119cc 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -439,20 +439,21 @@ from the initrd."
"Return the list of swap services for OS."
(map swap-service (operating-system-swap-devices os)))
-(define* (system-linux-image-file-name #:optional (system (%current-system)))
+(define* (system-linux-image-file-name)
"Return the basename of the kernel image file for SYSTEM."
;; FIXME: Evaluate the conditional based on the actual current system.
- (cond
- ((string-prefix? "arm" (%current-system)) "zImage")
- ((string-prefix? "mips" (%current-system)) "vmlinuz")
- ((string-prefix? "aarch64" (%current-system)) "Image")
- (else "bzImage")))
+ (let ((target (or (%current-target-system) (%current-system))))
+ (cond
+ ((string-prefix? "arm" target) "zImage")
+ ((string-prefix? "mips" target) "vmlinuz")
+ ((string-prefix? "aarch64" target) "Image")
+ (else "bzImage"))))
(define (operating-system-kernel-file os)
"Return an object representing the absolute file name of the kernel image of
OS."
(file-append (operating-system-kernel os)
- "/" (system-linux-image-file-name os)))
+ "/" (system-linux-image-file-name)))
(define* (operating-system-directory-base-entries os)
"Return the basic entries of the 'system' directory of OS for use as the
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 07cee2d4f5..759745c277 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -143,7 +143,7 @@
(define* (expression->derivation-in-linux-vm name exp
#:key
- (system (%current-system))
+ (system (%current-system)) target
(linux linux-libre)
initrd
(qemu qemu-minimal)
@@ -214,7 +214,8 @@ made available under the /xchg CIFS share."
(use-modules (guix build utils)
(gnu build vm))
- (let* ((inputs '#$(list qemu (canonical-package coreutils)))
+ (let* ((inputs '#$(list (canonical-package coreutils)))
+ (native-inputs '#+(list qemu))
(linux (string-append #$linux "/"
#$(system-linux-image-file-name)))
(initrd #$initrd)
@@ -222,16 +223,19 @@ made available under the /xchg CIFS share."
(graphs '#$(match references-graphs
(((graph-files . _) ...) graph-files)
(_ #f)))
+ (target #$(or (%current-target-system) (%current-system)))
(size #$(if (eq? 'guess disk-image-size)
#~(+ (* 70 (expt 2 20)) ;ESP
(estimated-partition-size graphs))
disk-image-size)))
- (set-path-environment-variable "PATH" '("bin") inputs)
+ (set-path-environment-variable "PATH" '("bin")
+ (append inputs native-inputs))
(load-in-linux-vm loader
#:output #$output
#:linux linux #:initrd initrd
+ #:qemu (qemu-command target)
#:memory-size #$memory-size
#:make-disk-image? #$make-disk-image?
#:single-file-output? #$single-file-output?
@@ -248,6 +252,7 @@ made available under the /xchg CIFS share."
(gexp->derivation name builder
;; TODO: Require the "kvm" feature.
#:system system
+ #:target target
#:env-vars env-vars
#:guile-for-build guile-for-build
#:references-graphs references-graphs)))
@@ -299,9 +304,10 @@ INPUTS is a list of inputs (as for packages)."
(setlocale LC_ALL "en_US.utf8")
(let ((inputs
- '#$(append (list qemu parted e2fsprogs dosfstools xorriso)
+ '#$(append (list parted e2fsprogs dosfstools xorriso)
(map canonical-package
(list sed grep coreutils findutils gawk))))
+ (native-inputs '#+(list qemu))
(graphs '#$(match inputs
@@ -315,7 +321,8 @@ INPUTS is a list of inputs (as for packages)."
((name thing output) `(,thing ,output)))
inputs)))
- (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
+ (set-path-environment-variable "PATH" '("bin" "sbin")
+ (append inputs native-inputs))
(make-iso9660-image #$xorriso
'#$grub-mkrescue-environment
#$(bootloader-package bootloader)
@@ -346,6 +353,7 @@ INPUTS is a list of inputs (as for packages)."
(define* (qemu-image #:key
(name "qemu-image")
(system (%current-system))
+ (target (%current-target-system))
(qemu qemu-minimal)
(disk-image-size 'guess)
(disk-image-format "qcow2")
@@ -404,9 +412,10 @@ system."
(setlocale LC_ALL "en_US.utf8")
(let ((inputs
- '#$(append (list qemu parted e2fsprogs dosfstools)
+ '#$(append (list util-linux parted e2fsprogs dosfstools)
(map canonical-package
(list sed grep coreutils findutils gawk))))
+ (native-inputs '#+(list qemu))
;; This variable is unused but allows us to add INPUTS-TO-COPY
;; as inputs.
@@ -416,7 +425,8 @@ system."
((name thing output) `(,thing ,output)))
inputs)))
- (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
+ (set-path-environment-variable "PATH" '("bin" "sbin")
+ (append inputs native-inputs))
(let* ((graphs '#$(match inputs
(((names . _) ...)
@@ -483,6 +493,7 @@ system."
#:bootloader-installer
#$(bootloader-installer bootloader)))))))
#:system system
+ #:target target
#:make-disk-image? #t
#:disk-image-size disk-image-size
#:disk-image-format disk-image-format
--
2.17.1
M
M
Mathieu Othacehe wrote on 21 Aug 2019 10:54
[PATCH v2 61/61] scripts: system: Add --target option.
(address . 36477@debbugs.gnu.org)
20190821085455.18508-61-m.othacehe@gmail.com
* guix/scripts/system.scm (%options): Add target option,
(%default-options): ditto,
(process-action): Rename existing target variable to target-file and pass new
target variable to run-with-store procedure.
---
guix/scripts/system.scm | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

Toggle diff (72 lines)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 9fc3a10e98..f8040dd975 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2016, 2017, 2018 Chris Marusich <cmmarusich@gmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
;;;
@@ -929,6 +929,8 @@ Some ACTIONS support additional ARGS.\n"))
--full-boot for 'vm', make a full boot sequence"))
(display (G_ "
--skip-checks skip file system and initrd module safety checks"))
+ (display (G_ "
+ --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\""))
(display (G_ "
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
(newline)
@@ -1002,6 +1004,10 @@ Some ACTIONS support additional ARGS.\n"))
(lambda (opt name arg result)
(alist-cons 'system arg
(alist-delete 'system result eq?))))
+ (option '("target") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'target arg
+ (alist-delete 'target result eq?))))
(option '(#\r "root") #t #f
(lambda (opt name arg result)
(alist-cons 'gc-root arg result)))
@@ -1010,6 +1016,7 @@ Some ACTIONS support additional ARGS.\n"))
(define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
+ (target . #f)
(substitutes? . #t)
(build-hook? . #t)
(print-build-trace? . #t)
@@ -1043,6 +1050,7 @@ resulting from command-line parsing."
((x . _) x)))
(expr (assoc-ref opts 'expression))
(system (assoc-ref opts 'system))
+ (target (assoc-ref opts 'target))
(os (ensure-operating-system
(or file expr)
(cond
@@ -1059,7 +1067,7 @@ resulting from command-line parsing."
(dry? (assoc-ref opts 'dry-run?))
(bootloader? (assoc-ref opts 'install-bootloader?))
- (target (match args
+ (target-file (match args
((first second) second)
(_ #f)))
(bootloader-target
@@ -1101,9 +1109,10 @@ resulting from command-line parsing."
(_ #f))
opts)
#:install-bootloader? bootloader?
- #:target target
+ #:target target-file
#:bootloader-target bootloader-target
#:gc-root (assoc-ref opts 'gc-root)))))
+ #:target target
#:system system))
(warn-about-disk-space)))
--
2.17.1
L
L
Ludovic Courtès wrote on 2 Sep 2019 14:50
Re: [bug#36477] [PATCH v2 00/61] Add --target support to guix system
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
874l1uamlf.fsf@gnu.org
Hi!

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

Toggle quote (4 lines)
> Here's a serie to add target support to guix system command. Most of the
> patches were reviewed in v1 by Marius and Ludo, but this serie adds some more
> patches to complete target support.

Sorry for the delay.

Could you already apply the patches that Marius and I already agreed to?
Double-check that they can go to ‘master’ without triggering a full
rebuild.

I’ll comment on the rest hopefully soon…

Thanks,
Ludo’.
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 00/48] Add --target support to guix system
(address . 36477@debbugs.gnu.org)
20190902153333.11190-1-m.othacehe@gmail.com
Hello,

Here's a v3. The only difference with v2, is that I pushed all the patches
from v2 that were reviewed and I rebased the serie on top of
core-updates-next.

Thanks,

Mathieu

Mathieu Othacehe (39):
gnu: libgpg-error: Fix cross compilation.
gnu: openssl: Fix cross-compilation.
gnu: texinfo: Fix cross-compilation.
gnu: cmake: Fix cross-compilation.
gnu: libpaper: Fix aarch64 cross-compilation.
gnu: groff: Fix cross compilation.
gnu: bc: Fix cross-compilation.
gnu: indent: Fix aarch64 cross-compilation.
gnu: libsamplerate: Fix aarch64 cross-compilation.
gnu: cyrus-sasl: Fix cross-compilation.
gnu: mkfontdir: Fix aarch64 cross-compilation.
gnu: icu4c: Fix cross-compilation.
gnu: glibc-utf8-locales: Fix cross-compilation.
gnu: boost: Fix cross-compilation.
gnu: eudev: Fix cross-compilation.
gnu: lvm2: Fix cross-compilation.
gnu: bdb: Fix cross-compilation.
gnu: openldap: Fix cross-compilation.
gnu: swig: Fix cross-compilation.
gnu: git: Fix cross-compilation.
gnu: make-linux-libre: Fix cross-compilation.
gnu: procps: Fix cross-compilation.
gnu: doxygen: Fix cross-compilation.
gnu: guile-sqlite3: Fix cross-compilation.
gnu: guile-gcrypt: Fix cross-compilation.
packages: Set outputs field as thunked.
gnu: console-setup: Fix cross-compilation.
gnu: mdadm: Fix cross-compilation.
gnu: grub: Fix cross-compilation.
linux-initrd: Use native gzip.
gnu: linux-libre: Enable built-in ext4 support.
gexp: Use cross extensions when cross-compiling.
gexp: Pass target to compiled-modules in lower-gexp.
utils: Use target-arm64? and target-arm? helpers.
build: vm: Fix arm32 support.
system: vm: Add arm64 support.
system: vm: Support cross-compilation.
scripts: system: Add --target option.
wip: tools.

Pierre-Moana Levesque (9):
gnu: texinfo-5: Fix cross-compilation.
gnu: nghttp2: Fix cross-compilation.
gnu: libtool: Fix cross-compilation.
gnu: texinfo-4: Fix cross compilation
gnu: libnl: Fix cross-compilation.
gnu: crda: Fix cross-compilation
gnu: guile-xcb: Fix cross-compilation.
gnu: guile-wm: Fix cross-compilation.
gnu: cmake: Fix cross-compilation.

build-sorted-ok-ko-packages.sh | 354 ++++++++++++++
deps.scm | 184 ++++++++
gnu/build/vm.scm | 30 +-
gnu/local.mk | 5 +
gnu/packages/algebra.scm | 15 +-
gnu/packages/autotools.scm | 10 +-
.../aux-files/linux-libre/5.2-arm64.conf | 2 +-
gnu/packages/base.scm | 4 +-
gnu/packages/boost.scm | 59 ++-
gnu/packages/bootloaders.scm | 6 +-
gnu/packages/cmake.scm | 14 +-
gnu/packages/code.scm | 18 +-
gnu/packages/commencement.scm | 11 +-
gnu/packages/cyrus-sasl.scm | 17 +-
gnu/packages/dbm.scm | 6 +-
gnu/packages/documentation.scm | 12 +-
gnu/packages/ghostscript.scm | 19 +
gnu/packages/gnupg.scm | 47 +-
gnu/packages/groff.scm | 40 +-
gnu/packages/guile-wm.scm | 8 +-
gnu/packages/guile.scm | 7 +-
gnu/packages/icu4c.scm | 35 +-
gnu/packages/linux.scm | 157 ++++---
gnu/packages/openldap.scm | 38 +-
.../patches/bc-fix-cross-compilation.patch | 171 +++++++
gnu/packages/patches/boost-dumpversion.patch | 24 +
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 +
.../guile-gcrypt-fix-cross-compilation.patch | 431 ++++++++++++++++++
.../guile-sqlite3-fix-cross-compilation.patch | 55 +++
gnu/packages/pulseaudio.scm | 22 +-
gnu/packages/swig.scm | 1 +
gnu/packages/texinfo.scm | 63 ++-
gnu/packages/tls.scm | 62 ++-
gnu/packages/version-control.scm | 23 +-
gnu/packages/web.scm | 8 +-
gnu/packages/xorg.scm | 32 +-
gnu/system.scm | 15 +-
gnu/system/examples/mini-beaglebone.scm | 61 +++
gnu/system/examples/mini.scm | 54 +++
gnu/system/linux-initrd.scm | 2 +-
gnu/system/vm.scm | 42 +-
guix/build-system/cmake.scm | 9 +-
guix/gexp.scm | 5 +-
guix/packages.scm | 4 +-
guix/scripts/system.scm | 15 +-
guix/utils.scm | 8 +
46 files changed, 2039 insertions(+), 178 deletions(-)
create mode 100755 build-sorted-ok-ko-packages.sh
create mode 100644 deps.scm
create mode 100644 gnu/packages/patches/bc-fix-cross-compilation.patch
create mode 100644 gnu/packages/patches/boost-dumpversion.patch
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
create mode 100644 gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch
create mode 100644 gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
create mode 100644 gnu/system/examples/mini-beaglebone.scm
create mode 100644 gnu/system/examples/mini.scm

--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 01/48] gnu: libgpg-error: Fix cross compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-2-m.othacehe@gmail.com
* gnu/packages/gnupg.scm (libgpg-error)[arguments]: Add a lock-obj header to
the target platform when cross-compiling,
[native-inputs]: add gettext that is needed when cross-compiling.
---
gnu/packages/gnupg.scm | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 95a35368fa..c7e6aabf79 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -15,7 +15,7 @@
;;; Copyright © 2017 Petter <petter@mykolab.ch>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -96,6 +96,31 @@
(("namespace=errnos") "pkg_namespace=errnos"))
#t))))
(build-system gnu-build-system)
+ (arguments
+ (if (%current-target-system)
+ `(#:modules ((ice-9 match)
+ (guix build gnu-build-system)
+ (guix build utils))
+ #:phases
+ (modify-phases %standard-phases
+ ;; When cross-compiling, some platform specific properties cannot
+ ;; be detected. Create a symlink to the appropriate platform
+ ;; file. See Cross-Compiling section at:
+ ;; https://github.com/gpg/libgpg-error/blob/master/README
+ (add-after 'unpack 'cross-symlinks
+ (lambda* (#:key target inputs #:allow-other-keys)
+ (let ((triplet
+ (match (string-take target
+ (string-index target #\-))
+ ("armhf" "arm-unknown-linux-gnueabi")
+ (x
+ (string-append x "-unknown-linux-gnu")))))
+ (symlink
+ (string-append "lock-obj-pub." triplet ".h")
+ "src/syscfg/lock-obj-pub.linux-gnu.h"))
+ #t))))
+ '()))
+ (native-inputs `(("gettext" ,gettext-minimal)))
(home-page "https://gnupg.org")
(synopsis "Library of error values for GnuPG components")
(description
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 02/48] gnu: openssl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-3-m.othacehe@gmail.com
* gnu/packages/tls.scm (openssl-next)[arguments]: Pass CROSS_COMPILE
environment variable and target system to configure script.
---
gnu/packages/tls.scm | 62 ++++++++++++++++++++++++++++++++------------
1 file changed, 45 insertions(+), 17 deletions(-)

Toggle diff (103 lines)
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index f2e7f4ad0c..73aad0c230 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -300,6 +301,23 @@ required structures.")
#:disallowed-references ,(list (canonical-package perl))
#:phases
(modify-phases %standard-phases
+ ,@(if (%current-target-system)
+ '((add-before
+ 'configure 'set-cross-compile
+ (lambda* (#:key target outputs #:allow-other-keys)
+ (setenv "CROSS_COMPILE" (string-append target "-"))
+ (setenv "CONFIGURE_TARGET_ARCH"
+ (cond
+ ((string-prefix? "i686" target)
+ "linux-x86")
+ ((string-prefix? "x86_64" target)
+ "linux-x86_64")
+ ((string-prefix? "arm" target)
+ "linux-armv4")
+ ((string-prefix? "aarch64" target)
+ "linux-aarch64")))
+ #t)))
+ '())
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -309,7 +327,9 @@ required structures.")
(("/usr/bin/env")
(string-append (assoc-ref %build-inputs "coreutils")
"/bin/env")))
- (invoke "./config"
+ (invoke ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
"shared" ;build shared libraries
"--libdir=lib"
@@ -320,7 +340,10 @@ required structures.")
"/share/openssl-" ,version)
(string-append "--prefix=" out)
- (string-append "-Wl,-rpath," lib)))))
+ (string-append "-Wl,-rpath," lib)
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(add-after 'install 'move-static-libraries
(lambda* (#:key outputs #:allow-other-keys)
;; Move static libraries to the "static" output.
@@ -416,21 +439,26 @@ required structures.")
(("^MANDIR[[:blank:]]*=.*$")
(string-append "MANDIR = " out "/share/man\n")))
#t)))
- (replace 'configure
- ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (invoke "./config"
- "shared" ;build shared libraries
- "--libdir=lib"
-
- ;; The default for this catch-all directory is
- ;; PREFIX/ssl. Change that to something more
- ;; conventional.
- (string-append "--openssldir=" out
- "/share/openssl-" ,version)
-
- (string-append "--prefix=" out)))))
+ (replace 'configure
+ ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (invoke ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
+ "shared" ;build shared libraries
+ "--libdir=lib"
+
+ ;; The default for this catch-all directory is
+ ;; PREFIX/ssl. Change that to something more
+ ;; conventional.
+ (string-append "--openssldir=" out
+ "/share/openssl-" ,version)
+
+ (string-append "--prefix=" out)
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(delete 'move-extra-documentation)
(add-after 'install 'move-man3-pages
(lambda* (#:key outputs #:allow-other-keys)
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 03/48] gnu: texinfo: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-4-m.othacehe@gmail.com
* gnu/packages/texinfo.scm (texinfo)[arguments]: Do not reset environment
before running configure with the native compiler, in a cross-compilation
context,
[inputs]: move perl from here ...
[native-inputs]: ... to here. Also add ncurses that is needed in a
cross-compilation context to build texinfo native tools.
---
gnu/packages/texinfo.scm | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index befdd78551..c93c7fc353 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -41,8 +41,28 @@
(base32
"0rixv4c301djr0d0cnsxs8c1wjndi6bf9vi5axz6mwjkv80cmfcv"))))
(build-system gnu-build-system)
- (inputs `(("ncurses" ,ncurses)
- ("perl" ,perl)))
+ (arguments
+ ;; When cross-compiling, the package is configured twice: once with the
+ ;; native compiler and once with the cross-compiler. During the configure
+ ;; with the native compiler, the environment is reset. This leads to
+ ;; multiple environment variables missing. Do not reset the environment
+ ;; to prevent that.
+ `(,@(if (%current-target-system)
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'fix-cross-configure
+ (lambda _
+ (substitute* "configure"
+ (("env -i")
+ "env "))
+ #t))))
+ '())))
+ (inputs `(("ncurses" ,ncurses)))
+ ;; When cross-compiling, texinfo will build some of it's own binaries with
+ ;; the native compiler. This means ncurses is needed both in both inputs
+ ;; and native-inputs.
+ (native-inputs `(("perl" ,perl)
+ ("ncurses" ,ncurses)))
(native-search-paths
;; This is the variable used by the standalone Info reader.
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 04/48] gnu: cmake: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-5-m.othacehe@gmail.com
* gnu/packages/cmake.scm (cmake-minimal-cross): New package.
* guix/build-system/cmake.scm (default-cmake): Add new target argument and use
it to select cmake-minimal or cmake-minimal-cross.
(lower): Pass target to default-cmake.
---
gnu/packages/cmake.scm | 8 ++++++++
guix/build-system/cmake.scm | 9 ++++++---
2 files changed, 14 insertions(+), 3 deletions(-)

Toggle diff (48 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 1d8d829ec5..9bf0273f00 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -207,6 +207,14 @@ and workspaces that can be used in the compiler environment of your choice.")
(outputs '("out" "doc"))
(properties (alist-delete 'hidden? (package-properties cmake-minimal)))))
+(define-public cmake-minimal-cross
+ (package
+ (inherit cmake-minimal)
+ (name "cmake-minimal-cross")
+ (native-search-paths '())
+ (search-paths
+ (package-native-search-paths cmake-minimal))))
+
(define-public emacs-cmake-mode
(package
(inherit cmake)
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index ca88fadddf..aa0f4187ec 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -43,16 +43,19 @@
`((guix build cmake-build-system)
,@%gnu-build-system-modules))
-(define (default-cmake)
+(define (default-cmake target)
"Return the default CMake package."
;; Do not use `@' to avoid introducing circular dependencies.
(let ((module (resolve-interface '(gnu packages cmake))))
- (module-ref module 'cmake-minimal)))
+ (module-ref module
+ (if target
+ 'cmake-minimal-cross
+ 'cmake-minimal))))
(define* (lower name
#:key source inputs native-inputs outputs system target
- (cmake (default-cmake))
+ (cmake (default-cmake target))
#:allow-other-keys
#:rest arguments)
"Return a bag for NAME."
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 05/48] gnu: libpaper: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-6-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/ghostscript.scm (libpaper)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/ghostscript.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index 817104cde1..e6879eada9 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -84,6 +85,24 @@ Consortium standard (ICC), approved as ISO 15076-1.")
(sha256 (base32
"0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (for-each (lambda (file)
+ (install-file
+ (string-append (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess"))
+ #t)))))
(synopsis "Library for handling paper sizes")
(description
"The paper library and accompanying files are intended to provide a simple
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 06/48] gnu: groff: Fix cross compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-7-m.othacehe@gmail.com
* 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 a native-input when cross-compiling.
---
gnu/packages/groff.scm | 40 +++++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)

Toggle diff (74 lines)
diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm
index 98f17914bf..65b661cd79 100644
--- a/gnu/packages/groff.scm
+++ b/gnu/packages/groff.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,7 +56,13 @@
;; from 'inputs'.
(inputs `(("ghostscript" ,ghostscript)))
- (native-inputs `(("bison" ,bison)
+
+ ;; When cross-compiling, this package depends upon a native install of
+ ;; itself.
+ (native-inputs `(,@(if (%current-target-system)
+ `(("self" ,this-package))
+ '())
+ ("bison" ,bison)
("perl" ,perl)
("psutils" ,psutils)
("texinfo" ,texinfo)))
@@ -94,7 +101,33 @@
(lambda _ ;see https://savannah.gnu.org/bugs/index.php?55461
(substitute* "Makefile.in"
(("^docdir =.*") "docdir = @docdir@\n"))
- #t)))))
+ #t))
+ ,@(if (%current-target-system)
+ '((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
@@ -115,7 +148,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.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 07/48] gnu: texinfo-5: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-8-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/texinfo.scm (texinfo-5)[native-inputs]: Keep
native-inputs from inherited package texinfo.
---
gnu/packages/texinfo.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index c93c7fc353..19f87a4de9 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -91,8 +92,7 @@ is on expressing the content semantically, avoiding physical markup commands.")
(patches (search-patches "texinfo-5-perl-compat.patch"))
(sha256
(base32
- "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))
- (native-inputs '())))
+ "1njfwh2z34r2c4r0iqa7v24wmjzvsfyz4vplzry8ln3479lfywal"))))))
(define-public texinfo-4
(package (inherit texinfo)
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 09/48] gnu: indent: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-10-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/code.scm (indent)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
(indent-2.2.12)[native-inputs]: Inherit from indent native-inputs to keep
automake that is added above.
---
gnu/packages/code.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index 13e2c4ad44..50d6870bc7 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -29,6 +29,7 @@
(define-module (gnu packages code)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
@@ -644,9 +645,24 @@ the C, C++, C++/CLI, Objective?C, C#, and Java programming languages.")
;; overrides this to be in PREFIX/doc. Fix this.
(substitute* "doc/Makefile.in"
(("^docdir = .*$") "docdir = @docdir@\n"))
+ #t))
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "config"
+ (for-each (lambda (file)
+ (install-file
+ (string-append (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
#t)))))
(native-inputs
- `(("texinfo" ,texinfo)))
+ `(("texinfo" ,texinfo)
+ ("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
(synopsis "Code reformatter")
(description
"Indent is a program that makes source code easier to read by
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 10/48] gnu: libsamplerate: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-11-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/pulseaudio.scm (libsamplerate)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/pulseaudio.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm
index ff4049d707..89773d8be2 100644
--- a/gnu/packages/pulseaudio.scm
+++ b/gnu/packages/pulseaudio.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,6 +30,7 @@
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix utils)
#:use-module ((guix licenses) #:prefix l:)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
@@ -102,10 +104,28 @@ for reading and writing new sound file formats.")
"1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
(build-system gnu-build-system)
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
(propagated-inputs
`(("libsndfile" ,libsndfile)
("fftw" ,fftw)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "Cfg"
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t)))))
(home-page "http://www.mega-nerd.com/SRC/index.html")
(synopsis "Audio sample rate conversion library")
(description
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 12/48] gnu: mkfontdir: Fix aarch64 cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-13-m.othacehe@gmail.com
The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/xorg.scm (mkfontdir)[arguments]: Replace outdated config.sub and
config.guess, by the ones taken from ...
[native-inputs]: ... here, by adding automake.
---
gnu/packages/xorg.scm | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index d7cd585664..d5d983a8d2 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
;;; Copyright © 2019 nee <nee@cock.li>
;;; Copyright © 2019 Yoshinori Arai <kumagusu08@gmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -4742,8 +4743,21 @@ protocol and arbitrary X extension protocol.")
"0c3563kw9fg15dpgx4dwvl12qz6sdqdns1pxa574hc7i5m42mman"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess"))
+ #t))
(add-after 'install 'wrap-mkfontdir
(lambda* (#:key inputs outputs #:allow-other-keys)
(wrap-program (string-append (assoc-ref outputs "out")
@@ -4755,7 +4769,8 @@ protocol and arbitrary X extension protocol.")
(inputs
`(("mkfontscale" ,mkfontscale)))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
(home-page "https://www.x.org/wiki/")
(synopsis "Create an index of X font files in a directory")
(description
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 11/48] gnu: cyrus-sasl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-12-m.othacehe@gmail.com
* gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/cyrus-sasl.scm (cyrus-sasl)[origin]: Apply it.
[native-tools]: Add autoconf, automake and libtool.
[arguments]: Run autoconf to apply m4 modification in patch above.
---
gnu/local.mk | 1 +
gnu/packages/cyrus-sasl.scm | 17 +++++++++++++++--
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch

Toggle diff (82 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0bfde340ec..3550479ae6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -752,6 +752,7 @@ dist_patch_DATA = \
%D%/packages/patches/cube-nocheck.patch \
%D%/packages/patches/cursynth-wave-rand.patch \
%D%/packages/patches/cvs-CVE-2017-12836.patch \
+ %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch \
%D%/packages/patches/darkice-workaround-fpermissive-error.patch \
%D%/packages/patches/dbus-helper-search-path.patch \
%D%/packages/patches/dbus-c++-gcc-compat.patch \
diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm
index f84136e631..3e65a1faf6 100644
--- a/gnu/packages/cyrus-sasl.scm
+++ b/gnu/packages/cyrus-sasl.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,6 +21,7 @@
(define-module (gnu packages cyrus-sasl)
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages dbm)
#:use-module (gnu packages kerberos)
#:use-module (gnu packages tls)
@@ -41,8 +43,13 @@
"ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-"
version ".tar.gz")))
(sha256 (base32
- "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))))
+ "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))
+ (patches (search-patches "cyrus-sasl-ac-try-run-fix.patch"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
(inputs `(("gdbm" ,gdbm)
("openssl" ,openssl)))
(propagated-inputs
@@ -57,7 +64,13 @@
;; 'plugin_common.c'. When building the shared libraries there, libtool
;; ends up doing "ln -s plugin_common.lo plugin_common.o", which can
;; fail with EEXIST when building things in parallel.
- #:parallel-build? #f))
+ #:parallel-build? #f
+
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'autogen
+ (lambda _
+ (invoke "autoreconf" "-vif"))))))
(synopsis "Simple Authentication Security Layer implementation")
(description
"SASL (Simple Authentication Security Layer) is an Internet
diff --git a/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
new file mode 100644
index 0000000000..8662e812e9
--- /dev/null
+++ b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
@@ -0,0 +1,12 @@
+--- a/m4/sasl2.m4 2018-11-18 22:33:29.902625600 +0300
++++ b/m4/sasl2.m4 2018-11-18 22:33:59.828746176 +0300
+@@ -339,7 +339,8 @@
+ ],
+ [ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
+ AC_MSG_RESULT(yes) ],
+- AC_MSG_RESULT(no))
++ AC_MSG_RESULT(no),
++ AC_MSG_RESULT(no))
+ LIBS="$cmu_save_LIBS"
+
+ else
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 13/48] gnu: icu4c: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-14-m.othacehe@gmail.com
* gnu/packages/icu4c.scm (icu4c-build-root): New variable.
(icu4c)[native-inputs]: Add it.
[arguments]: Pass it as a configure-flag.
---
gnu/packages/icu4c.scm | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)

Toggle diff (74 lines)
diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 922dfbd348..c70871f7e7 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -27,6 +28,7 @@
#:use-module (gnu packages python)
#:use-module (guix licenses)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix build-system ant)
#:use-module (guix build-system gnu))
@@ -70,13 +72,23 @@
(sha256
(base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2"))))
(build-system gnu-build-system)
+ ;; When cross-compiling, this package needs a source directory of a
+ ;; native-build of itself.
(native-inputs
- `(("python" ,python-minimal)))
+ `(("python" ,python-minimal)
+ ,@(if (%current-target-system)
+ `(("icu4c-build-root" ,icu4c-build-root))
+ '())))
(inputs
`(("perl" ,perl)))
(arguments
`(#:configure-flags
- '("--enable-rpath")
+ (list
+ "--enable-rpath"
+ ,@(if (%current-target-system)
+ '((string-append "--with-cross-build="
+ (assoc-ref %build-inputs "icu4c-build-root")))
+ '()))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'chdir-to-source
@@ -105,6 +117,25 @@ C/C++ part.")
(license x11)
(home-page "http://site.icu-project.org/")))
+(define-public icu4c-build-root
+ (package
+ (inherit icu4c)
+ (name "icu4c-build-root")
+ (arguments
+ (substitute-keyword-arguments (package-arguments icu4c)
+ ((#:tests? _ '())
+ #f)
+ ((#:out-of-source? _ '())
+ #t)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (copy-recursively "../build" out)
+ #t)))))))
+ (native-inputs '())))
+
(define-public java-icu4j
(package
(name "java-icu4j")
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 14/48] gnu: glibc-utf8-locales: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-15-m.othacehe@gmail.com
* gnu/packages/base.scm (glibc-utf8-locales)[inputs]: Move to ...
[native-inputs]: ... here, in order to fix cross-compilation.
* gnu/packages/commencement.scm (glibc-utf8-locales-final)[inputs]: Move to ...
[native-inputs]: ... here, in order to fix cross-compilation.
---
gnu/packages/base.scm | 4 ++--
gnu/packages/commencement.scm | 11 ++++++-----
2 files changed, 8 insertions(+), 7 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 791647d848..ebaa93f092 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1112,8 +1112,8 @@ to the @code{share/locale} sub-directory of this package.")
;; tests---e.g., in Guile's i18n tests.
'("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))
#t))))
- (inputs `(("glibc" ,glibc)
- ("gzip" ,gzip)))
+ (native-inputs `(("glibc" ,glibc)
+ ("gzip" ,gzip)))
(synopsis "Small sample of UTF-8 locales")
(description
"This package provides a small sample of UTF-8 locales mostly useful in
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 69d1f87605..615d97dbd5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2350,11 +2350,12 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; function.)
(package
(inherit glibc-utf8-locales)
- (inputs `(("glibc" ,glibc-final)
- ("gzip"
- ,(package-with-explicit-inputs gzip %boot4-inputs
- (current-source-location)
- #:guile %bootstrap-guile))))))
+ (native-inputs
+ `(("glibc" ,glibc-final)
+ ("gzip"
+ ,(package-with-explicit-inputs gzip %boot4-inputs
+ (current-source-location)
+ #:guile %bootstrap-guile))))))
(define-public ld-wrapper
;; The final 'ld' wrapper, which uses the final Guile and Binutils.
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:32
[PATCH v3 08/48] gnu: bc: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-9-m.othacehe@gmail.com
* gnu/packages/patches/bc-fix-cross-compilation.patch: New patch file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/algebra.scm (bc)[origin]: Apply it,
[native-inputs]: Add automake and autoconf,
[arguments]: Add a new 'autogen phase that is needed by the new patch.
---
gnu/local.mk | 1 +
gnu/packages/algebra.scm | 15 +-
.../patches/bc-fix-cross-compilation.patch | 171 ++++++++++++++++++
3 files changed, 184 insertions(+), 3 deletions(-)
create mode 100644 gnu/packages/patches/bc-fix-cross-compilation.patch

Toggle diff (230 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index d60370fc3d..0bfde340ec 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -701,6 +701,7 @@ dist_patch_DATA = \
%D%/packages/patches/bash-linux-pgrp-pipe.patch \
%D%/packages/patches/bastet-change-source-of-unordered_set.patch \
%D%/packages/patches/bazaar-CVE-2017-14176.patch \
+ %D%/packages/patches/bc-fix-cross-compilation.patch \
%D%/packages/patches/beets-python-3.7-fix.patch \
%D%/packages/patches/beignet-correct-file-names.patch \
%D%/packages/patches/benchmark-unbundle-googletest.patch \
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index fb9e78bf92..2b43e5f2a8 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -681,15 +682,23 @@ binary.")
(uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
(sha256
(base32
- "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
+ "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))
+ (patches (search-patches "bc-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
(native-inputs
- `(("ed" ,ed)
+ `(("automake" ,automake)
+ ("autoconf" ,autoconf)
+ ("ed" ,ed)
("flex" ,flex)
("texinfo" ,texinfo)))
(arguments
'(#:configure-flags
- (list "--with-readline")))
+ (list "--with-readline")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'autogen
+ (lambda _
+ (invoke "autoreconf" "-vif"))))))
(home-page "https://www.gnu.org/software/bc/")
(synopsis "Arbitrary precision numeric processing language")
(description
diff --git a/gnu/packages/patches/bc-fix-cross-compilation.patch b/gnu/packages/patches/bc-fix-cross-compilation.patch
new file mode 100644
index 0000000000..14dfecdbde
--- /dev/null
+++ b/gnu/packages/patches/bc-fix-cross-compilation.patch
@@ -0,0 +1,171 @@
+Patch taken from nix.
+
+commit fdda59736ddc048cf38a2c7103f4f5d9eeaf995e
+Author: Ben Gamari <ben@smart-cactus.org>
+Date: Tue Oct 17 10:51:34 2017 -0400
+
+ Try implementing cross-compilation
+
+diff --git a/bc/Makefile.am b/bc/Makefile.am
+index d9d412e..fdef633 100644
+--- a/bc/Makefile.am
++++ b/bc/Makefile.am
+@@ -17,6 +17,7 @@ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \
+
+ AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../h
+ LIBBC = ../lib/libbc.a
++LIBBC_HOST = ../lib/libbc_host.a
+ LIBL = @LEXLIB@
+ LDADD = $(LIBBC) $(LIBL) @READLINELIB@
+
+@@ -29,12 +30,20 @@ $(PROGRAMS): libmath.h $(LIBBC)
+ scan.o: bc.h
+ global.o: libmath.h
++
++main_host.c : main.c
++ cp $< $@
+
+-fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
++fbcOBJ = $(addsuffix _host,main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o)
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+
+-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
++libmath.h: libmath.b $(fbcOBJ) $(LIBBC_HOST)
+ echo '{0}' > libmath.h
+- $(MAKE) global.o
+- $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
++ $(MAKE) global.o_host
++ $(CC_FOR_BUILD) -o fbc $(fbcOBJ) global.o_host $(LIBBC_HOST) $(LIBL) ${READLINELIB} $(LIBS)
+ ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
+ $(srcdir)/fix-libmath_h
+ rm -f ./fbc ./global.o
+diff --git a/configure.ac b/configure.ac
+index fc74573..5cabb73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,6 +20,7 @@ m4_define([dc_version], 1.4.1)
+
+ AC_INIT([bc],[bc_version])
+ AC_CONFIG_SRCDIR(doc/bc.1)
++AC_CONFIG_MACRO_DIR([m4])
+ AM_INIT_AUTOMAKE([dist-bzip2])
+ AC_CONFIG_HEADERS(config.h)
+
+@@ -35,6 +36,7 @@ AC_DEFINE([DC_COPYRIGHT],
+ [Define the dc copyright line.])
+
+ AC_PROG_CC
++AX_CC_FOR_BUILD
+ AC_USE_SYSTEM_EXTENSIONS
+
+ AM_PROG_LEX
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index ec4bf59..c670f5b 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -1,5 +1,5 @@
+ ## Process this file with automake to produce Makefile.in
+-noinst_LIBRARIES = libbc.a
++noinst_LIBRARIES = libbc.a libbc_host.a
+
+ AM_CPPFLAGS = -I. -I.. -I$(srcdir)/../h
+
+@@ -24,3 +24,11 @@ testmul: testmul.o number.o
+
+ specialnumber: newnumber.o
+ cp newnumber.o number.o
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
++
++libbc_host.a : $(addsuffix _host,$(libbc_a_OBJECTS))
++ ar cru $@ $+
++ ranlib $@
+diff --git a/m4/cc_for_build.m4 b/m4/cc_for_build.m4
+new file mode 100644
+index 0000000..c62ffad
+--- /dev/null
++++ b/m4/cc_for_build.m4
+@@ -0,0 +1,77 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_cc_for_build.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CC_FOR_BUILD
++#
++# DESCRIPTION
++#
++# Find a build-time compiler. Sets CC_FOR_BUILD and EXEEXT_FOR_BUILD.
++#
++# LICENSE
++#
++# Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org>
++# Copyright (c) 1999 Richard Henderson <rth@redhat.com>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 3
++
++dnl Get a default for CC_FOR_BUILD to put into Makefile.
++AC_DEFUN([AX_CC_FOR_BUILD],
++[# Put a plausible default for CC_FOR_BUILD in Makefile.
++if test -z "$CC_FOR_BUILD"; then
++ if test "x$cross_compiling" = "xno"; then
++ CC_FOR_BUILD='$(CC)'
++ else
++ CC_FOR_BUILD=gcc
++ fi
++fi
++AC_SUBST(CC_FOR_BUILD)
++# Also set EXEEXT_FOR_BUILD.
++if test "x$cross_compiling" = "xno"; then
++ EXEEXT_FOR_BUILD='$(EXEEXT)'
++else
++ AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
++ [rm -f conftest*
++ echo 'int main () { return 0; }' > conftest.c
++ bfd_cv_build_exeext=
++ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
++ for file in conftest.*; do
++ case $file in
++ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
++ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
++ esac
++ done
++ rm -f conftest*
++ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
++ EXEEXT_FOR_BUILD=""
++ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
++fi
++AC_SUBST(EXEEXT_FOR_BUILD)])dnl
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 16/48] gnu: eudev: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-17-m.othacehe@gmail.com
* gnu/packages/linux.scm (eudev)[arguments]: Look for xsltproc in both
native-inputs and inputs. Also, do not run udevadm when cross-compiling.

We need to find another way to generate hwdb.bin file for cross-built systems.
---
gnu/packages/linux.scm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index bf1e00421f..0225f8c376 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2564,7 +2564,7 @@ from the module-init-tools project.")
(patches (search-patches "eudev-rules-directory.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'make-source-writable
(lambda _
@@ -2573,19 +2573,25 @@ from the module-init-tools project.")
(for-each make-file-writable (find-files "."))
#t))
(add-before 'bootstrap 'patch-file-names
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
(substitute* "man/make.sh"
(("/usr/bin/xsltproc")
- (string-append (assoc-ref inputs "xsltproc")
+ (string-append (assoc-ref
+ (or native-inputs inputs) "xsltproc")
"/bin/xsltproc")))
#t))
(add-after 'install 'build-hwdb
(lambda* (#:key outputs #:allow-other-keys)
;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
;; similar tools to display product names.
+ ;;
+ ;; XXX: This can't be done when cross-compiling. Find another way
+ ;; to generate hwdb.bin for cross-built systems.
(let ((out (assoc-ref outputs "out")))
- (invoke (string-append out "/bin/udevadm")
- "hwdb" "--update")))))
+ ,@(if (%current-target-system)
+ '(#t)
+ '((invoke (string-append out "/bin/udevadm")
+ "hwdb" "--update")))))))
#:configure-flags (list "--enable-manpages")))
(native-inputs
`(("autoconf" ,autoconf)
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 17/48] gnu: lvm2: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-18-m.othacehe@gmail.com
* gnu/packages/linux.scm (lvm2)[arguments]: Add cross-compilation specific
configure-flags.
---
gnu/packages/linux.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

Toggle diff (29 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 0225f8c376..afa860830b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2654,7 +2654,7 @@ time.")
(inputs
`(("udev" ,eudev)))
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'configure 'set-makefile-shell
(lambda _
@@ -2689,7 +2689,12 @@ time.")
(assoc-ref %outputs "out")
"/lib,-rpath="
(assoc-ref %outputs "out")
- "/lib/device-mapper"))
+ "/lib/device-mapper")
+ ;; This is needed when cross-compiling.
+ ,@(if (%current-target-system)
+ '("ac_cv_func_malloc_0_nonnull=yes"
+ "ac_cv_func_realloc_0_nonnull=yes")
+ '()))
;; The tests use 'mknod', which requires root access.
#:tests? #f))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 19/48] gnu: bdb: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-20-m.othacehe@gmail.com
* gnu/packages/dbm.scm (bdb-4.8)[arguments]: Pass host argument to configure
when cross-compiling.
---
gnu/packages/dbm.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm
index 5191c475c2..84c5817a79 100644
--- a/gnu/packages/dbm.scm
+++ b/gnu/packages/dbm.scm
@@ -55,7 +55,7 @@
#:phases
(modify-phases %standard-phases
(replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key target outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(doc (assoc-ref outputs "doc")))
;; '--docdir' is not honored, so we need to patch.
@@ -74,6 +74,10 @@
'("--build=aarch64-unknown-linux-gnu")
'())
+ ,@(if (%current-target-system) ; cross building
+ '((string-append "--host=" target))
+ '())
+
;; Remove 7 MiB of .a files.
"--disable-static"
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 15/48] gnu: boost: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-16-m.othacehe@gmail.com
* gnu/packages/patches/boost-dumpversion.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/boost.scm (boost)[source]: Apply it,
[native-inputs]: add python unless cross-compiling,
[arguments]: pass cross-compilation mandatory
flags and fill a user-config.jam file pointing to cross-compiler. Disable
python support that is broken when cross-compiling. Disable
provide-libboost_python when cross-compiling.
---
gnu/local.mk | 1 +
gnu/packages/boost.scm | 59 +++++++++++++++-----
gnu/packages/patches/boost-dumpversion.patch | 24 ++++++++
3 files changed, 71 insertions(+), 13 deletions(-)
create mode 100644 gnu/packages/patches/boost-dumpversion.patch

Toggle diff (149 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 3550479ae6..ae53257a77 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -710,6 +710,7 @@ dist_patch_DATA = \
%D%/packages/patches/binutils-loongson-workaround.patch \
%D%/packages/patches/blender-2.79-newer-ffmpeg.patch \
%D%/packages/patches/blender-2.79-python-3.7-fix.patch \
+ %D%/packages/patches/boost-dumpversion.patch \
%D%/packages/patches/byobu-writable-status.patch \
%D%/packages/patches/calibre-no-updates-dialog.patch \
%D%/packages/patches/calibre-remove-test-bs4.patch \
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index a2253a9efc..4e1e68204f 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -54,6 +55,8 @@
(string-append "https://dl.bintray.com/boostorg/release/"
version "/source/boost_"
version-with-underscores ".tar.bz2"))))
+ (patches
+ (search-patches "boost-dumpversion.patch"))
(sha256
(base32
"0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3"))))
@@ -62,7 +65,9 @@
("zlib" ,zlib)))
(native-inputs
`(("perl" ,perl)
- ("python" ,python-2)
+ ,@(if (%current-target-system)
+ '()
+ `(("python" ,python-2)))
("tcsh" ,tcsh)))
(arguments
`(#:tests? #f
@@ -76,7 +81,24 @@
;; Set the RUNPATH to $libdir so that the libs find each other.
(string-append "linkflags=-Wl,-rpath="
- (assoc-ref %outputs "out") "/lib"))
+ (assoc-ref %outputs "out") "/lib")
+ ,@(if (%current-target-system)
+ `("--user-config=user-config.jam"
+ ;; Python is not supported when cross-compiling.
+ "--without-python"
+ "binary-format=elf"
+ "target-os=linux"
+ ,@(cond
+ ((string-prefix? "arm" (%current-target-system))
+ '("abi=aapcs"
+ "address-model=32"
+ "architecture=arm"))
+ ((string-prefix? "aarch64" (%current-target-system))
+ '("abi=aapcs"
+ "address-model=64"
+ "architecture=arm"))
+ (else '())))
+ '()))
#:phases
(modify-phases %standard-phases
(delete 'bootstrap)
@@ -94,6 +116,14 @@
(setenv "SHELL" (which "sh"))
(setenv "CONFIG_SHELL" (which "sh"))
+ ,@(if (%current-target-system)
+ `((call-with-output-file "user-config.jam"
+ (lambda (port)
+ (format port
+ "using gcc : cross : ~a-c++ ;"
+ ,(%current-target-system)))))
+ '())
+
(invoke "./bootstrap.sh"
(string-append "--prefix=" out)
;; Auto-detection looks for ICU only in traditional
@@ -108,17 +138,20 @@
(replace 'install
(lambda* (#:key make-flags #:allow-other-keys)
(apply invoke "./b2" "install" make-flags)))
- (add-after 'install 'provide-libboost_python
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- ;; Boost can build support for both Python 2 and Python 3 since
- ;; version 1.67.0, and suffixes each library with the Python
- ;; version. Many consumers only check for libboost_python
- ;; however, so we provide it here as suggested in
- ;; <https://github.com/boostorg/python/issues/203>.
- (with-directory-excursion (string-append out "/lib")
- (symlink "libboost_python27.so" "libboost_python.so"))
- #t))))))
+ ,@(if (%current-target-system)
+ '()
+ '((add-after 'install 'provide-libboost_python
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; Boost can build support for both Python 2 and
+ ;; Python 3 since version 1.67.0, and suffixes each
+ ;; library with the Python version. Many consumers
+ ;; only check for libboost_python however, so we
+ ;; provide it here as suggested in
+ ;; <https://github.com/boostorg/python/issues/203>.
+ (with-directory-excursion (string-append out "/lib")
+ (symlink "libboost_python27.so" "libboost_python.so"))
+ #t))))))))
(home-page "https://www.boost.org")
(synopsis "Peer-reviewed portable C++ source libraries")
diff --git a/gnu/packages/patches/boost-dumpversion.patch b/gnu/packages/patches/boost-dumpversion.patch
new file mode 100644
index 0000000000..7df779cfe6
--- /dev/null
+++ b/gnu/packages/patches/boost-dumpversion.patch
@@ -0,0 +1,24 @@
+This issue is described here: https://github.com/openwrt/packages/pull/8685
+and has not been solved as of 1.70.0 release.
+
+--- a/tools/build/src/tools/common.jam
++++ b/tools/build/src/tools/common.jam
+@@ -973,18 +973,6 @@
+ }
+ }
+
+- # From GCC 5, versioning changes and minor becomes patch
+- if $(tag) = gcc && [ numbers.less 4 $(version[1]) ]
+- {
+- version = $(version[1]) ;
+- }
+-
+- # Ditto, from Clang 4
+- if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ]
+- {
+- version = $(version[1]) ;
+- }
+-
+ # On intel, version is not added, because it does not matter and it is the
+ # version of vc used as backend that matters. Ideally, we should encode the
+ # backend version but that would break compatibility with V1.
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 20/48] gnu: openldap: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-21-m.othacehe@gmail.com
* gnu/packages/openldap.scm (openldap)[inputs]: Move groff from here to ...
[native-inputs]: ... here. Also add bdb and automake.
[arguments]: Add cross-compilation specific configure-flags. Do not strip when
cross-compiling. Add a new fix-configure phase to update outdated config.sub
and config.guess. Add a fix-cross-gcc phase to set CC variable to
cross-compiler name when cross-compiling.
---
gnu/packages/openldap.scm | 38 +++++++++++++++++++++++++++++++++++---
1 file changed, 35 insertions(+), 3 deletions(-)

Toggle diff (72 lines)
diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index 2f80920ed4..2c9b0d428e 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -50,6 +51,7 @@
#:use-module (gnu packages)
#:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl))
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python))
@@ -79,16 +81,46 @@
(inputs `(("bdb" ,bdb-5.3)
("cyrus-sasl" ,cyrus-sasl)
("gnutls" ,gnutls)
- ("groff" ,groff)
("icu4c" ,icu4c)
("libgcrypt" ,libgcrypt)
("zlib" ,zlib)))
- (native-inputs `(("libtool" ,libtool)))
+ (native-inputs `(("libtool" ,libtool)
+ ("groff" ,groff)
+ ("bdb" ,bdb-5.3)
+ ;; For up to date 'config.guess' and 'config.sub'.
+ ("automake" ,automake)))
(arguments
`(#:tests? #f
- #:configure-flags '("--disable-static")
+ #:configure-flags
+ '("--disable-static"
+ ,@(if (%current-target-system)
+ '("--with-yielding_select=yes"
+ "ac_cv_func_memcmp_working=yes")
+ '()))
+ ;; Disable install stripping as it breaks cross-compiling.
+ #:make-flags '("STRIP=")
#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "build"
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t))
+ ,@(if (%current-target-system)
+ '((add-before 'configure 'fix-cross-gcc
+ (lambda* (#:key target #:allow-other-keys)
+ (setenv "CC" (string-append target "-gcc"))
+ #t)))
+ '())
(add-after 'install 'patch-sasl-path
;; Give -L arguments for cyrus-sasl to avoid propagation.
(lambda* (#:key inputs outputs #:allow-other-keys)
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 18/48] gnu: nghttp2: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-19-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/web.scm (nghttp2)[arguments]: In set-timezone-directory
phase, search in both inputs and native-inputs.
---
gnu/packages/web.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (28 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 8e4424be8d..c5ec216a72 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -36,6 +36,7 @@
;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -6441,9 +6442,10 @@ derivation by David Revoy from the original MonsterID by Andreas Gohr.")
(assoc-ref outputs "lib")))
#t))
(add-before 'check 'set-timezone-directory
- (lambda* (#:key inputs #:allow-other-keys)
- (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
- "/share/zoneinfo"))
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (setenv "TZDIR" (string-append
+ (assoc-ref (or native-inputs inputs) "tzdata")
+ "/share/zoneinfo"))
#t)))))
(home-page "https://nghttp2.org/")
(synopsis "HTTP/2 protocol client, proxy, server, and library")
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 21/48] gnu: swig: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-22-m.othacehe@gmail.com
* gnu/packages/swig.scm (swig)[inputs]: Add pcre that is needed when cross-compiling.
---
gnu/packages/swig.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/swig.scm b/gnu/packages/swig.scm
index b1b17fc68d..90d698a8b4 100644
--- a/gnu/packages/swig.scm
+++ b/gnu/packages/swig.scm
@@ -62,6 +62,7 @@
(native-inputs `(("boost" ,boost)
("pcre" ,pcre "bin"))) ;for 'pcre-config'
(inputs `(;; Provide these to run the corresponding tests.
+ ("pcre" ,pcre)
("guile" ,guile-2.0)
("perl" ,perl)))
;; FIXME: reactivate input python as soon as the test failures
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 22/48] gnu: git: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-23-m.othacehe@gmail.com
* gnu/packages/version-control.scm (git-cross-configure-flags): New variable,
(git)[arguments]: add it to configure-flags. Also add cross curl-config script
to PATH.
(git-minimal): Add previous variable to configure-flags.
---
gnu/packages/version-control.scm | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 192fa666d9..947873e6d5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -141,6 +141,10 @@ changes to project files over time. It supports both a distributed workflow
as well as the classic centralized workflow.")
(license license:gpl2+)))
+(define git-cross-configure-flags
+ '("ac_cv_fread_reads_directories=yes"
+ "ac_cv_snprintf_returns_bogus=no"))
+
(define-public git
(package
(name "git")
@@ -233,7 +237,10 @@ as well as the classic centralized workflow.")
;; absolute file name to 'wish'.
#:configure-flags (list (string-append "--with-tcltk="
(assoc-ref %build-inputs "tk")
- "/bin/wish8.6")) ; XXX
+ "/bin/wish8.6") ; XXX
+ ,@(if (%current-target-system)
+ git-cross-configure-flags
+ '()))
#:modules ((srfi srfi-1)
(srfi srfi-26)
@@ -250,6 +257,15 @@ as well as the classic centralized workflow.")
(remove (cut string-prefix? bash-full <>) path)
":"))
#t)))
+ ;; Add cross curl-config script to PATH when cross-compiling.
+ ,@(if (%current-target-system)
+ '((add-before 'configure 'add-cross-curl-config
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "PATH"
+ (string-append (assoc-ref inputs "curl") "/bin:"
+ (getenv "PATH")))
+ #t)))
+ '())
(add-after 'configure 'patch-makefiles
(lambda _
(substitute* "Makefile"
@@ -506,7 +522,10 @@ everything from small to very large projects with speed and efficiency.")
(string-append out "/share/gitweb"))
#t)))))
((#:configure-flags flags)
- ''())
+ `(list
+ ,@(if (%current-target-system)
+ git-cross-configure-flags
+ '())))
((#:disallowed-references lst '())
`(,perl ,@lst))))
(outputs '("out"))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 25/48] gnu: doxygen: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-26-m.othacehe@gmail.com
* gnu/packages/documentation.scm (doxygen)[arguments]: Force cmake to use
iconv.h from cross-libc.
---
gnu/packages/documentation.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 19c42b00eb..eda8ca3368 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2017 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.
;;;
@@ -31,6 +32,7 @@
#:use-module (guix build-system cmake)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages python)
#:use-module (gnu packages bison)
@@ -145,7 +147,15 @@ markup) can be customized and extended by the user.")
(inputs
`(("bash" ,bash-minimal)))
(arguments
- `(#:test-target "tests"
+ ;; Force cmake to use iconv header from cross-libc instead of the one
+ ;; from native libc.
+ `(,@(if (%current-target-system)
+ '(#:configure-flags
+ (list (string-append "-DICONV_INCLUDE_DIR="
+ (assoc-ref %build-inputs "cross-libc")
+ "/include")))
+ '())
+ #:test-target "tests"
#:phases (modify-phases %standard-phases
(add-before 'configure 'patch-sh
(lambda* (#:key inputs #:allow-other-keys)
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 23/48] gnu: make-linux-libre: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-24-m.othacehe@gmail.com
* gnu/packages/linux.scm (make-linux-libre)[arguments]: Unset CROSS_CPATH to
make sure that cross-libc is not found. Otherwise, some of its header would
conflict with the one from linux (stdint.h and linux/types.h).
---
gnu/packages/linux.scm | 3 +++
1 file changed, 3 insertions(+)

Toggle diff (16 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index afa860830b..9c1ba6d5b9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -665,6 +665,9 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(replace 'configure
(lambda* (#:key inputs native-inputs target #:allow-other-keys)
;; Avoid introducing timestamps
+ ,@(if (%current-target-system)
+ '((unsetenv "CROSS_CPATH"))
+ '())
(setenv "KCONFIG_NOTIMESTAMP" "1")
(setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 24/48] gnu: procps: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-25-m.othacehe@gmail.com
* gnu/packages/linux.scm (procps)[arguments]: Add configure flags needed from
cross-compilation.
---
gnu/packages/linux.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9c1ba6d5b9..874fa819e5 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1138,10 +1138,16 @@ by Robert Shea and Robert Anton Wilson.")
"0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
(build-system gnu-build-system)
(arguments
- '(#:modules ((guix build utils)
+ `(#:modules ((guix build utils)
(guix build gnu-build-system)
(srfi srfi-1)
(srfi srfi-26))
+ ,@(if (%current-target-system)
+ '(#:configure-flags
+ (list
+ "ac_cv_func_malloc_0_nonnull=yes"
+ "ac_cv_func_realloc_0_nonnull=yes"))
+ '())
#:phases
(modify-phases %standard-phases
(add-after
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 28/48] gnu: libtool: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-29-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/autotools.scm (libtool)[arguments]: Do not run tests and use
bash from native-inputs when cross-compiling.
---
gnu/packages/autotools.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index ceb70dfee7..98f31f6bca 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -354,21 +355,22 @@ Makefile, simplifying the entire process for the developer.")
;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
;; <http://hydra.gnu.org/build/181662>.
- #:tests? ,(not (string-prefix? "mips64"
- (or (%current-target-system)
+ ;; Also, do not run tests when cross compiling
+ #:tests? ,(not (or (%current-target-system)
+ (string-prefix? "mips64"
(%current-system))))
#:phases
(modify-phases %standard-phases
(add-before 'check 'pre-check
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
;; Run the test suite in parallel, if possible.
(setenv "TESTSUITEFLAGS"
(string-append
"-j"
(number->string (parallel-job-count))))
;; Patch references to /bin/sh.
- (let ((bash (assoc-ref inputs "bash")))
+ (let ((bash (assoc-ref (or native-inputs inputs) "bash")))
(substitute* "tests/testsuite"
(("/bin/sh")
(string-append bash "/bin/sh")))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 29/48] gnu: texinfo-4: Fix cross compilation
(address . 36477@debbugs.gnu.org)
20190902153333.11190-30-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/texinfo.scm (texinfo-4)[native-inputs]: Add automake and
native-inputs from texinfo package,
[arguments]: Replace outdated config.sub and config.guess by the ones
taken from automake above. Also make sure native tools are built before build
phase.
---
gnu/packages/texinfo.scm | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)

Toggle diff (58 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index 19f87a4de9..fde1a12a91 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -21,9 +21,11 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages texinfo)
+ #:use-module (gnu packages autotools)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages compression)
@@ -106,8 +108,37 @@ is on expressing the content semantically, avoiding physical markup commands.")
(sha256
(base32
"1rf9ckpqwixj65bw469i634897xwlgkm5i9g2hv3avl6mv7b0a3d"))))
- (native-inputs '())
- (inputs `(("ncurses" ,ncurses) ("xz" ,xz)))))
+ (inputs `(("ncurses" ,ncurses)
+ ("xz" ,xz)))
+ (native-inputs
+ `(("automake" ,automake)
+ ,@(package-native-inputs texinfo)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments texinfo)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess.
+ (with-directory-excursion "build-aux"
+ (for-each
+ (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t))
+ ;; Build native version of tools before running 'build phase.
+ ,@(if (%current-target-system)
+ `((add-before 'build 'make-native-gnu-lib
+ (lambda* (#:key inputs #:allow-other-keys)
+ (invoke "make" "-C" "tools/gnulib/lib")
+ #t)))
+ '())))))))
(define-public info-reader
;; The idea of this package is to have the standalone Info reader without
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 30/48] packages: Set outputs field as thunked.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-31-m.othacehe@gmail.com
This allows for instance to use %current-target-system to enable/disable some
outputs in a package.

* guix/packages.scm (<package>): Set outputs field as thunked,
(package->bag): adapt make-bag call accordingly.
---
guix/packages.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/guix/packages.scm b/guix/packages.scm
index ac965acd2f..6889dbf116 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -266,7 +266,7 @@ name of its URI."
(default '()) (thunked))
(outputs package-outputs ; list of strings
- (default '("out")))
+ (default '("out")) (thunked))
; lists of
; <search-path-specification>,
@@ -1046,7 +1046,7 @@ and return it."
#:source source
#:inputs (append (inputs self)
(propagated-inputs self))
- #:outputs outputs
+ #:outputs (outputs self)
#:native-inputs (native-inputs self)
#:arguments (args self))
(raise (if target
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 32/48] gnu: crda: Fix cross-compilation
(address . 36477@debbugs.gnu.org)
20190902153333.11190-33-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/linux.scm (crda)[arguments]: Patch Makefile to use cross
pkg-config when cross-compiling. Also search for wireless-regdb in both
native-inputs and inputs. Set CC variable to cross-compiler when
cross-compiling.
---
gnu/packages/linux.scm | 67 ++++++++++++++++++++++++++----------------
1 file changed, 42 insertions(+), 25 deletions(-)

Toggle diff (100 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9c38bbcfc0..ed2d21859d 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2796,13 +2796,23 @@ interface.")
(patches (search-patches "crda-optional-gcrypt.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
+ `(#:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'gzip-determinism
(lambda _
(substitute* "Makefile"
(("gzip") "gzip --no-name"))
#t))
+ ,@(if (%current-target-system)
+ '((add-after
+ 'unpack 'fix-pkg-config
+ (lambda* (#:key target #:allow-other-keys)
+ (substitute*
+ "Makefile"
+ (("pkg-config")
+ (string-append target "-pkg-config")))
+ #t)))
+ '())
(add-before
'build 'no-werror-no-ldconfig
(lambda _
@@ -2812,37 +2822,44 @@ interface.")
#t))
(add-before
'build 'set-regulator-db-file-name
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
;; Tell CRDA where to find our database.
- (let ((regdb (assoc-ref inputs "wireless-regdb")))
+ (let ((regdb (assoc-ref (or native-inputs inputs)
+ "wireless-regdb")))
(substitute* "crda.c"
(("\"/lib/crda/regulatory.bin\"")
(string-append "\"" regdb
"/lib/crda/regulatory.bin\"")))
#t))))
#:test-target "verify"
- #:make-flags (let ((out (assoc-ref %outputs "out"))
- (regdb (assoc-ref %build-inputs "wireless-regdb")))
- (list "CC=gcc" "V=1"
-
- ;; Disable signature-checking on 'regulatory.bin'.
- ;; The reason is that this simplifies maintenance
- ;; on our side (no need to manage a distro key
- ;; pair), and we can guarantee integrity of
- ;; 'regulatory.bin' by other means anyway, such as
- ;; 'guix gc --verify'. See
- ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
- ;; for a discssion.
- "USE_OPENSSL=0"
-
- (string-append "PREFIX=" out)
- (string-append "SBINDIR=" out "/sbin/")
- (string-append "UDEV_RULE_DIR="
- out "/lib/udev/rules.d")
- (string-append "LDFLAGS=-Wl,-rpath="
- out "/lib -L.")
- (string-append "REG_BIN=" regdb
- "/lib/crda/regulatory.bin")))))
+ #:make-flags (let ((out (assoc-ref %outputs "out"))
+ (regdb (assoc-ref %build-inputs "wireless-regdb"))
+ (target ,(%current-target-system)))
+ (list
+ (string-append
+ "CC=" (if target
+ (string-append target "-gcc") "gcc"))
+ "V=1"
+
+ ;; Disable signature-checking on 'regulatory.bin'.
+ ;; The reason is that this simplifies maintenance
+ ;; on our side (no need to manage a distro key
+ ;; pair), and we can guarantee integrity of
+ ;; 'regulatory.bin' by other means anyway, such as
+ ;; 'guix gc --verify'. See
+ ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
+ ;; for a discssion.
+ "USE_OPENSSL=0"
+
+ (string-append "PREFIX=" out)
+ (string-append "SBINDIR=" out "/sbin/")
+ (string-append "UDEV_RULE_DIR="
+ out "/lib/udev/rules.d")
+ (string-append "LDFLAGS=-Wl,-rpath="
+ out "/lib -L.")
+ (string-append "REG_BIN=" regdb
+ "/lib/crda/regulatory.bin")
+ "all_noverify"))))
(native-inputs `(("pkg-config" ,pkg-config)
("python" ,python-2)
("wireless-regdb" ,wireless-regdb)))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 27/48] gnu: guile-gcrypt: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-28-m.othacehe@gmail.com
* gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gnupg.scm (guile-gcrypt)[source]: Apply previous patch,
[native-inputs]: add guile,
[arguments]: add libgcrypt-config to PATH when cross-compiling.
---
gnu/local.mk | 1 +
gnu/packages/gnupg.scm | 22 +-
.../guile-gcrypt-fix-cross-compilation.patch | 431 ++++++++++++++++++
3 files changed, 452 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch

Toggle diff (485 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 2cf92e4478..bc31682035 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -928,6 +928,7 @@ dist_patch_DATA = \
%D%/packages/patches/guile-relocatable.patch \
%D%/packages/patches/guile-rsvg-pkgconfig.patch \
%D%/packages/patches/guile-emacs-fix-configure.patch \
+ %D%/packages/patches/guile-gcrypt-fix-cross-compilation.patch \
%D%/packages/patches/guile-sqlite3-fix-cross-compilation.patch \
%D%/packages/patches/gstreamer-buffer-reset-offset.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index c7e6aabf79..69da60b972 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -15,6 +15,7 @@
;;; Copyright © 2017 Petter <petter@mykolab.ch>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -477,13 +478,30 @@ gpgpme starting with version 1.7.")
(sha256
(base32
"1lhgh3105yi0ggrjsjibv4wp1ipz8s17pa820hk2wln3rc04wpvf"))
- (file-name (string-append name "-" version "-checkout"))))
+ (file-name (string-append name "-" version "-checkout"))
+ (patches
+ (search-patches "guile-gcrypt-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
+ (arguments
+ ;; When cross-compiling, the bash script libgcrypt-config provided by
+ ;; libgcrypt must be accessible during configure phase.
+ `(,@(if (%current-target-system)
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'add-libgrypt-config
+ (lambda _
+ (setenv "PATH" (string-append
+ (assoc-ref %build-inputs "libgcrypt")
+ "/bin:"
+ (getenv "PATH")))
+ #t))))
+ '())))
(native-inputs
`(("pkg-config" ,pkg-config)
("autoconf" ,autoconf)
("automake" ,automake)
- ("texinfo" ,texinfo)))
+ ("texinfo" ,texinfo)
+ ("guile" ,guile-2.2)))
(inputs
`(("guile" ,guile-2.2)
("libgcrypt" ,libgcrypt)))
diff --git a/gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch b/gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch
new file mode 100644
index 0000000000..cdf15b39b0
--- /dev/null
+++ b/gnu/packages/patches/guile-gcrypt-fix-cross-compilation.patch
@@ -0,0 +1,431 @@
+From 4ec6cb5209461452f7ebb0aae3ae916e28198dc9 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <m.othacehe@gmail.com>
+Date: Sun, 18 Aug 2019 09:42:39 +0200
+Subject: [PATCH] build: Fix cross-compilation.
+
+---
+ Makefile.am | 2 +-
+ configure.ac | 7 ++++++-
+ gcrypt/common.scm | 42 ++++++++++++++++++++++++++++--------------
+ gcrypt/hash.scm | 28 +++++++++++-----------------
+ gcrypt/hmac.scm | 40 +++++++++++++++++++---------------------
+ gcrypt/pk-crypto.scm | 41 ++++++++++++++++++-----------------------
+ gcrypt/random.scm | 7 ++++---
+ 7 files changed, 87 insertions(+), 80 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 0537256..7a3d1b2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -39,7 +39,7 @@ $(guile_install_go_files): install-nobase_modDATA
+ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+ SUFFIXES = .scm .go
+ .scm.go:
+- $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
++ $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
+
+ moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION)
+ godir = $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
+diff --git a/configure.ac b/configure.ac
+index e7ef6cf..7d0f569 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,6 +73,11 @@ AC_SUBST([LIBGCRYPT])
+ AC_SUBST([LIBGCRYPT_PREFIX])
+ AC_SUBST([LIBGCRYPT_LIBDIR])
+
+-GUIX_ASSERT_LIBGCRYPT_USABLE
++if test "$cross_compiling" = "no"; then
++ GUIX_ASSERT_LIBGCRYPT_USABLE
++else
++ GUILE_TARGET="--target=$host_alias"
++ AC_SUBST([GUILE_TARGET])
++fi
+
+ AC_OUTPUT
+diff --git a/gcrypt/common.scm b/gcrypt/common.scm
+index 189003f..a42f609 100644
+--- a/gcrypt/common.scm
++++ b/gcrypt/common.scm
+@@ -21,7 +21,8 @@
+ #:use-module (system foreign)
+ #:use-module (ice-9 match)
+ #:export (gcrypt-version
+- libgcrypt-func
++ libgcrypt->pointer
++ libgcrypt->procedure
+ error-source error-string))
+
+ ;;; Commentary:
+@@ -31,34 +32,47 @@
+ ;;;
+ ;;; Code:
+
+-(define libgcrypt-func
+- (let ((lib (dynamic-link %libgcrypt)))
+- (lambda (func)
+- "Return a pointer to symbol FUNC in libgcrypt."
+- (dynamic-func func lib))))
++(define (libgcrypt->pointer name)
++ "Return a pointer to symbol FUNC in libgcrypt."
++ (catch #t
++ (lambda ()
++ (dynamic-func name (dynamic-link %libgcrypt)))
++ (lambda args
++ (lambda _
++ (throw 'system-error name "~A" (list (strerror ENOSYS))
++ (list ENOSYS))))))
++
++(define (libgcrypt->procedure return name params)
++ "Return a pointer to symbol FUNC in libgcrypt."
++ (catch #t
++ (lambda ()
++ (let ((ptr (dynamic-func name (dynamic-link %libgcrypt))))
++ ;; The #:return-errno? facility was introduced in Guile 2.0.12.
++ (pointer->procedure return ptr params
++ #:return-errno? #t)))
++ (lambda args
++ (lambda _
++ (throw 'system-error name "~A" (list (strerror ENOSYS))
++ (list ENOSYS))))))
+
+ (define gcrypt-version
+ ;; According to the manual, this function must be called before any other,
+ ;; and it's not clear whether it can be called more than once. So call it
+ ;; right here from the top level.
+- (let* ((ptr (libgcrypt-func "gcry_check_version"))
+- (proc (pointer->procedure '* ptr '(*)))
+- (version (pointer->string (proc %null-pointer))))
++ (let ((proc (libgcrypt->procedure '* "gcry_check_version" '(*))))
+ (lambda ()
+ "Return the version number of libgcrypt as a string."
+- version)))
++ (pointer->string (proc %null-pointer)))))
+
+ (define error-source
+- (let* ((ptr (libgcrypt-func "gcry_strsource"))
+- (proc (pointer->procedure '* ptr (list int))))
++ (let ((proc (libgcrypt->procedure '* "gcry_strsource" (list int))))
+ (lambda (err)
+ "Return the error source (a string) for ERR, an error code as thrown
+ along with 'gcry-error'."
+ (pointer->string (proc err)))))
+
+ (define error-string
+- (let* ((ptr (libgcrypt-func "gcry_strerror"))
+- (proc (pointer->procedure '* ptr (list int))))
++ (let ((proc (libgcrypt->procedure '* "gcry_strerror" (list int))))
+ (lambda (err)
+ "Return the error description (a string) for ERR, an error code as
+ thrown along with 'gcry-error'."
+diff --git a/gcrypt/hash.scm b/gcrypt/hash.scm
+index dad06e4..1b3fa67 100644
+--- a/gcrypt/hash.scm
++++ b/gcrypt/hash.scm
+@@ -50,13 +50,13 @@
+ (identifier-syntax 2))
+
+ (define bytevector-hash
+- (let ((hash (pointer->procedure void
+- (libgcrypt-func "gcry_md_hash_buffer")
+- `(,int * * ,size_t))))
++ (let ((proc (libgcrypt->procedure void
++ "gcry_md_hash_buffer"
++ `(,int * * ,size_t))))
+ (lambda (bv type size)
+ "Return the hash TYPE, of SIZE bytes, of BV as a bytevector."
+ (let ((digest (make-bytevector size)))
+- (hash type (bytevector->pointer digest)
++ (proc type (bytevector->pointer digest)
+ (bytevector->pointer bv) (bytevector-length bv))
+ digest))))
+
+@@ -67,30 +67,24 @@
+ (cut bytevector-hash <> GCRY_MD_SHA256 (/ 256 8)))
+
+ (define open-sha256-md
+- (let ((open (pointer->procedure int
+- (libgcrypt-func "gcry_md_open")
+- `(* ,int ,unsigned-int))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_md_open"
++ `(* ,int ,unsigned-int))))
+ (lambda ()
+ (let* ((md (bytevector->pointer (make-bytevector (sizeof '*))))
+- (err (open md GCRY_MD_SHA256 0)))
++ (err (proc md GCRY_MD_SHA256 0)))
+ (if (zero? err)
+ (dereference-pointer md)
+ (throw 'gcrypt-error err))))))
+
+ (define md-write
+- (pointer->procedure void
+- (libgcrypt-func "gcry_md_write")
+- `(* * ,size_t)))
++ (libgcrypt->procedure void "gcry_md_write" `(* * ,size_t)))
+
+ (define md-read
+- (pointer->procedure '*
+- (libgcrypt-func "gcry_md_read")
+- `(* ,int)))
++ (libgcrypt->procedure '* "gcry_md_read" `(* ,int)))
+
+ (define md-close
+- (pointer->procedure void
+- (libgcrypt-func "gcry_md_close")
+- '(*)))
++ (libgcrypt->procedure void "gcry_md_close" '(*)))
+
+
+ (define (open-sha256-port)
+diff --git a/gcrypt/hmac.scm b/gcrypt/hmac.scm
+index 0d8cc61..b9e1a9e 100644
+--- a/gcrypt/hmac.scm
++++ b/gcrypt/hmac.scm
+@@ -42,11 +42,11 @@
+ (format port "#<mac ~x>"
+ (pointer-address (mac->pointer mac)))))
+
+-
+ (define %gcry-mac-open
+- (pointer->procedure int (libgcrypt-func "gcry_mac_open")
+- `(* ,int ,unsigned-int *))) ; gcry_mac_hd_t *HD, int ALGO,
+- ; unsigned int FLAGS, gcry_ctx_t CTX
++ (libgcrypt->procedure int "gcry_mac_open"
++ ;; gcry_mac_hd_t *HD, int ALGO,
++ ;; unsigned int FLAGS, gcry_ctx_t CTX
++ `(* ,int ,unsigned-int *)))
+
+ (define mac-algorithms-mapping
+ (alist->hashq-table
+@@ -59,9 +59,8 @@
+ (hashq-ref mac-algorithms-mapping sym))
+
+ (define mac-algo-maclen
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_get_algo_maclen")
+- `(,int))))
++ (let ((proc (libgcrypt->procedure
++ int "gcry_mac_get_algo_maclen" `(,int))))
+ (lambda (sym)
+ "Get expected length in bytes of mac yielded by algorithm SYM"
+ (proc (mac-algo-ref sym)))))
+@@ -76,8 +75,7 @@
+ (throw 'gcry-error 'mac-open err))))
+
+ (define %gcry-mac-setkey
+- (pointer->procedure int (libgcrypt-func "gcry_mac_setkey")
+- `(* * ,size_t)))
++ (libgcrypt->procedure int "gcry_mac_setkey" `(* * ,size_t)))
+
+ (define (mac-setkey mac key)
+ "Set the KEY on <mac> object MAC
+@@ -96,9 +94,9 @@ In our case, KEY is either a string or a bytevector."
+ (throw 'gcry-error 'mac-setkey err))))
+
+ (define mac-close
+- (let ((proc (pointer->procedure
+- void (libgcrypt-func "gcry_mac_close")
+- '(*)))) ; gcry_mac_hd_t H
++ (let ((proc (libgcrypt->procedure void
++ "gcry_mac_close"
++ '(*)))) ; gcry_mac_hd_t H
+ (lambda (mac)
+ "Release all resources of MAC.
+
+@@ -106,9 +104,9 @@ Running this on an already closed <mac> might segfault :)"
+ (proc (mac->pointer mac)))))
+
+ (define mac-write
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_write")
+- `(* * ,size_t))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_mac_write"
++ `(* * ,size_t))))
+ (lambda (mac obj)
+ "Writes string or bytevector OBJ to MAC"
+ (let* ((bv (match obj
+@@ -124,9 +122,9 @@ Running this on an already closed <mac> might segfault :)"
+ (throw 'gcry-error 'mac-write err))))))
+
+ (define mac-read
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_read")
+- `(* * *))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_mac_read"
++ `(* * *))))
+ (lambda (mac algorithm)
+ "Get bytevector representing result of MAC's written, signed data"
+ (define (int-bv* n)
+@@ -148,9 +146,9 @@ Running this on an already closed <mac> might segfault :)"
+ ;; rather than the gcry_error_t type.
+
+ (define mac-verify
+- (let ((proc (pointer->procedure
+- int (libgcrypt-func "gcry_mac_verify")
+- `(* * ,size_t))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_mac_verify"
++ `(* * ,size_t))))
+ (lambda (mac bv)
+ "Verify that BV matches result calculated in MAC
+
+diff --git a/gcrypt/pk-crypto.scm b/gcrypt/pk-crypto.scm
+index be664a3..5d614a0 100644
+--- a/gcrypt/pk-crypto.scm
++++ b/gcrypt/pk-crypto.scm
+@@ -81,7 +81,7 @@
+ 16))))
+
+ (define finalize-canonical-sexp!
+- (libgcrypt-func "gcry_sexp_release"))
++ (libgcrypt->pointer "gcry_sexp_release"))
+
+ (define-inlinable (pointer->canonical-sexp ptr)
+ "Return a <canonical-sexp> that wraps PTR."
+@@ -96,8 +96,9 @@
+ sexp))
+
+ (define string->canonical-sexp
+- (let* ((ptr (libgcrypt-func "gcry_sexp_new"))
+- (proc (pointer->procedure int ptr `(* * ,size_t ,int))))
++ (let ((proc (libgcrypt->procedure int
++ "gcry_sexp_new"
++ `(* * ,size_t ,int))))
+ (lambda (str)
+ "Parse STR and return the corresponding gcrypt s-expression."
+
+@@ -115,8 +116,9 @@
+ (identifier-syntax 3))
+
+ (define canonical-sexp->string
+- (let* ((ptr (libgcrypt-func "gcry_sexp_sprint"))
+- (proc (pointer->procedure size_t ptr `(* ,int * ,size_t))))
++ (let ((proc (libgcrypt->procedure size_t
++ "gcry_sexp_sprint"
++ `(* ,int * ,size_t))))
+ (lambda (sexp)
+ "Return a textual representation of SEXP."
+ (let loop ((len 1024))
+@@ -134,8 +136,7 @@
+ read-string)))
+
+ (define canonical-sexp-car
+- (let* ((ptr (libgcrypt-func "gcry_sexp_car"))
+- (proc (pointer->procedure '* ptr '(*))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_car" '(*))))
+ (lambda (lst)
+ "Return the first element of LST, an sexp, if that element is a list;
+ return #f if LST or its first element is not a list (this is different from
+@@ -146,8 +147,7 @@ the usual Lisp 'car'.)"
+ (pointer->canonical-sexp result))))))
+
+ (define canonical-sexp-cdr
+- (let* ((ptr (libgcrypt-func "gcry_sexp_cdr"))
+- (proc (pointer->procedure '* ptr '(*))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_cdr" '(*))))
+ (lambda (lst)
+ "Return the tail of LST, an sexp, or #f if LST is not a list."
+ (let ((result (proc (canonical-sexp->pointer lst))))
+@@ -156,8 +156,7 @@ the usual Lisp 'car'.)"
+ (pointer->canonical-sexp result))))))
+
+ (define canonical-sexp-nth
+- (let* ((ptr (libgcrypt-func "gcry_sexp_nth"))
+- (proc (pointer->procedure '* ptr `(* ,int))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_nth" `(* ,int))))
+ (lambda (lst index)
+ "Return the INDEXth nested element of LST, an s-expression. Return #f
+ if that element does not exist, or if it's an atom. (Note: this is obviously
+@@ -174,8 +173,7 @@ different from Scheme's 'list-ref'.)"
+ (sizeof size_t)))
+
+ (define canonical-sexp-length
+- (let* ((ptr (libgcrypt-func "gcry_sexp_length"))
+- (proc (pointer->procedure int ptr '(*))))
++ (let ((proc (libgcrypt->procedure int "gcry_sexp_length" '(*))))
+ (lambda (sexp)
+ "Return the length of SEXP if it's a list (including the empty list);
+ return zero if SEXP is an atom."
+@@ -194,8 +192,7 @@ return zero if SEXP is an atom."
+ (not (char-set-contains? char-set:digit (string-ref str 0)))))))
+
+ (define canonical-sexp-nth-data
+- (let* ((ptr (libgcrypt-func "gcry_sexp_nth_data"))
+- (proc (pointer->procedure '* ptr `(* ,int *))))
++ (let ((proc (libgcrypt->procedure '* "gcry_sexp_nth_data" `(* ,int *))))
+ (lambda (lst index)
+ "Return as a symbol (for \"sexp tokens\") or a bytevector (for any other
+ \"octet string\") the INDEXth data element (atom) of LST, an s-expression.
+@@ -266,8 +263,7 @@ Return #f if DATA does not conform."
+ (values #f #f))))
+
+ (define sign
+- (let* ((ptr (libgcrypt-func "gcry_pk_sign"))
+- (proc (pointer->procedure int ptr '(* * *))))
++ (let ((proc (libgcrypt->procedure int "gcry_pk_sign" '(* * *))))
+ (lambda (data secret-key)
+ "Sign DATA, a canonical s-expression representing a suitable hash, with
+ SECRET-KEY (a canonical s-expression whose car is 'private-key'.) Note that
+@@ -281,8 +277,7 @@ DATA must be a 'data' s-expression, as returned by
+ (throw 'gcry-error 'sign err))))))
+
+ (define verify
+- (let* ((ptr (libgcrypt-func "gcry_pk_verify"))
+- (proc (pointer->procedure int ptr '(* * *))))
++ (let ((proc (libgcrypt->procedure int "gcry_pk_verify" '(* * *))))
+ (lambda (signature data public-key)
+ "Verify that SIGNATURE is a signature of DATA with PUBLIC-KEY, all of
+ which are gcrypt s-expressions."
+@@ -291,8 +286,7 @@ which are gcrypt s-expressions."
+ (canonical-sexp->pointer public-key))))))
+
+ (define generate-key
+- (let* ((ptr (libgcrypt-func "gcry_pk_genkey"))
+- (proc (pointer->procedure int ptr '(* *))))
++ (let ((proc (libgcrypt->procedure int "gcry_pk_genkey" '(* *))))
+ (lambda (params)
+ "Return as an s-expression a new key pair for PARAMS. PARAMS must be an
+ s-expression like: (genkey (rsa (nbits 4:2048)))."
+@@ -303,8 +297,9 @@ s-expression like: (genkey (rsa (nbits 4:2048)))."
+ (throw 'gcry-error 'generate-key err))))))
+
+ (define find-sexp-token
+- (let* ((ptr (libgcrypt-func "gcry_sexp_find_token"))
+- (proc (pointer->procedure '* ptr `(* * ,size_t))))
++ (let ((proc (libgcrypt->procedure '*
++ "gcry_sexp_find_token"
++ `(* * ,size_t))))
+ (lambda (sexp token)
+ "Find in SEXP the first element whose 'car' is TOKEN and return it;
+ return #f if not found."
+diff --git a/gcrypt/random.scm b/gcrypt/random.scm
+index 5391f94..ea6f9d3 100644
+--- a/gcrypt/random.scm
++++ b/gcrypt/random.scm
+@@ -33,7 +33,8 @@
+ (define %gcry-very-strong-random 2)
+
+ (define %gcry-randomize
+- (pointer->procedure void (libgcrypt-func "gcry_randomize")
++ (libgcrypt->procedure void
++ "gcry_randomize"
+ `(* ,size_t ,int))) ; buffer, length, level
+
+ (define* (gen-random-bv #:optional (bv-length 50)
+@@ -44,8 +45,8 @@
+ bv))
+
+ (define %gcry-create-nonce
+- (pointer->procedure void (
This message was truncated. Download the full message here.
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 33/48] gnu: guile-xcb: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-34-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/guile-wm.scm (guile-xcb)[native-inputs]: Add guile.
---
gnu/packages/guile-wm.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 2955c06a0d..6d17413901 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2016 Alex ter Weele <alex.ter.weele@gmail.com>
;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 ng0 <ng0@n0.is>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -57,7 +58,8 @@
"--with-guile-site-ccache-dir="
(assoc-ref %outputs "out")
"/lib/guile/2.2/site-ccache"))))
- (native-inputs `(("pkg-config" ,pkg-config)
+ (native-inputs `(("guile" ,guile-2.2)
+ ("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
(inputs `(("guile" ,guile-2.2)
("xcb" ,xcb-proto)))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 31/48] gnu: libnl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-32-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/linux.scm (libnl)[inputs]: Add python-2 and python-3 unless cross-compiling,
[outputs]: disable python2 and python3 outputs when cross-compiling,
[arguments]: Disable install-python phase when cross-compiling. In install-doc
phase, search libnl3-doc in both inputs and native-inputs.
---
gnu/packages/linux.scm | 49 +++++++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 20 deletions(-)

Toggle diff (79 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 874fa819e5..9c38bbcfc0 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -36,6 +36,7 @@
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019 Stefan Stefanovi? <stefanx2ovic@gmail.com>
;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1949,36 +1950,44 @@ transparently through a bridge.")
(string-join (string-split version #\.) "_")
"/libnl-doc-" version ".tar.gz"))
(sha256
- (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
- (inputs
- `(("python-2" ,python-2)
- ("python-3" ,python-3)))
- (outputs '("out" "doc" "python2" "python3"))
+ (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))
+ ,@(if (%current-target-system)
+ '()
+ '(("python-2" ,python-2)
+ ("python-3" ,python-3)))))
+ (outputs `("out" "doc"
+ ,@(if (%current-target-system)
+ '()
+ '("python2" "python3"))))
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1))
#:phases
(modify-phases %standard-phases
- (add-after 'install 'install-python
- (lambda* (#:key outputs #:allow-other-keys)
- (define (python-inst python)
- (invoke python "setup.py" "build")
- (invoke python "setup.py" "install"
- (string-append "--prefix="
- (assoc-ref %outputs python)))
- (invoke python "setup.py" "clean"))
- (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
- (assoc-ref %outputs "out")))
- (with-directory-excursion "./python"
- (for-each python-inst '("python2" "python3")))
- #t))
+ ,@(if (%current-target-system)
+ '()
+ ;; Cross building Python extensions is not supported.
+ '((add-after 'install 'install-python
+ (lambda* (#:key outputs #:allow-other-keys)
+ (define (python-inst python)
+ (invoke python "setup.py" "build")
+ (invoke python "setup.py" "install"
+ (string-append "--prefix="
+ (assoc-ref %outputs python)))
+ (invoke python "setup.py" "clean"))
+ (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
+ (assoc-ref %outputs "out")))
+ (with-directory-excursion "./python"
+ (for-each python-inst '("python2" "python3")))
+ #t))))
(add-after 'install 'install-doc
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
(let ((dest (string-append (assoc-ref outputs "doc")
"/share/doc/libnl")))
(mkdir-p dest)
- (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
+ (invoke "tar" "xf"
+ (assoc-ref (or native-inputs inputs) "libnl3-doc")
"--strip-components=1" "-C" dest)))))))
(home-page "https://www.infradead.org/~tgr/libnl/")
(synopsis "NetLink protocol library suite")
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 34/48] gnu: guile-wm: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-35-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/guile-wm.scm (guile-wm): Add guile and guile-xcb to native-inputs.
---
gnu/packages/guile-wm.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 6d17413901..3a6eebc91a 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -174,7 +174,9 @@ dependencies.")
Type=Application~%"
,name ,synopsis %output))))
#t)))))
- (native-inputs `(("pkg-config" ,pkg-config)
+ (native-inputs `(("guile" ,guile-2.2)
+ ("guile-xcb" ,guile-xcb)
+ ("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
(inputs `(("guile" ,guile-2.2)
("guile-xcb" ,guile-xcb)))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 26/48] gnu: guile-sqlite3: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-27-m.othacehe@gmail.com
* gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/guile.scm (guile-sqlite3)[source]: Apply previous patch,
[native-inputs]: add guile.
---
gnu/local.mk | 1 +
gnu/packages/guile.scm | 7 ++-
.../guile-sqlite3-fix-cross-compilation.patch | 55 +++++++++++++++++++
3 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch

Toggle diff (104 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ae53257a77..2cf92e4478 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -928,6 +928,7 @@ dist_patch_DATA = \
%D%/packages/patches/guile-relocatable.patch \
%D%/packages/patches/guile-rsvg-pkgconfig.patch \
%D%/packages/patches/guile-emacs-fix-configure.patch \
+ %D%/packages/patches/guile-sqlite3-fix-cross-compilation.patch \
%D%/packages/patches/gstreamer-buffer-reset-offset.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index b07a570654..713390ada1 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -9,7 +9,7 @@
;;; Copyright © 2016, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017, 2018 Amirouche <amirouche@hypermove.net>
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
@@ -521,11 +521,14 @@ Guile's foreign function interface.")
(sha256
(base32
"1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
- (file-name (string-append name "-" version "-checkout"))))
+ (file-name (string-append name "-" version "-checkout"))
+ (patches
+ (search-patches "guile-sqlite3-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
+ ("guile" ,guile-2.2)
("pkg-config" ,pkg-config)))
(inputs
`(("guile" ,guile-2.2)
diff --git a/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
new file mode 100644
index 0000000000..9ea9a47677
--- /dev/null
+++ b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
@@ -0,0 +1,55 @@
+From a6e9e62a77ecc5012929613e20da23b2636450a5 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <mathieu.othacehe@parrot.com>
+Date: Mon, 25 Mar 2019 11:00:38 +0100
+Subject: [PATCH] cross compile
+
+---
+ build-aux/guile.am | 2 +-
+ configure.ac | 19 ++++++++++++-------
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/build-aux/guile.am b/build-aux/guile.am
+index dc1e63f..3126372 100644
+--- a/build-aux/guile.am
++++ b/build-aux/guile.am
+@@ -16,4 +16,4 @@ EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
+ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+ SUFFIXES = .scm .go
+ .scm.go:
+- $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
++ $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
+diff --git a/configure.ac b/configure.ac
+index f648fcb..2d34d0a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,15 +21,20 @@ PKG_CHECK_MODULES([SQLITE], [sqlite3])
+ SQLITE_LIBDIR="`"$PKG_CONFIG" sqlite3 --variable libdir`"
+ AC_SUBST([SQLITE_LIBDIR])
+
+-AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
+-GUILE_CHECK([retval],
+- [(dynamic-func \"sqlite3_open_v2\"
++if test "$cross_compiling" = "no"; then
++ AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
++ GUILE_CHECK([retval],
++ [(dynamic-func \"sqlite3_open_v2\"
+ (dynamic-link \"$SQLITE_LIBDIR/libsqlite3\"))])
+-if test "$retval" != 0; then
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ if test "$retval" != 0; then
++ AC_MSG_RESULT([no])
++ AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ else
++ AC_MSG_RESULT([yes])
++ fi
+ else
+- AC_MSG_RESULT([yes])
++ GUILE_TARGET="--target=$host_alias"
++ AC_SUBST([GUILE_TARGET])
+ fi
+
+ AC_CONFIG_FILES([Makefile sqlite3.scm])
+--
+2.17.1
+
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 35/48] gnu: cmake: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-36-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/cmake.scm (cmake-minimal)[inputs]: Move all inputs to ...
[native-inputs]: ... here, except for ncurses.
---
gnu/packages/cmake.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 9bf0273f00..cae66f2525 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -145,16 +146,17 @@
(replace 'configure
(lambda* (#:key (configure-flags '()) #:allow-other-keys)
(apply invoke "./configure" configure-flags))))))
- (inputs
+ (native-inputs
`(("bzip2" ,bzip2)
("curl" ,curl)
("expat" ,expat)
("file" ,file)
("libarchive" ,libarchive)
("libuv" ,libuv)
- ("ncurses" ,ncurses) ; required for ccmake
("rhash" ,rhash)
("zlib" ,zlib)))
+ (inputs
+ `(("ncurses" ,ncurses))) ; required for ccmake
(native-search-paths
(list (search-path-specification
(variable "CMAKE_PREFIX_PATH")
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 36/48] gnu: console-setup: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-37-m.othacehe@gmail.com
* gnu/packages/xorg.scm (console-setup)[native-inputs]: Add perl,
[arguments]: search for bash in both native-inputs and inputs.
---
gnu/packages/xorg.scm | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index d5d983a8d2..ecd8c29f21 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -6412,25 +6412,28 @@ output.")
" ")))
#t))
(add-before 'build 'make-doubled-bdfs
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
(invoke "make" "-C" "Fonts"
"doubled_bdfs"
(string-append "SHELL="
- (assoc-ref inputs "bash")
+ (assoc-ref (or native-inputs inputs)
+ "bash")
"/bin/bash"))))
(replace 'install
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
(let ((out (assoc-ref %outputs "out")))
(invoke "make" "install-linux"
(string-append "prefix=" out)
(string-append "SHELL="
- (assoc-ref inputs "bash")
+ (assoc-ref (or native-inputs inputs)
+ "bash")
"/bin/bash"))))))))
(native-inputs
`(("pkg-config" ,pkg-config)
("bdftopcf" ,bdftopcf)
("bdfresize" ,bdfresize)
- ("sharutils" ,sharutils))) ;for 'uuencode'
+ ("sharutils" ,sharutils) ;for 'uuencode'
+ ("perl" ,perl)))
(inputs
`(("perl" ,perl))) ;used by 'ckbcomp'
(synopsis "Set up the Linux console font and keyboard")
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 37/48] gnu: mdadm: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-38-m.othacehe@gmail.com
* gnu/packages/linux.scm (mdadm)[arguments]: Search for coreutils in both
native-inputs and inputs.
---
gnu/packages/linux.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ed2d21859d..47e6c1da53 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3528,8 +3528,9 @@ MPEG-2 and audio over Linux IEEE 1394.")
#:phases
(modify-phases %standard-phases
(add-before 'build 'patch-program-paths
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((coreutils (assoc-ref inputs "coreutils")))
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
+ (let ((coreutils (assoc-ref (or native-inputs inputs)
+ "coreutils")))
(substitute* "udev-md-raid-arrays.rules"
(("/usr/bin/(readlink|basename)" all program)
(string-append coreutils "/bin/" program))))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 38/48] gnu: grub: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-39-m.othacehe@gmail.com
* gnu/packages/bootloaders.scm (grub)[arguments]: Search for unifont in both
native-inputs and inputs.
---
gnu/packages/bootloaders.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 41a2de9706..b235e1bc78 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -99,7 +99,7 @@
(list "PYTHON=true")
#:phases (modify-phases %standard-phases
(add-after 'unpack 'patch-stuff
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
(substitute* "grub-core/Makefile.in"
(("/bin/sh") (which "sh")))
@@ -114,7 +114,9 @@
"/sbin/mdadm\"")))
;; Make the font visible.
- (copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz")
+ (copy-file (assoc-ref (or native-inputs inputs)
+ "unifont")
+ "unifont.bdf.gz")
(system* "gunzip" "unifont.bdf.gz")
;; Give the absolute file name of 'ckbcomp'.
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 39/48] linux-initrd: Use native gzip.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-40-m.othacehe@gmail.com
* gnu/system/linux-initrd.scm (expression->initrd): Pass native gzip to
build-initrd procedure.
---
gnu/system/linux-initrd.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 7e9563b923..0efb8fb222 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -99,7 +99,7 @@ the derivations referenced by EXP are automatically copied to the initrd."
#:init #$init
;; Copy everything INIT refers to into the initrd.
#:references-graphs '("closure")
- #:gzip (string-append #$gzip "/bin/gzip")))))
+ #:gzip (string-append #+gzip "/bin/gzip")))))
(file-append (computed-file name builder
#:options
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 40/48] gnu: linux-libre: Enable built-in ext4 support.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-41-m.othacehe@gmail.com
When running qemu-img from (gnu system vm) with an aarch64 kernel, mounting
ext4 partitions fails because no modprobe of ext4 module is made. Like for
other kernel configs, provide built-in support for ext4 partitions.

* gnu/packages/aux-files/linux-libre/5.2-arm64.conf: Enable built-in ext4,
like in intel and armhf configs.
---
gnu/packages/aux-files/linux-libre/5.2-arm64.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/aux-files/linux-libre/5.2-arm64.conf b/gnu/packages/aux-files/linux-libre/5.2-arm64.conf
index bfd8c18ddb..4ad652a78f 100644
--- a/gnu/packages/aux-files/linux-libre/5.2-arm64.conf
+++ b/gnu/packages/aux-files/linux-libre/5.2-arm64.conf
@@ -8023,7 +8023,7 @@ CONFIG_VALIDATE_FS_PARSER=y
CONFIG_FS_IOMAP=y
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
-CONFIG_EXT4_FS=m
+CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 42/48] gexp: Pass target to compiled-modules in lower-gexp.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-43-m.othacehe@gmail.com
* guix/gexp.scm (lower-gexp): Pass target argument to compiled-modules.
---
guix/gexp.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 514422cb08..afa28779c8 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -727,6 +727,7 @@ derivations--e.g., code evaluated for its side effects."
(compiled (if (pair? %modules)
(compiled-modules %modules
#:system system
+ #:target target
#:module-path module-path
#:extensions extensions
#:guile guile
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 43/48] utils: Use target-arm64? and target-arm? helpers.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-44-m.othacehe@gmail.com
* guix/utils.scm (target-arm64?, target-arm?): New exported procedures.
---
guix/utils.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (28 lines)
diff --git a/guix/utils.scm b/guix/utils.scm
index f480c3291f..3eb156ad4e 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -78,6 +78,8 @@
package-name->name+version
target-mingw?
target-arm32?
+ target-arm64?
+ target-arm?
target-64bit?
version-compare
version>?
@@ -493,6 +495,12 @@ a character other than '@'."
(define (target-arm32?)
(string-prefix? "arm" (or (%current-target-system) (%current-system))))
+(define (target-arm64?)
+ (string-prefix? "aarch64" (or (%current-target-system) (%current-system))))
+
+(define (target-arm?)
+ (or (target-arm32?) (target-arm64?)))
+
(define (target-64bit?)
(let ((system (or (%current-target-system) (%current-system))))
(any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 41/48] gexp: Use cross extensions when cross-compiling.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-42-m.othacehe@gmail.com
---
guix/gexp.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index d9bdde2e42..514422cb08 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1513,7 +1513,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
(string-append extension
"/share/guile/site/"
(effective-version)))
- '((ungexp-native-splicing extensions)))
+ '((ungexp-splicing extensions)))
%load-path)))
(set! %load-compiled-path
(cons (ungexp compiled)
@@ -1522,7 +1522,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
"/lib/guile/"
(effective-version)
"/site-ccache"))
- '((ungexp-native-splicing extensions)))
+ '((ungexp-splicing extensions)))
%load-compiled-path)))))))))
(define* (gexp->script name exp
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 44/48] build: vm: Fix arm32 support.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-45-m.othacehe@gmail.com
* gnu/build/vm.scm (load-in-linux-vm): Disable qemu highmem support on ARM32
systems.
---
gnu/build/vm.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (21 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a5d9fefa62..b85398ed24 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -102,6 +102,14 @@ the #:references-graphs parameter of 'derivation'."
;; hardware limits imposed by other machines.
,@(if target-arm32? '("-M" "virt") '())
+ ;; On ARM32, if the kernel is built without LPAE support, ECAM conflicts
+ ;; with VIRT_PCIE_MMIO causing PCI devices not to show up. Disable
+ ;; explicitely highmem to fix it.
+ ;; See: https://bugs.launchpad.net/qemu/+bug/1790975.
+ ,@(if target-arm32?
+ '("-machine" "highmem=off")
+ '())
+
;; Only enable kvm if we see /dev/kvm exists. This allows users without
;; hardware virtualization to still use these commands. KVM support is
;; still buggy on some ARM32 boards. Do not use it even if available.
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 45/48] system: vm: Add arm64 support.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-46-m.othacehe@gmail.com
* gnu/build/vm.scm (load-in-linux-vm): Add target-arm64? argument and use it
to pass correct arguments to qemu.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass the new
target-arm64? argument added above. Do not add ESP partition on all ARM
targets. Do not pass grub-efi package to initialize-hard-disk on ARM targets.
---
gnu/build/vm.scm | 22 +++++++++++++++++-----
gnu/system/vm.scm | 17 +++++++++++------
2 files changed, 28 insertions(+), 11 deletions(-)

Toggle diff (113 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index b85398ed24..e57917a9e5 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -82,6 +82,7 @@
make-disk-image?
single-file-output?
target-arm32?
+ target-arm64?
(disk-image-size (* 100 (expt 2 20)))
(disk-image-format "qcow2")
(references-graphs '()))
@@ -97,10 +98,14 @@ access it via /dev/hda.
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
the #:references-graphs parameter of 'derivation'."
+ (define target-arm? (or target-arm32? target-arm64?))
+
(define arch-specific-flags
`(;; On ARM, a machine has to be specified. Use "virt" machine to avoid
;; hardware limits imposed by other machines.
- ,@(if target-arm32? '("-M" "virt") '())
+ ,@(if target-arm?
+ '("-M" "virt")
+ '())
;; On ARM32, if the kernel is built without LPAE support, ECAM conflicts
;; with VIRT_PCIE_MMIO causing PCI devices not to show up. Disable
@@ -110,11 +115,18 @@ the #:references-graphs parameter of 'derivation'."
'("-machine" "highmem=off")
'())
+ ;; On ARM64, we have to specify the CPU. "max" behaves as "host" when
+ ;; KVM is enabled, and like a system CPU with the maximum possible
+ ;; feature set otherwise.
+ ,@(if target-arm64?
+ '("-cpu" "max")
+ '())
+
;; Only enable kvm if we see /dev/kvm exists. This allows users without
;; hardware virtualization to still use these commands. KVM support is
- ;; still buggy on some ARM32 boards. Do not use it even if available.
+ ;; still buggy on some ARM boards. Do not use it even if available.
,@(if (and (file-exists? "/dev/kvm")
- (not target-arm32?))
+ (not target-arm?))
'("-enable-kvm")
'())
@@ -125,11 +137,11 @@ the #:references-graphs parameter of 'derivation'."
;; The serial port name differs between emulated
;; architectures/machines.
" console="
- (if target-arm32? "ttyAMA0" "ttyS0"))
+ (if target-arm? "ttyAMA0" "ttyS0"))
;; NIC is not supported on ARM "virt" machine, so use a user mode
;; network stack instead.
- ,@(if target-arm32?
+ ,@(if target-arm?
'("-device" "virtio-net-pci,netdev=mynet"
"-netdev" "user,id=mynet")
'("-net" "nic,model=virtio"))))
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index ac6e4ded92..07cee2d4f5 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -235,10 +235,12 @@ made available under the /xchg CIFS share."
#:memory-size #$memory-size
#:make-disk-image? #$make-disk-image?
#:single-file-output? #$single-file-output?
- ;; FIXME: ‘target-arm32?’ may not operate on
- ;; the right system/target values. Rewrite
+ ;; FIXME: ‘target-arm32?’ and
+ ;; ‘target-arm64?’ may not operate on the
+ ;; right system/target values. Rewrite
;; using ‘let-system’ when available.
#:target-arm32? #$(target-arm32?)
+ #:target-arm64? #$(target-arm64?)
#:disk-image-format #$disk-image-format
#:disk-image-size size
#:references-graphs graphs))))))
@@ -452,10 +454,10 @@ system."
;; bootloaders if we are not targeting ARM because UEFI
;; support in U-Boot is experimental.
;;
- ;; FIXME: ‘target-arm32?’ may be not operate on the right
+ ;; FIXME: ‘target-arm?’ may be not operate on the right
;; system/target values. Rewrite using ‘let-system’ when
;; available.
- (if #$(target-arm32?)
+ (if #$(target-arm?)
'()
(list (partition
;; The standalone grub image is about 10MiB, but
@@ -466,10 +468,13 @@ system."
;; when mounting. The actual FAT-ness is based
;; on file system size (16 in this case).
(file-system "vfat")
- (flags '(esp))))))))
+ (flags '(esp)))))))
+ (grub-efi #$@(if (target-arm?)
+ '(#f)
+ #~(#$grub-efi))))
(initialize-hard-disk "/dev/vda"
#:partitions partitions
- #:grub-efi #$grub-efi
+ #:grub-efi grub-efi
#:bootloader-package
#$(bootloader-package bootloader)
#:bootcfg #$bootcfg-drv
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 46/48] system: vm: Support cross-compilation.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-47-m.othacehe@gmail.com
* gnu/system.scm (system-linux-image-file-name): Add support for cross-built
systems. Remove system argument that was ignored,
(operating-system-kernel-file): adapt by removing ignored os argument.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add target argument,
move qemu from inputs list to a new native-inputs list and adapt
set-path-environment-variable call accordingly. Pass target to qemu-command
and gexp->derivation calls.
(iso9660-image): Move qemu from inputs to a new native-inputs list and adapt
set-path-environment-variable accordingly.
(qemu-image): Add target argument, move qemu from inputs list to a new
native-inputs list and adapt set-path-environment-variable call
accordingly. Pass target argument to expression->derivation-in-linux-vm call.
---
gnu/system.scm | 15 ++++++++-------
gnu/system/vm.scm | 25 ++++++++++++++++++-------
2 files changed, 26 insertions(+), 14 deletions(-)

Toggle diff (147 lines)
diff --git a/gnu/system.scm b/gnu/system.scm
index 485896ba0a..85059119cc 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -439,20 +439,21 @@ from the initrd."
"Return the list of swap services for OS."
(map swap-service (operating-system-swap-devices os)))
-(define* (system-linux-image-file-name #:optional (system (%current-system)))
+(define* (system-linux-image-file-name)
"Return the basename of the kernel image file for SYSTEM."
;; FIXME: Evaluate the conditional based on the actual current system.
- (cond
- ((string-prefix? "arm" (%current-system)) "zImage")
- ((string-prefix? "mips" (%current-system)) "vmlinuz")
- ((string-prefix? "aarch64" (%current-system)) "Image")
- (else "bzImage")))
+ (let ((target (or (%current-target-system) (%current-system))))
+ (cond
+ ((string-prefix? "arm" target) "zImage")
+ ((string-prefix? "mips" target) "vmlinuz")
+ ((string-prefix? "aarch64" target) "Image")
+ (else "bzImage"))))
(define (operating-system-kernel-file os)
"Return an object representing the absolute file name of the kernel image of
OS."
(file-append (operating-system-kernel os)
- "/" (system-linux-image-file-name os)))
+ "/" (system-linux-image-file-name)))
(define* (operating-system-directory-base-entries os)
"Return the basic entries of the 'system' directory of OS for use as the
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 07cee2d4f5..759745c277 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -143,7 +143,7 @@
(define* (expression->derivation-in-linux-vm name exp
#:key
- (system (%current-system))
+ (system (%current-system)) target
(linux linux-libre)
initrd
(qemu qemu-minimal)
@@ -214,7 +214,8 @@ made available under the /xchg CIFS share."
(use-modules (guix build utils)
(gnu build vm))
- (let* ((inputs '#$(list qemu (canonical-package coreutils)))
+ (let* ((inputs '#$(list (canonical-package coreutils)))
+ (native-inputs '#+(list qemu))
(linux (string-append #$linux "/"
#$(system-linux-image-file-name)))
(initrd #$initrd)
@@ -222,16 +223,19 @@ made available under the /xchg CIFS share."
(graphs '#$(match references-graphs
(((graph-files . _) ...) graph-files)
(_ #f)))
+ (target #$(or (%current-target-system) (%current-system)))
(size #$(if (eq? 'guess disk-image-size)
#~(+ (* 70 (expt 2 20)) ;ESP
(estimated-partition-size graphs))
disk-image-size)))
- (set-path-environment-variable "PATH" '("bin") inputs)
+ (set-path-environment-variable "PATH" '("bin")
+ (append inputs native-inputs))
(load-in-linux-vm loader
#:output #$output
#:linux linux #:initrd initrd
+ #:qemu (qemu-command target)
#:memory-size #$memory-size
#:make-disk-image? #$make-disk-image?
#:single-file-output? #$single-file-output?
@@ -248,6 +252,7 @@ made available under the /xchg CIFS share."
(gexp->derivation name builder
;; TODO: Require the "kvm" feature.
#:system system
+ #:target target
#:env-vars env-vars
#:guile-for-build guile-for-build
#:references-graphs references-graphs)))
@@ -299,9 +304,10 @@ INPUTS is a list of inputs (as for packages)."
(setlocale LC_ALL "en_US.utf8")
(let ((inputs
- '#$(append (list qemu parted e2fsprogs dosfstools xorriso)
+ '#$(append (list parted e2fsprogs dosfstools xorriso)
(map canonical-package
(list sed grep coreutils findutils gawk))))
+ (native-inputs '#+(list qemu))
(graphs '#$(match inputs
@@ -315,7 +321,8 @@ INPUTS is a list of inputs (as for packages)."
((name thing output) `(,thing ,output)))
inputs)))
- (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
+ (set-path-environment-variable "PATH" '("bin" "sbin")
+ (append inputs native-inputs))
(make-iso9660-image #$xorriso
'#$grub-mkrescue-environment
#$(bootloader-package bootloader)
@@ -346,6 +353,7 @@ INPUTS is a list of inputs (as for packages)."
(define* (qemu-image #:key
(name "qemu-image")
(system (%current-system))
+ (target (%current-target-system))
(qemu qemu-minimal)
(disk-image-size 'guess)
(disk-image-format "qcow2")
@@ -404,9 +412,10 @@ system."
(setlocale LC_ALL "en_US.utf8")
(let ((inputs
- '#$(append (list qemu parted e2fsprogs dosfstools)
+ '#$(append (list util-linux parted e2fsprogs dosfstools)
(map canonical-package
(list sed grep coreutils findutils gawk))))
+ (native-inputs '#+(list qemu))
;; This variable is unused but allows us to add INPUTS-TO-COPY
;; as inputs.
@@ -416,7 +425,8 @@ system."
((name thing output) `(,thing ,output)))
inputs)))
- (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
+ (set-path-environment-variable "PATH" '("bin" "sbin")
+ (append inputs native-inputs))
(let* ((graphs '#$(match inputs
(((names . _) ...)
@@ -483,6 +493,7 @@ system."
#:bootloader-installer
#$(bootloader-installer bootloader)))))))
#:system system
+ #:target target
#:make-disk-image? #t
#:disk-image-size disk-image-size
#:disk-image-format disk-image-format
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 47/48] scripts: system: Add --target option.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-48-m.othacehe@gmail.com
* guix/scripts/system.scm (%options): Add target option,
(%default-options): ditto,
(process-action): Rename existing target variable to target-file and pass new
target variable to run-with-store procedure.
---
guix/scripts/system.scm | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

Toggle diff (72 lines)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 9fc3a10e98..f8040dd975 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2016, 2017, 2018 Chris Marusich <cmmarusich@gmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
;;;
@@ -929,6 +929,8 @@ Some ACTIONS support additional ARGS.\n"))
--full-boot for 'vm', make a full boot sequence"))
(display (G_ "
--skip-checks skip file system and initrd module safety checks"))
+ (display (G_ "
+ --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\""))
(display (G_ "
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
(newline)
@@ -1002,6 +1004,10 @@ Some ACTIONS support additional ARGS.\n"))
(lambda (opt name arg result)
(alist-cons 'system arg
(alist-delete 'system result eq?))))
+ (option '("target") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'target arg
+ (alist-delete 'target result eq?))))
(option '(#\r "root") #t #f
(lambda (opt name arg result)
(alist-cons 'gc-root arg result)))
@@ -1010,6 +1016,7 @@ Some ACTIONS support additional ARGS.\n"))
(define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
+ (target . #f)
(substitutes? . #t)
(build-hook? . #t)
(print-build-trace? . #t)
@@ -1043,6 +1050,7 @@ resulting from command-line parsing."
((x . _) x)))
(expr (assoc-ref opts 'expression))
(system (assoc-ref opts 'system))
+ (target (assoc-ref opts 'target))
(os (ensure-operating-system
(or file expr)
(cond
@@ -1059,7 +1067,7 @@ resulting from command-line parsing."
(dry? (assoc-ref opts 'dry-run?))
(bootloader? (assoc-ref opts 'install-bootloader?))
- (target (match args
+ (target-file (match args
((first second) second)
(_ #f)))
(bootloader-target
@@ -1101,9 +1109,10 @@ resulting from command-line parsing."
(_ #f))
opts)
#:install-bootloader? bootloader?
- #:target target
+ #:target target-file
#:bootloader-target bootloader-target
#:gc-root (assoc-ref opts 'gc-root)))))
+ #:target target
#:system system))
(warn-about-disk-space)))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:33
[PATCH v3 48/48] wip: tools.
(address . 36477@debbugs.gnu.org)
20190902153333.11190-49-m.othacehe@gmail.com
---
build-sorted-ok-ko-packages.sh | 354 ++++++++++++++++++++++++
deps.scm | 184 ++++++++++++
gnu/system/examples/mini-beaglebone.scm | 61 ++++
gnu/system/examples/mini.scm | 54 ++++
4 files changed, 653 insertions(+)
create mode 100755 build-sorted-ok-ko-packages.sh
create mode 100644 deps.scm
create mode 100644 gnu/system/examples/mini-beaglebone.scm
create mode 100644 gnu/system/examples/mini.scm

Toggle diff (679 lines)
diff --git a/build-sorted-ok-ko-packages.sh b/build-sorted-ok-ko-packages.sh
new file mode 100755
index 0000000000..a2a13dcdfc
--- /dev/null
+++ b/build-sorted-ok-ko-packages.sh
@@ -0,0 +1,354 @@
+#!/bin/bash -
+
+set -o nounset # Treat unset variables as an error
+
+mngt_dir()
+{
+ local dirname=$1
+
+ rm -rf ${dirname}.bk
+ if [ -e $dirname ]; then
+ mv $dirname ${dirname}.bk
+ fi
+ mkdir ${dirname}
+}
+
+DEPENDENCIES_DIR="packages-dependencies"
+KO_OUT_LOG_DIR="ko-out-log-dir"
+OUT_FILE_NAME_BASE="packages-status"
+OUT_FILE_NAME_EXT="wiki"
+OUT_FILE_NAME=${OUT_FILE_NAME_BASE}.${OUT_FILE_NAME_EXT}
+
+rm -f ${OUT_FILE_NAME}.bk
+if [ -e $OUT_FILE_NAME ]; then
+ mv $OUT_FILE_NAME ${OUT_FILE_NAME}.bk
+fi
+
+mngt_dir ${DEPENDENCIES_DIR}
+mngt_dir ${KO_OUT_LOG_DIR}
+
+NB_OK=0
+NB_KO=0
+NB_UNKNOWN=0
+
+file_header()
+{
+ local title="Packages status"
+
+ echo ""
+ echo "start file $OUT_FILE_NAME"
+ echo ""
+
+ echo "" >> $OUT_FILE_NAME
+ echo "= $title =" >> $OUT_FILE_NAME
+ echo "" >> $OUT_FILE_NAME
+}
+
+section_header()
+{
+ local title=$1
+
+ echo ""
+ echo ""
+ echo "start section \"$title\""
+
+ echo "" >> $OUT_FILE_NAME
+ echo "== $title ==" >> $OUT_FILE_NAME
+ echo "" >> $OUT_FILE_NAME
+ echo "| package | status | nb dependencies |" >> $OUT_FILE_NAME
+
+ NB_OK=0
+ NB_KO=0
+ NB_UNKNOWN=0
+}
+
+section_footer()
+{
+ echo "" >> $OUT_FILE_NAME
+ echo "nb packages OK in section: $NB_OK" >> $OUT_FILE_NAME
+ echo "" >> $OUT_FILE_NAME
+ echo "nb packages *KO* in section: $NB_KO" >> $OUT_FILE_NAME
+ echo "" >> $OUT_FILE_NAME
+ echo "nb packages UNKNOWN in section: $NB_UNKNOWN" >> $OUT_FILE_NAME
+ echo "" >> $OUT_FILE_NAME
+ echo "" >> $OUT_FILE_NAME
+}
+
+add_package_status()
+{
+ local package=$1
+ local status=$2
+ local nb_deps=$3
+
+ if [ "$status" = "OK" ]; then
+ NB_OK=$(($NB_OK+1))
+ elif [ "$status" = "KO" ]; then
+ status="*KO*"
+ NB_KO=$(($NB_KO+1))
+ else
+ NB_UNKNOWN=$(($NB_UNKNOWN+1))
+ fi
+
+ echo "| $package | $status | $nb_deps |" >> $OUT_FILE_NAME
+}
+
+LIST_PACK_SUPPOSED_OK=""
+
+LIST_PACK_SUPPOSED_OK+=" xz"
+LIST_PACK_SUPPOSED_OK+=" tk"
+LIST_PACK_SUPPOSED_OK+=" m4"
+LIST_PACK_SUPPOSED_OK+=" ed"
+LIST_PACK_SUPPOSED_OK+=" bc"
+LIST_PACK_SUPPOSED_OK+=" tcl"
+LIST_PACK_SUPPOSED_OK+=" sed"
+LIST_PACK_SUPPOSED_OK+=" mpc"
+LIST_PACK_SUPPOSED_OK+=" lzo"
+LIST_PACK_SUPPOSED_OK+=" isl"
+LIST_PACK_SUPPOSED_OK+=" gss"
+LIST_PACK_SUPPOSED_OK+=" gmp"
+LIST_PACK_SUPPOSED_OK+=" bdb"
+LIST_PACK_SUPPOSED_OK+=" acl"
+LIST_PACK_SUPPOSED_OK+=" zlib"
+LIST_PACK_SUPPOSED_OK+=" sudo"
+LIST_PACK_SUPPOSED_OK+=" perl"
+LIST_PACK_SUPPOSED_OK+=" pcre"
+LIST_PACK_SUPPOSED_OK+=" mpfr"
+LIST_PACK_SUPPOSED_OK+=" make"
+LIST_PACK_SUPPOSED_OK+=" lzip"
+LIST_PACK_SUPPOSED_OK+=" gzip"
+LIST_PACK_SUPPOSED_OK+=" grep"
+LIST_PACK_SUPPOSED_OK+=" gdbm"
+LIST_PACK_SUPPOSED_OK+=" gawk"
+LIST_PACK_SUPPOSED_OK+=" fuse"
+LIST_PACK_SUPPOSED_OK+=" flex"
+LIST_PACK_SUPPOSED_OK+=" flac"
+LIST_PACK_SUPPOSED_OK+=" file"
+LIST_PACK_SUPPOSED_OK+=" fftw"
+LIST_PACK_SUPPOSED_OK+=" bash"
+LIST_PACK_SUPPOSED_OK+=" attr"
+LIST_PACK_SUPPOSED_OK+=" which"
+LIST_PACK_SUPPOSED_OK+=" unzip"
+LIST_PACK_SUPPOSED_OK+=" rhash"
+LIST_PACK_SUPPOSED_OK+=" libuv"
+LIST_PACK_SUPPOSED_OK+=" libgc"
+LIST_PACK_SUPPOSED_OK+=" libev"
+LIST_PACK_SUPPOSED_OK+=" guile"
+LIST_PACK_SUPPOSED_OK+=" groff"
+LIST_PACK_SUPPOSED_OK+=" gperf"
+LIST_PACK_SUPPOSED_OK+=" glibc"
+LIST_PACK_SUPPOSED_OK+=" expat"
+LIST_PACK_SUPPOSED_OK+=" bzip2"
+LIST_PACK_SUPPOSED_OK+=" bison"
+LIST_PACK_SUPPOSED_OK+=" xtrans"
+LIST_PACK_SUPPOSED_OK+=" tzdata"
+LIST_PACK_SUPPOSED_OK+=" sqlite"
+LIST_PACK_SUPPOSED_OK+=" shishi"
+LIST_PACK_SUPPOSED_OK+=" shadow"
+LIST_PACK_SUPPOSED_OK+=" python"
+LIST_PACK_SUPPOSED_OK+=" nettle"
+LIST_PACK_SUPPOSED_OK+=" libxft"
+LIST_PACK_SUPPOSED_OK+=" libxcb"
+LIST_PACK_SUPPOSED_OK+=" libxau"
+LIST_PACK_SUPPOSED_OK+=" libx11"
+LIST_PACK_SUPPOSED_OK+=" libpng"
+LIST_PACK_SUPPOSED_OK+=" libogg"
+LIST_PACK_SUPPOSED_OK+=" libidn"
+LIST_PACK_SUPPOSED_OK+=" libffi"
+LIST_PACK_SUPPOSED_OK+=" libelf"
+LIST_PACK_SUPPOSED_OK+=" libcap"
+LIST_PACK_SUPPOSED_OK+=" libbsd"
+LIST_PACK_SUPPOSED_OK+=" indent"
+LIST_PACK_SUPPOSED_OK+=" gnutls"
+LIST_PACK_SUPPOSED_OK+=" c-ares"
+LIST_PACK_SUPPOSED_OK+=" texinfo"
+LIST_PACK_SUPPOSED_OK+=" python2"
+LIST_PACK_SUPPOSED_OK+=" psutils"
+LIST_PACK_SUPPOSED_OK+=" ncurses"
+LIST_PACK_SUPPOSED_OK+=" libxslt"
+LIST_PACK_SUPPOSED_OK+=" libxml2"
+LIST_PACK_SUPPOSED_OK+=" libxext"
+LIST_PACK_SUPPOSED_OK+=" libtool"
+LIST_PACK_SUPPOSED_OK+=" libtiff"
+LIST_PACK_SUPPOSED_OK+=" libssh2"
+LIST_PACK_SUPPOSED_OK+=" libltdl"
+LIST_PACK_SUPPOSED_OK+=" libjpeg"
+LIST_PACK_SUPPOSED_OK+=" libidn2"
+LIST_PACK_SUPPOSED_OK+=" jansson"
+LIST_PACK_SUPPOSED_OK+=" shepherd"
+LIST_PACK_SUPPOSED_OK+=" net-base"
+LIST_PACK_SUPPOSED_OK+=" libxdmcp"
+LIST_PACK_SUPPOSED_OK+=" libtasn1"
+LIST_PACK_SUPPOSED_OK+=" libpaper"
+LIST_PACK_SUPPOSED_OK+=" jemalloc"
+LIST_PACK_SUPPOSED_OK+=" jbig2dec"
+LIST_PACK_SUPPOSED_OK+=" gs-fonts"
+LIST_PACK_SUPPOSED_OK+=" freetype"
+LIST_PACK_SUPPOSED_OK+=" elfutils"
+LIST_PACK_SUPPOSED_OK+=" binutils"
+LIST_PACK_SUPPOSED_OK+=" automake"
+LIST_PACK_SUPPOSED_OK+=" autoconf"
+LIST_PACK_SUPPOSED_OK+=" alsa-lib"
+LIST_PACK_SUPPOSED_OK+=" xorgproto"
+LIST_PACK_SUPPOSED_OK+=" xcb-proto"
+LIST_PACK_SUPPOSED_OK+=" linux-pam"
+LIST_PACK_SUPPOSED_OK+=" libvorbis"
+LIST_PACK_SUPPOSED_OK+=" libgcrypt"
+LIST_PACK_SUPPOSED_OK+=" inetutils"
+LIST_PACK_SUPPOSED_OK+=" findutils"
+LIST_PACK_SUPPOSED_OK+=" e2fsprogs"
+LIST_PACK_SUPPOSED_OK+=" diffutils"
+LIST_PACK_SUPPOSED_OK+=" coreutils"
+LIST_PACK_SUPPOSED_OK+=" util-linux"
+LIST_PACK_SUPPOSED_OK+=" libxrender"
+LIST_PACK_SUPPOSED_OK+=" libsndfile"
+LIST_PACK_SUPPOSED_OK+=" libsigsegv"
+LIST_PACK_SUPPOSED_OK+=" libfontenc"
+LIST_PACK_SUPPOSED_OK+=" guile-json"
+LIST_PACK_SUPPOSED_OK+=" fontconfig"
+LIST_PACK_SUPPOSED_OK+=" util-macros"
+LIST_PACK_SUPPOSED_OK+=" mkfontscale"
+LIST_PACK_SUPPOSED_OK+=" linux-libre"
+LIST_PACK_SUPPOSED_OK+=" ghostscript"
+LIST_PACK_SUPPOSED_OK+=" docbook-xsl"
+LIST_PACK_SUPPOSED_OK+=" docbook-xml"
+LIST_PACK_SUPPOSED_OK+=" bash-static"
+LIST_PACK_SUPPOSED_OK+=" libunistring"
+LIST_PACK_SUPPOSED_OK+=" libgpg-error"
+LIST_PACK_SUPPOSED_OK+=" bash-minimal"
+LIST_PACK_SUPPOSED_OK+=" libsamplerate"
+LIST_PACK_SUPPOSED_OK+=" libatomic-ops"
+LIST_PACK_SUPPOSED_OK+=" e2fsck-static"
+LIST_PACK_SUPPOSED_OK+=" wireless-regdb"
+LIST_PACK_SUPPOSED_OK+=" python-wrapper"
+LIST_PACK_SUPPOSED_OK+=" python-minimal"
+LIST_PACK_SUPPOSED_OK+=" guile-readline"
+LIST_PACK_SUPPOSED_OK+=" guile-gdbm-ffi"
+LIST_PACK_SUPPOSED_OK+=" gettext-minimal"
+LIST_PACK_SUPPOSED_OK+=" libpthread-stubs"
+LIST_PACK_SUPPOSED_OK+=" openfwwf-firmware"
+LIST_PACK_SUPPOSED_OK+=" glibc-utf8-locales"
+LIST_PACK_SUPPOSED_OK+=" ath9k-htc-firmware"
+LIST_PACK_SUPPOSED_OK+=" linux-libre-headers"
+LIST_PACK_SUPPOSED_OK+=" guile-static-stripped"
+LIST_PACK_SUPPOSED_OK+=" python-minimal-wrapper"
+LIST_PACK_SUPPOSED_OK+=" pkg-config"
+LIST_PACK_SUPPOSED_OK+=" libarchive"
+LIST_PACK_SUPPOSED_OK+=" cyrus-sasl"
+LIST_PACK_SUPPOSED_OK+=" tcsh"
+LIST_PACK_SUPPOSED_OK+=" xmlto"
+LIST_PACK_SUPPOSED_OK+=" icu4c" # ?
+LIST_PACK_SUPPOSED_OK+=" mit-krb5" # ok ?
+LIST_PACK_SUPPOSED_OK+=" help2man"
+LIST_PACK_SUPPOSED_OK+=" mkfontdir"
+LIST_PACK_SUPPOSED_OK+=" lvm2"
+LIST_PACK_SUPPOSED_OK+=" eudev"
+LIST_PACK_SUPPOSED_OK+=" procps"
+LIST_PACK_SUPPOSED_OK+=" alsa-utils"
+LIST_PACK_SUPPOSED_OK+=" boost"
+LIST_PACK_SUPPOSED_OK+=" swig"
+LIST_PACK_SUPPOSED_OK+=" doxygen"
+LIST_PACK_SUPPOSED_OK+=" curl"
+LIST_PACK_SUPPOSED_OK+=" nghttp2"
+LIST_PACK_SUPPOSED_OK+=" openldap"
+LIST_PACK_SUPPOSED_OK+=" git-minimal"
+
+
+LIST_PACK_SUPPOSED_KO=""
+
+LIST_PACK_SUPPOSED_KO+=" libnl"
+LIST_PACK_SUPPOSED_KO+=" crda" # depends on libnl
+LIST_PACK_SUPPOSED_KO+=" cmake"
+LIST_PACK_SUPPOSED_KO+=" guile-wm"
+LIST_PACK_SUPPOSED_KO+=" guile-xcb"
+
+count_dependencies()
+{
+ local pack="$1"
+ local depsfile="$DEPENDENCIES_DIR/${pack}.dot"
+ guix graph -t bag-emerged $pack > $depsfile
+ count=$(cat $depsfile | grep "\->" | wc -l)
+ echo $count
+}
+
+build_pack()
+{
+ local pack="$1"
+ local out_file=$(mktemp /tmp/test-guix.XXXXX)
+ local result=0
+
+ ./pre-inst-env guix build --target=aarch64-linux-gnu $pack > $out_file 2>&1
+ result=$?
+
+ if [ $result -eq 0 ]; then
+ rm -f $out_file
+ else
+ mv $out_file ${KO_OUT_LOG_DIR}/${pack}.log
+ fi
+
+ return $result
+}
+
+build_all_in_list()
+{
+ local list_pack="$@"
+ local status=unknown
+
+ for pack in $list_pack; do
+ echo ""
+ echo ""
+ echo "--------------- package $pack ---------------"
+ echo ""
+ build_pack $pack
+ if [ $? -eq 0 ]; then
+ status="OK"
+ else
+ status="KO"
+ fi
+
+ nb_deps="$(count_dependencies $pack)"
+ echo " package $pack is $status (and has $nb_deps dependencies)"
+ echo ""
+ echo ""
+
+ add_package_status $pack $status $nb_deps
+ done
+}
+
+if [ $# -ge 1 ]; then
+ EXEC_SUPPOSED_OK=0
+ EXEC_SUPPOSED_KO=0
+ while [ $# -ge 1 ]; do
+ case "$1" in
+ "--ok")
+ EXEC_SUPPOSED_OK=1
+ ;;
+ "--ko")
+ EXEC_SUPPOSED_KO=1
+ ;;
+ *)
+ echo "Unknown argument $1"
+ exit 1
+ ;;
+ esac
+ shift
+ done
+else
+ EXEC_SUPPOSED_OK=1
+ EXEC_SUPPOSED_KO=1
+fi
+
+file_header
+
+if [ $EXEC_SUPPOSED_OK -eq 1 ]; then
+ section_header "Supposed OK Packages"
+ build_all_in_list $LIST_PACK_SUPPOSED_OK
+ section_footer
+fi
+
+if [ $EXEC_SUPPOSED_KO -eq 1 ]; then
+ section_header "Supposed KO Packages"
+ build_all_in_list $LIST_PACK_SUPPOSED_KO
+ section_footer
+fi
+
+
diff --git a/deps.scm b/deps.scm
new file mode 100644
index 0000000000..75e8f106fe
--- /dev/null
+++ b/deps.scm
@@ -0,0 +1,184 @@
+(use-modules (guix)
+ (guix scripts build)
+ (gnu)
+ (ice-9 receive))
+
+(define deps
+ '("sudo"
+ "guile-xcb"
+ "guile-wm"
+ "tzdata"
+ "guile-gdbm-ffi"
+ "gzip"
+ "expat"
+ "attr"
+ "gettext-minimal"
+ "m4"
+ "perl"
+ "gmp"
+ "acl"
+ "libcap"
+ "libsigsegv"
+ "pkg-config"
+ "zlib"
+ "libffi"
+ "glibc"
+ "bash-static"
+ "bison"
+ "texinfo"
+ "lzip"
+ "ed"
+ "libatomic-ops"
+ "libltdl"
+ "libunistring"
+ "libgc"
+ "linux-libre-headers"
+ "bzip2"
+ "bash-minimal"
+ "diffutils"
+ "binutils"
+ "findutils"
+ "guile"
+ "sed"
+ "make"
+ "gawk"
+ "xz"
+ "grep"
+ "file"
+ "coreutils"
+ "glibc-utf8-locales"
+ "libpng"
+ "freetype"
+ "libfontenc"
+ "mkfontdir"
+ "mkfontscale"
+ "guile-readline"
+ "lzo"
+ "rhash"
+ "libuv"
+ "libarchive"
+ "cmake"
+ "ath9k-htc-firmware"
+ "openfwwf-firmware"
+ "inetutils"
+ "tcsh"
+ "pcre"
+ "boost"
+ "swig"
+ "libnl"
+ "wireless-regdb"
+ "flac"
+ "libsndfile"
+ "libvorbis"
+ "libogg"
+ "xmlto"
+ "fftw"
+ "alsa-lib"
+ "alsa-utils"
+ "libsamplerate"
+ "lvm2"
+ "fuse"
+ "crda"
+ "which"
+ "help2man"
+ "indent"
+ "flex"
+ "gdbm"
+ "mit-krb5"
+ "openldap"
+ "cyrus-sasl"
+ "curl"
+ "icu4c"
+ "bdb"
+ "libev"
+ "jemalloc"
+ "jansson"
+ "c-ares"
+ "linux-pam"
+ "shishi"
+ "xtrans"
+ "libbsd"
+ "python-minimal-wrapper"
+ "xcb-proto"
+ "python-minimal"
+ "gs-fonts"
+ "fontconfig"
+ "libxrender"
+ "libxft"
+ "tk"
+ "xorgproto"
+ "libpthread-stubs"
+ "util-macros"
+ "libxau"
+ "libxext"
+ "libxcb"
+ "sqlite"
+ "libxdmcp"
+ "libx11"
+ "libpaper"
+ "jbig2dec"
+ "tcl"
+ "libjpeg"
+ "libtiff"
+ "psutils"
+ "ghostscript"
+ "groff"
+ "libgpg-error"
+ "libtasn1"
+ "libssh2"
+ "python2"
+ "gss"
+ "libgcrypt"
+ "nettle"
+ "libidn"
+ "nghttp2"
+ "libidn2"
+ "git-minimal"
+ "gnutls"
+ "guile-json"
+ "unzip"
+ "autoconf"
+ "automake"
+ "docbook-xml"
+ "libtool"
+ "python"
+ "python-wrapper"
+ "libxslt"
+ "libxml2"
+ "docbook-xsl"
+ "gperf"
+ "eudev"
+ "shadow"
+ "bash"
+ "shepherd"
+ "isl"
+ "net-base"
+ "procps"
+ "util-linux"
+ "e2fsprogs"
+ "e2fsck-static"
+ "guile-static-stripped"
+ "libelf"
+ "ncurses"
+ "mpc"
+ "bc"
+ "elfutils"
+ "mpfr"
+ "linux-libre"))
+
+(define store (open-connection))
+
+(define arguments
+ (map (lambda (spec)
+ `(argument . ,spec))
+ deps))
+
+(run-with-store store
+ (mlet %store-monad
+ ((derivations ->
+ ((@@ (guix scripts build) options->derivations)
+ store
+ `((target . "aarch64-linux-gnu")
+ ,@arguments))))
+ (mbegin %store-monad
+ (built-derivations derivations))))
diff --git a/gnu/system/examples/mini-beaglebone.scm b/gnu/system/examples/mini-beaglebone.scm
new file mode 100644
index 0000000000..6ce0ab1b1c
--- /dev/null
+++ b/gnu/system/examples/mini-beaglebone.scm
@@ -0,0 +1,61 @@
+;; This is an operating system configuration template
+;; for a "bare bones" setup, with no X11 display server.
+
+(use-modules (gnu) (gnu bootloader u-boot))
+(use-service-modules networking ssh)
+(use-package-modules bootloaders linux screen)
+
+(operating-system
+ (host-name "komputilo")
+ (timezone "Europe/Berlin")
+ (locale "en_US.utf8")
+
+ ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
+ ;; target hard disk, and "my-root" is the label of the target
+ ;; root file system.
+ (bootloader (bootloader-configuration
+ (bootloader u-boot-beaglebone-black-bootloader)
+ (target "/dev/vda")))
+
+ (kernel linux-libre-arm-omap2plus)
+
+ ;; This module is required to mount the SD card.
+ (initrd-modules (cons "omap_hsmmc" %base-initrd-modules))
+
+ (file-systems (cons (file-system
+ (device (file-system-label "my-root"))
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems))
+
+ ;; This is where user accounts are specified. The "root"
+ ;; account is implicit, and is initially created with the
+ ;; empty password.
+ (users (cons (user-account
+ (name "alice")
+ (comment "Bob's sister")
+ (group "users")
+
+ ;; Adding the account to the "wheel" group
+ ;; makes it a sudoer. Adding it to "audio"
+ ;; and "video" allows the user to play sound
+ ;; and access the webcam.
+ (supplementary-groups '("wheel"
+ "audio" "video")))
+ %base-user-accounts))
+
+ ;; Globally-installed packages.
+ (packages '())
+
+ ;; Add services to the baseline: a DHCP client and
+ ;; an SSH server.
+ (services (list
+ (service udev-service-type
+ (udev-configuration
+ (rules (list lvm2 fuse alsa-utils crda))))
+ (agetty-service
+ (agetty-configuration
+ (extra-options '("-L"))
+ (baud-rate "115200")
+ (term "vt100")
+ (tty "ttyO0"))))))
diff --git a/gnu/system/examples/mini.scm b/gnu/system/examples/mini.scm
new file mode 100644
index 0000000000..f7c7b63308
--- /dev/null
+++ b/gnu/system/examples/mini.scm
@@ -0,0 +1,54 @@
+;; This is an operating system configuration template
+;; for a "bare bones" setup, with no X11 display server.
+
+(use-modules (gnu))
+(use-service-modules networking ssh)
+(use-package-modules linux screen)
+
+(define dummy-bootloader
+ (bootloader
+ (inherit grub-bootloader)
+ (installer #f)))
+
+(operating-system
+ (host-name "komputilo")
+ (timezone "Europe/Berlin")
+ (locale "en_US.utf8")
+
+ ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
+ ;; target hard disk, and "my-root" is the label of the target
+ ;; root file system.
+ (bootloader (bootloader-configuration
+ (bootloader dummy-bootloader)
+ (target "/dev/sdX")))
+ (file-systems (cons (file-system
+ (device (file-system-label "my-root"))
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems))
+
+ ;; This is where user accounts are specified. The "root"
+ ;; account is implicit, and is initially created with the
+ ;; empty password.
+ (users (cons (user-account
+ (name "alice")
+ (comment "Bob's sister")
+ (group "users")
+
+ ;; Adding the account to the "wheel" group
+ ;; makes it a sudoer. Adding it to "audio"
+ ;; and "video" allows the user to play sound
+ ;; and access the webcam.
+ (supplementary-groups '("wheel"
+ "audio" "video")))
+ %base-user-accounts))
+
+ ;; Globally-installed packages.
+ (packages '())
+
+ ;; Add services to the baseline: a DHCP client and
+ ;; an SSH server.
+ (services (list
+ (service udev-service-type
+ (udev-configuration
+ (rules (list lvm2 fuse alsa-utils crda)))))))
--
2.20.1
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:35
(address . 36477@debbugs.gnu.org)
87h85uhfst.fsf@gmail.com
Not for review, sorry!

Mathieu

Mathieu Othacehe writes:

Toggle quote (688 lines)
> ---
> build-sorted-ok-ko-packages.sh | 354 ++++++++++++++++++++++++
> deps.scm | 184 ++++++++++++
> gnu/system/examples/mini-beaglebone.scm | 61 ++++
> gnu/system/examples/mini.scm | 54 ++++
> 4 files changed, 653 insertions(+)
> create mode 100755 build-sorted-ok-ko-packages.sh
> create mode 100644 deps.scm
> create mode 100644 gnu/system/examples/mini-beaglebone.scm
> create mode 100644 gnu/system/examples/mini.scm
>
> diff --git a/build-sorted-ok-ko-packages.sh b/build-sorted-ok-ko-packages.sh
> new file mode 100755
> index 0000000000..a2a13dcdfc
> --- /dev/null
> +++ b/build-sorted-ok-ko-packages.sh
> @@ -0,0 +1,354 @@
> +#!/bin/bash -
> +
> +set -o nounset # Treat unset variables as an error
> +
> +mngt_dir()
> +{
> + local dirname=$1
> +
> + rm -rf ${dirname}.bk
> + if [ -e $dirname ]; then
> + mv $dirname ${dirname}.bk
> + fi
> + mkdir ${dirname}
> +}
> +
> +DEPENDENCIES_DIR="packages-dependencies"
> +KO_OUT_LOG_DIR="ko-out-log-dir"
> +OUT_FILE_NAME_BASE="packages-status"
> +OUT_FILE_NAME_EXT="wiki"
> +OUT_FILE_NAME=${OUT_FILE_NAME_BASE}.${OUT_FILE_NAME_EXT}
> +
> +rm -f ${OUT_FILE_NAME}.bk
> +if [ -e $OUT_FILE_NAME ]; then
> + mv $OUT_FILE_NAME ${OUT_FILE_NAME}.bk
> +fi
> +
> +mngt_dir ${DEPENDENCIES_DIR}
> +mngt_dir ${KO_OUT_LOG_DIR}
> +
> +NB_OK=0
> +NB_KO=0
> +NB_UNKNOWN=0
> +
> +file_header()
> +{
> + local title="Packages status"
> +
> + echo ""
> + echo "start file $OUT_FILE_NAME"
> + echo ""
> +
> + echo "" >> $OUT_FILE_NAME
> + echo "= $title =" >> $OUT_FILE_NAME
> + echo "" >> $OUT_FILE_NAME
> +}
> +
> +section_header()
> +{
> + local title=$1
> +
> + echo ""
> + echo ""
> + echo "start section \"$title\""
> +
> + echo "" >> $OUT_FILE_NAME
> + echo "== $title ==" >> $OUT_FILE_NAME
> + echo "" >> $OUT_FILE_NAME
> + echo "| package | status | nb dependencies |" >> $OUT_FILE_NAME
> +
> + NB_OK=0
> + NB_KO=0
> + NB_UNKNOWN=0
> +}
> +
> +section_footer()
> +{
> + echo "" >> $OUT_FILE_NAME
> + echo "nb packages OK in section: $NB_OK" >> $OUT_FILE_NAME
> + echo "" >> $OUT_FILE_NAME
> + echo "nb packages *KO* in section: $NB_KO" >> $OUT_FILE_NAME
> + echo "" >> $OUT_FILE_NAME
> + echo "nb packages UNKNOWN in section: $NB_UNKNOWN" >> $OUT_FILE_NAME
> + echo "" >> $OUT_FILE_NAME
> + echo "" >> $OUT_FILE_NAME
> +}
> +
> +add_package_status()
> +{
> + local package=$1
> + local status=$2
> + local nb_deps=$3
> +
> + if [ "$status" = "OK" ]; then
> + NB_OK=$(($NB_OK+1))
> + elif [ "$status" = "KO" ]; then
> + status="*KO*"
> + NB_KO=$(($NB_KO+1))
> + else
> + NB_UNKNOWN=$(($NB_UNKNOWN+1))
> + fi
> +
> + echo "| $package | $status | $nb_deps |" >> $OUT_FILE_NAME
> +}
> +
> +LIST_PACK_SUPPOSED_OK=""
> +
> +LIST_PACK_SUPPOSED_OK+=" xz"
> +LIST_PACK_SUPPOSED_OK+=" tk"
> +LIST_PACK_SUPPOSED_OK+=" m4"
> +LIST_PACK_SUPPOSED_OK+=" ed"
> +LIST_PACK_SUPPOSED_OK+=" bc"
> +LIST_PACK_SUPPOSED_OK+=" tcl"
> +LIST_PACK_SUPPOSED_OK+=" sed"
> +LIST_PACK_SUPPOSED_OK+=" mpc"
> +LIST_PACK_SUPPOSED_OK+=" lzo"
> +LIST_PACK_SUPPOSED_OK+=" isl"
> +LIST_PACK_SUPPOSED_OK+=" gss"
> +LIST_PACK_SUPPOSED_OK+=" gmp"
> +LIST_PACK_SUPPOSED_OK+=" bdb"
> +LIST_PACK_SUPPOSED_OK+=" acl"
> +LIST_PACK_SUPPOSED_OK+=" zlib"
> +LIST_PACK_SUPPOSED_OK+=" sudo"
> +LIST_PACK_SUPPOSED_OK+=" perl"
> +LIST_PACK_SUPPOSED_OK+=" pcre"
> +LIST_PACK_SUPPOSED_OK+=" mpfr"
> +LIST_PACK_SUPPOSED_OK+=" make"
> +LIST_PACK_SUPPOSED_OK+=" lzip"
> +LIST_PACK_SUPPOSED_OK+=" gzip"
> +LIST_PACK_SUPPOSED_OK+=" grep"
> +LIST_PACK_SUPPOSED_OK+=" gdbm"
> +LIST_PACK_SUPPOSED_OK+=" gawk"
> +LIST_PACK_SUPPOSED_OK+=" fuse"
> +LIST_PACK_SUPPOSED_OK+=" flex"
> +LIST_PACK_SUPPOSED_OK+=" flac"
> +LIST_PACK_SUPPOSED_OK+=" file"
> +LIST_PACK_SUPPOSED_OK+=" fftw"
> +LIST_PACK_SUPPOSED_OK+=" bash"
> +LIST_PACK_SUPPOSED_OK+=" attr"
> +LIST_PACK_SUPPOSED_OK+=" which"
> +LIST_PACK_SUPPOSED_OK+=" unzip"
> +LIST_PACK_SUPPOSED_OK+=" rhash"
> +LIST_PACK_SUPPOSED_OK+=" libuv"
> +LIST_PACK_SUPPOSED_OK+=" libgc"
> +LIST_PACK_SUPPOSED_OK+=" libev"
> +LIST_PACK_SUPPOSED_OK+=" guile"
> +LIST_PACK_SUPPOSED_OK+=" groff"
> +LIST_PACK_SUPPOSED_OK+=" gperf"
> +LIST_PACK_SUPPOSED_OK+=" glibc"
> +LIST_PACK_SUPPOSED_OK+=" expat"
> +LIST_PACK_SUPPOSED_OK+=" bzip2"
> +LIST_PACK_SUPPOSED_OK+=" bison"
> +LIST_PACK_SUPPOSED_OK+=" xtrans"
> +LIST_PACK_SUPPOSED_OK+=" tzdata"
> +LIST_PACK_SUPPOSED_OK+=" sqlite"
> +LIST_PACK_SUPPOSED_OK+=" shishi"
> +LIST_PACK_SUPPOSED_OK+=" shadow"
> +LIST_PACK_SUPPOSED_OK+=" python"
> +LIST_PACK_SUPPOSED_OK+=" nettle"
> +LIST_PACK_SUPPOSED_OK+=" libxft"
> +LIST_PACK_SUPPOSED_OK+=" libxcb"
> +LIST_PACK_SUPPOSED_OK+=" libxau"
> +LIST_PACK_SUPPOSED_OK+=" libx11"
> +LIST_PACK_SUPPOSED_OK+=" libpng"
> +LIST_PACK_SUPPOSED_OK+=" libogg"
> +LIST_PACK_SUPPOSED_OK+=" libidn"
> +LIST_PACK_SUPPOSED_OK+=" libffi"
> +LIST_PACK_SUPPOSED_OK+=" libelf"
> +LIST_PACK_SUPPOSED_OK+=" libcap"
> +LIST_PACK_SUPPOSED_OK+=" libbsd"
> +LIST_PACK_SUPPOSED_OK+=" indent"
> +LIST_PACK_SUPPOSED_OK+=" gnutls"
> +LIST_PACK_SUPPOSED_OK+=" c-ares"
> +LIST_PACK_SUPPOSED_OK+=" texinfo"
> +LIST_PACK_SUPPOSED_OK+=" python2"
> +LIST_PACK_SUPPOSED_OK+=" psutils"
> +LIST_PACK_SUPPOSED_OK+=" ncurses"
> +LIST_PACK_SUPPOSED_OK+=" libxslt"
> +LIST_PACK_SUPPOSED_OK+=" libxml2"
> +LIST_PACK_SUPPOSED_OK+=" libxext"
> +LIST_PACK_SUPPOSED_OK+=" libtool"
> +LIST_PACK_SUPPOSED_OK+=" libtiff"
> +LIST_PACK_SUPPOSED_OK+=" libssh2"
> +LIST_PACK_SUPPOSED_OK+=" libltdl"
> +LIST_PACK_SUPPOSED_OK+=" libjpeg"
> +LIST_PACK_SUPPOSED_OK+=" libidn2"
> +LIST_PACK_SUPPOSED_OK+=" jansson"
> +LIST_PACK_SUPPOSED_OK+=" shepherd"
> +LIST_PACK_SUPPOSED_OK+=" net-base"
> +LIST_PACK_SUPPOSED_OK+=" libxdmcp"
> +LIST_PACK_SUPPOSED_OK+=" libtasn1"
> +LIST_PACK_SUPPOSED_OK+=" libpaper"
> +LIST_PACK_SUPPOSED_OK+=" jemalloc"
> +LIST_PACK_SUPPOSED_OK+=" jbig2dec"
> +LIST_PACK_SUPPOSED_OK+=" gs-fonts"
> +LIST_PACK_SUPPOSED_OK+=" freetype"
> +LIST_PACK_SUPPOSED_OK+=" elfutils"
> +LIST_PACK_SUPPOSED_OK+=" binutils"
> +LIST_PACK_SUPPOSED_OK+=" automake"
> +LIST_PACK_SUPPOSED_OK+=" autoconf"
> +LIST_PACK_SUPPOSED_OK+=" alsa-lib"
> +LIST_PACK_SUPPOSED_OK+=" xorgproto"
> +LIST_PACK_SUPPOSED_OK+=" xcb-proto"
> +LIST_PACK_SUPPOSED_OK+=" linux-pam"
> +LIST_PACK_SUPPOSED_OK+=" libvorbis"
> +LIST_PACK_SUPPOSED_OK+=" libgcrypt"
> +LIST_PACK_SUPPOSED_OK+=" inetutils"
> +LIST_PACK_SUPPOSED_OK+=" findutils"
> +LIST_PACK_SUPPOSED_OK+=" e2fsprogs"
> +LIST_PACK_SUPPOSED_OK+=" diffutils"
> +LIST_PACK_SUPPOSED_OK+=" coreutils"
> +LIST_PACK_SUPPOSED_OK+=" util-linux"
> +LIST_PACK_SUPPOSED_OK+=" libxrender"
> +LIST_PACK_SUPPOSED_OK+=" libsndfile"
> +LIST_PACK_SUPPOSED_OK+=" libsigsegv"
> +LIST_PACK_SUPPOSED_OK+=" libfontenc"
> +LIST_PACK_SUPPOSED_OK+=" guile-json"
> +LIST_PACK_SUPPOSED_OK+=" fontconfig"
> +LIST_PACK_SUPPOSED_OK+=" util-macros"
> +LIST_PACK_SUPPOSED_OK+=" mkfontscale"
> +LIST_PACK_SUPPOSED_OK+=" linux-libre"
> +LIST_PACK_SUPPOSED_OK+=" ghostscript"
> +LIST_PACK_SUPPOSED_OK+=" docbook-xsl"
> +LIST_PACK_SUPPOSED_OK+=" docbook-xml"
> +LIST_PACK_SUPPOSED_OK+=" bash-static"
> +LIST_PACK_SUPPOSED_OK+=" libunistring"
> +LIST_PACK_SUPPOSED_OK+=" libgpg-error"
> +LIST_PACK_SUPPOSED_OK+=" bash-minimal"
> +LIST_PACK_SUPPOSED_OK+=" libsamplerate"
> +LIST_PACK_SUPPOSED_OK+=" libatomic-ops"
> +LIST_PACK_SUPPOSED_OK+=" e2fsck-static"
> +LIST_PACK_SUPPOSED_OK+=" wireless-regdb"
> +LIST_PACK_SUPPOSED_OK+=" python-wrapper"
> +LIST_PACK_SUPPOSED_OK+=" python-minimal"
> +LIST_PACK_SUPPOSED_OK+=" guile-readline"
> +LIST_PACK_SUPPOSED_OK+=" guile-gdbm-ffi"
> +LIST_PACK_SUPPOSED_OK+=" gettext-minimal"
> +LIST_PACK_SUPPOSED_OK+=" libpthread-stubs"
> +LIST_PACK_SUPPOSED_OK+=" openfwwf-firmware"
> +LIST_PACK_SUPPOSED_OK+=" glibc-utf8-locales"
> +LIST_PACK_SUPPOSED_OK+=" ath9k-htc-firmware"
> +LIST_PACK_SUPPOSED_OK+=" linux-libre-headers"
> +LIST_PACK_SUPPOSED_OK+=" guile-static-stripped"
> +LIST_PACK_SUPPOSED_OK+=" python-minimal-wrapper"
> +LIST_PACK_SUPPOSED_OK+=" pkg-config"
> +LIST_PACK_SUPPOSED_OK+=" libarchive"
> +LIST_PACK_SUPPOSED_OK+=" cyrus-sasl"
> +LIST_PACK_SUPPOSED_OK+=" tcsh"
> +LIST_PACK_SUPPOSED_OK+=" xmlto"
> +LIST_PACK_SUPPOSED_OK+=" icu4c" # ?
> +LIST_PACK_SUPPOSED_OK+=" mit-krb5" # ok ?
> +LIST_PACK_SUPPOSED_OK+=" help2man"
> +LIST_PACK_SUPPOSED_OK+=" mkfontdir"
> +LIST_PACK_SUPPOSED_OK+=" lvm2"
> +LIST_PACK_SUPPOSED_OK+=" eudev"
> +LIST_PACK_SUPPOSED_OK+=" procps"
> +LIST_PACK_SUPPOSED_OK+=" alsa-utils"
> +LIST_PACK_SUPPOSED_OK+=" boost"
> +LIST_PACK_SUPPOSED_OK+=" swig"
> +LIST_PACK_SUPPOSED_OK+=" doxygen"
> +LIST_PACK_SUPPOSED_OK+=" curl"
> +LIST_PACK_SUPPOSED_OK+=" nghttp2"
> +LIST_PACK_SUPPOSED_OK+=" openldap"
> +LIST_PACK_SUPPOSED_OK+=" git-minimal"
> +
> +
> +LIST_PACK_SUPPOSED_KO=""
> +
> +LIST_PACK_SUPPOSED_KO+=" libnl"
> +LIST_PACK_SUPPOSED_KO+=" crda" # depends on libnl
> +LIST_PACK_SUPPOSED_KO+=" cmake"
> +LIST_PACK_SUPPOSED_KO+=" guile-wm"
> +LIST_PACK_SUPPOSED_KO+=" guile-xcb"
> +
> +count_dependencies()
> +{
> + local pack="$1"
> + local depsfile="$DEPENDENCIES_DIR/${pack}.dot"
> + guix graph -t bag-emerged $pack > $depsfile
> + count=$(cat $depsfile | grep "\->" | wc -l)
> + echo $count
> +}
> +
> +build_pack()
> +{
> + local pack="$1"
> + local out_file=$(mktemp /tmp/test-guix.XXXXX)
> + local result=0
> +
> + ./pre-inst-env guix build --target=aarch64-linux-gnu $pack > $out_file 2>&1
> + result=$?
> +
> + if [ $result -eq 0 ]; then
> + rm -f $out_file
> + else
> + mv $out_file ${KO_OUT_LOG_DIR}/${pack}.log
> + fi
> +
> + return $result
> +}
> +
> +build_all_in_list()
> +{
> + local list_pack="$@"
> + local status=unknown
> +
> + for pack in $list_pack; do
> + echo ""
> + echo ""
> + echo "--------------- package $pack ---------------"
> + echo ""
> + build_pack $pack
> + if [ $? -eq 0 ]; then
> + status="OK"
> + else
> + status="KO"
> + fi
> +
> + nb_deps="$(count_dependencies $pack)"
> + echo " package $pack is $status (and has $nb_deps dependencies)"
> + echo ""
> + echo ""
> +
> + add_package_status $pack $status $nb_deps
> + done
> +}
> +
> +if [ $# -ge 1 ]; then
> + EXEC_SUPPOSED_OK=0
> + EXEC_SUPPOSED_KO=0
> + while [ $# -ge 1 ]; do
> + case "$1" in
> + "--ok")
> + EXEC_SUPPOSED_OK=1
> + ;;
> + "--ko")
> + EXEC_SUPPOSED_KO=1
> + ;;
> + *)
> + echo "Unknown argument $1"
> + exit 1
> + ;;
> + esac
> + shift
> + done
> +else
> + EXEC_SUPPOSED_OK=1
> + EXEC_SUPPOSED_KO=1
> +fi
> +
> +file_header
> +
> +if [ $EXEC_SUPPOSED_OK -eq 1 ]; then
> + section_header "Supposed OK Packages"
> + build_all_in_list $LIST_PACK_SUPPOSED_OK
> + section_footer
> +fi
> +
> +if [ $EXEC_SUPPOSED_KO -eq 1 ]; then
> + section_header "Supposed KO Packages"
> + build_all_in_list $LIST_PACK_SUPPOSED_KO
> + section_footer
> +fi
> +
> +
> diff --git a/deps.scm b/deps.scm
> new file mode 100644
> index 0000000000..75e8f106fe
> --- /dev/null
> +++ b/deps.scm
> @@ -0,0 +1,184 @@
> +(use-modules (guix)
> + (guix scripts build)
> + (gnu)
> + (ice-9 receive))
> +
> +(define deps
> + '("sudo"
> + "guile-xcb"
> + "guile-wm"
> + "tzdata"
> + "guile-gdbm-ffi"
> + "gzip"
> + "expat"
> + "attr"
> + "gettext-minimal"
> + "m4"
> + "perl"
> + "gmp"
> + "acl"
> + "libcap"
> + "libsigsegv"
> + "pkg-config"
> + "zlib"
> + "libffi"
> + "glibc"
> + "bash-static"
> + "bison"
> + "texinfo"
> + "lzip"
> + "ed"
> + "libatomic-ops"
> + "libltdl"
> + "libunistring"
> + "libgc"
> + "linux-libre-headers"
> + "bzip2"
> + "bash-minimal"
> + "diffutils"
> + "binutils"
> + "findutils"
> + "guile"
> + "sed"
> + "make"
> + "gawk"
> + "xz"
> + "grep"
> + "file"
> + "coreutils"
> + "glibc-utf8-locales"
> + "libpng"
> + "freetype"
> + "libfontenc"
> + "mkfontdir"
> + "mkfontscale"
> + "guile-readline"
> + "lzo"
> + "rhash"
> + "libuv"
> + "libarchive"
> + "cmake"
> + "ath9k-htc-firmware"
> + "openfwwf-firmware"
> + "inetutils"
> + "tcsh"
> + "pcre"
> + "boost"
> + "swig"
> + "libnl"
> + "wireless-regdb"
> + "flac"
> + "libsndfile"
> + "libvorbis"
> + "libogg"
> + "xmlto"
> + "fftw"
> + "alsa-lib"
> + "alsa-utils"
> + "libsamplerate"
> + "lvm2"
> + "fuse"
> + "crda"
> + "which"
> + "help2man"
> + "indent"
> + "flex"
> + "gdbm"
> + "mit-krb5"
> + "openldap"
> + "cyrus-sasl"
> + "curl"
> + "icu4c"
> + "bdb"
> + "libev"
> + "jemalloc"
> + "jansson"
> + "c-ares"
> + "linux-pam"
> + "shishi"
> + "xtrans"
> + "libbsd"
> + "python-minimal-wrapper"
> + "xcb-proto"
> + "python-minimal"
> + "gs-fonts"
> + "fontconfig"
> + "libxrender"
> + "libxft"
> + "tk"
> + "xorgproto"
> + "libpthread-stubs"
> + "util-macros"
> + "libxau"
> + "libxext"
> + "libxcb"
> + "sqlite"
> + "libxdmcp"
> + "libx11"
> + "libpaper"
> + "jbig2dec"
> + "tcl"
> + "libjpeg"
> + "libtiff"
> + "psutils"
> + "ghostscript"
> + "groff"
> + "libgpg-error"
> + "libtasn1"
> + "libssh2"
> + "python2"
> + "gss"
> + "libgcrypt"
> + "nettle"
> + "libidn"
> + "nghttp2"
> + "libidn2"
> + "git-minimal"
> + "gnutls"
> + "guile-json"
> + "unzip"
> + "autoconf"
> + "automake"
> + "docbook-xml"
> + "libtool"
> + "python"
> + "python-wrapper"
> + "libxslt"
> + "libxml2"
> + "docbook-xsl"
> + "gperf"
> + "eudev"
> + "shadow"
> + "bash"
> + "shepherd"
> + "isl"
> + "net-base"
> + "procps"
> + "util-linux"
> + "e2fsprogs"
> + "e2fsck-static"
> + "guile-static-stripped"
> + "libelf"
> + "ncurses"
> + "mpc"
> + "bc"
> + "elfutils"
> + "mpfr"
> + "linux-libre"))
> +
> +(define store (open-connection))
> +
> +(define arguments
> + (map (lambda (spec)
> + `(argument . ,spec))
> + deps))
> +
> +(run-with-store store
> + (mlet %store-monad
> + ((derivations ->
> + ((@@ (guix scripts build) options->derivations)
> + store
> + `((target . "aarch64-linux-gnu")
> + ,@arguments))))
> + (mbegin %store-monad
> + (built-derivations derivations))))
> diff --git a/gnu/system/examples/mini-beaglebone.scm b/gnu/system/examples/mini-beaglebone.scm
> new file mode 100644
> index 0000000000..6ce0ab1b1c
> --- /dev/null
> +++ b/gnu/system/examples/mini-beaglebone.scm
> @@ -0,0 +1,61 @@
> +;; This is an operating system configuration template
> +;; for a "bare bones" setup, with no X11 display server.
> +
> +(use-modules (gnu) (gnu bootloader u-boot))
> +(use-service-modules networking ssh)
> +(use-package-modules bootloaders linux screen)
> +
> +(operating-system
> + (host-name "komputilo")
> + (timezone "Europe/Berlin")
> + (locale "en_US.utf8")
> +
> + ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
> + ;; target hard disk, and "my-root" is the label of the target
> + ;; root file system.
> + (bootloader (bootloader-configuration
> + (bootloader u-boot-beaglebone-black-bootloader)
> + (target "/dev/vda")))
> +
> + (kernel linux-libre-arm-omap2plus)
> +
> + ;; This module is required to mount the SD card.
> + (initrd-modules (cons "omap_hsmmc" %base-initrd-modules))
> +
> + (file-systems (cons (file-system
> + (device (file-system-label "my-root"))
> + (mount-point "/")
> + (type "ext4"))
> + %base-file-systems))
> +
> + ;; This is where user accounts are specified. The "root"
> + ;; account is implicit, and is initially created with the
> + ;; empty password.
> + (users (cons (user-account
> + (name "alice")
> + (comment "Bob's sister")
> + (group "users")
> +
> + ;; Adding the account to the "wheel" group
> + ;; makes it a sudoer. Adding it to "audio"
> + ;; and "video" allows the user to play sound
> + ;; and access the webcam.
> + (supplementary-groups '("wheel"
> + "audio" "video")))
> + %base-user-accounts))
> +
> + ;; Globally-installed packages.
> + (packages '())
> +
> + ;; Add services to the baseline: a DHCP client and
> + ;; an SSH server.
> + (services (list
> + (service udev-service-type
> + (udev-configuration
> + (rules (list lvm2 fuse alsa-utils crda))))
> + (agetty-service
> + (agetty-configuration
> + (extra-options '("-L"))
> + (baud-rate "115200")
> + (term "vt100")
> + (tty "ttyO0"))))))
> diff --git a/gnu/system/examples/mini.scm b/gnu/system/examples/mini.scm
> new file mode 100644
> index 0000000000..f7c7b63308
> --- /dev/null
> +++ b/gnu/system/examples/mini.scm
> @@ -0,0 +1,54 @@
> +;; This is an operating system configuration template
> +;; for a "bare bones" setup, with no X11 display server.
> +
> +(use-modules (gnu))
> +(use-service-modules networking ssh)
> +(use-package-modules linux screen)
> +
> +(define dummy-bootloader
> + (bootloader
> + (inherit grub-bootloader)
> + (installer #f)))
> +
> +(operating-system
> + (host-name "komputilo")
> + (timezone "Europe/Berlin")
> + (locale "en_US.utf8")
> +
> + ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
> + ;; target hard disk, and "my-root" is the label of the target
> + ;; root file system.
> + (bootloader (bootloader-configuration
> + (bootloader dummy-bootloader)
> + (target "/dev/sdX")))
> + (file-systems (cons (file-system
> + (device (file-system-label "my-root"))
> + (mount-point "/")
> + (type "ext4"))
> + %base-file-systems))
> +
> + ;; This is where user accounts are specified. The "root"
> + ;; account is implicit, and is initially created with the
> + ;; empty password.
> + (users (cons (user-account
> + (name "alice")
> + (comment "Bob's sister")
> + (group "users")
> +
> + ;; Adding the account to the "wheel" group
> + ;; makes it a sudoer. Adding it to "audio"
> + ;; and "video" allows the user to play sound
> + ;; and access the webcam.
> + (supplementary-groups '("wheel"
> + "audio" "video")))
> + %base-user-accounts))
> +
> + ;; Globally-installed packages.
> + (packages '())
> +
> + ;; Add services to the baseline: a DHCP client and
> + ;; an SSH server.
> + (services (list
> + (service udev-service-type
> + (udev-configuration
> + (rules (list lvm2 fuse alsa-utils crda)))))))
M
M
Mathieu Othacehe wrote on 2 Sep 2019 17:40
Re: [bug#36477] [PATCH v2 00/61] Add --target support to guix system
(name . Ludovic Courtès)(address . ludo@gnu.org)
87ftlehfkd.fsf@gmail.com
Hey,

Toggle quote (4 lines)
> Could you already apply the patches that Marius and I already agreed to?
> Double-check that they can go to ‘master’ without triggering a full
> rebuild.

Done! I pushed them to core-updates-next as almost all of them trigger
mass rebuild.

I sent a v3 with the unreviewed patches. The most critical ones are maybe
number 41 and 42 as they hit (guix gexp) module.

Thanks,

Mathieu
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:31
Re: [bug#36477] [PATCH v3 42/48] gexp: Pass target to compiled-modules in lower-gexp.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
8736hc5jl4.fsf@gnu.org
Hi,

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

Toggle quote (2 lines)
> * guix/gexp.scm (lower-gexp): Pass target argument to compiled-modules.

This seems obvious at first sight, but actually, I’m not sure it’s
correct because Guile code always runs “natively”. That is, when you
write:

(computed-file "foo" (with-imported-modules … #~(begin …)))

the gexp here necessarily runs “natively” on the current system. Thus,
the modules have to be compiled natively.

The cross-compilation target should only affect things that the regex
refers to with ‘ungexp’ or ‘ungexp-splicing’.

WDYT?

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:32
Re: [bug#36477] [PATCH v3 43/48] utils: Use target-arm64? and target-arm? helpers.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87woeo44yn.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (25 lines)
> * guix/utils.scm (target-arm64?, target-arm?): New exported procedures.
> ---
> guix/utils.scm | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/guix/utils.scm b/guix/utils.scm
> index f480c3291f..3eb156ad4e 100644
> --- a/guix/utils.scm
> +++ b/guix/utils.scm
> @@ -78,6 +78,8 @@
> package-name->name+version
> target-mingw?
> target-arm32?
> + target-arm64?
> + target-arm?
> target-64bit?
> version-compare
> version>?
> @@ -493,6 +495,12 @@ a character other than '@'."
> (define (target-arm32?)
> (string-prefix? "arm" (or (%current-target-system) (%current-system))))
>
> +(define (target-arm64?)
> + (string-prefix? "aarch64" (or (%current-target-system) (%current-system))))

I’d call it ‘target-aarch64?’ because that’s what it’s called upstream,
and that’s also the name we use elsewhere in Guix. WDYT?

Apart from that LGTM!

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:33
Re: [bug#36477] [PATCH v3 44/48] build: vm: Fix arm32 support.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87sgpc44xo.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (3 lines)
> * gnu/build/vm.scm (load-in-linux-vm): Disable qemu highmem support on ARM32
> systems.

LGTM!
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:36
Re: [bug#36477] [PATCH v3 45/48] system: vm: Add arm64 support.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87o90044su.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (6 lines)
> * gnu/build/vm.scm (load-in-linux-vm): Add target-arm64? argument and use it
> to pass correct arguments to qemu.
> * gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass the new
> target-arm64? argument added above. Do not add ESP partition on all ARM
> targets. Do not pass grub-efi package to initialize-hard-disk on ARM targets.

[...]

Toggle quote (8 lines)
> --- a/gnu/build/vm.scm
> +++ b/gnu/build/vm.scm
> @@ -82,6 +82,7 @@
> make-disk-image?
> single-file-output?
> target-arm32?
> + target-arm64?

Maybe we should just have a #:target parameter instead, WDYT?


[...]

Toggle quote (4 lines)
> + (grub-efi #$@(if (target-arm?)
> + '(#f)
> + #~(#$grub-efi))))

Simply: #$(and (not (target-arm?)) grub-efi).

Otherwise LGTM.

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:46
Re: [bug#36477] [PATCH v3 46/48] system: vm: Support cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
878sr444b8.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (13 lines)
> * gnu/system.scm (system-linux-image-file-name): Add support for cross-built
> systems. Remove system argument that was ignored,
> (operating-system-kernel-file): adapt by removing ignored os argument.
> * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add target argument,
> move qemu from inputs list to a new native-inputs list and adapt
> set-path-environment-variable call accordingly. Pass target to qemu-command
> and gexp->derivation calls.
> (iso9660-image): Move qemu from inputs to a new native-inputs list and adapt
> set-path-environment-variable accordingly.
> (qemu-image): Add target argument, move qemu from inputs list to a new
> native-inputs list and adapt set-path-environment-variable call
> accordingly. Pass target argument to expression->derivation-in-linux-vm call.

[...]

Toggle quote (7 lines)
> (define (operating-system-kernel-file os)
> "Return an object representing the absolute file name of the kernel image of
> OS."
> (file-append (operating-system-kernel os)
> - "/" (system-linux-image-file-name os)))
> + "/" (system-linux-image-file-name)))

Uh, passing ‘os’ to ‘system-linux-image-file-name’ never worked, right?

[...]

Toggle quote (4 lines)
> - (let* ((inputs '#$(list qemu (canonical-package coreutils)))
> + (let* ((inputs '#$(list (canonical-package coreutils)))
> + (native-inputs '#+(list qemu))

All these inputs are added to $PATH just after, which shows that we run
them natively. Thus, they must all be native.

IOW, all we have to do is replace #$ by #+.

(Also, make sure to test all this without a qemu-binfmt service set up.)

Toggle quote (7 lines)
> (let ((inputs
> - '#$(append (list qemu parted e2fsprogs dosfstools xorriso)
> + '#$(append (list parted e2fsprogs dosfstools xorriso)
> (map canonical-package
> (list sed grep coreutils findutils gawk))))
> + (native-inputs '#+(list qemu))

Same here: this is added to $PATH so it must be native.

Toggle quote (7 lines)
> (let ((inputs
> - '#$(append (list qemu parted e2fsprogs dosfstools)
> + '#$(append (list util-linux parted e2fsprogs dosfstools)
> (map canonical-package
> (list sed grep coreutils findutils gawk))))
> + (native-inputs '#+(list qemu))

Likewise.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:47
Re: [bug#36477] [PATCH v3 47/48] scripts: system: Add --target option.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
874l1s449y.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (5 lines)
> * guix/scripts/system.scm (%options): Add target option,
> (%default-options): ditto,
> (process-action): Rename existing target variable to target-file and pass new
> target variable to run-with-store procedure.

OK!
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:48
Re: [bug#36477] [PATCH v3 30/48] packages: Set outputs field as thunked.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87zhjk2pn4.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (6 lines)
> This allows for instance to use %current-target-system to enable/disable some
> outputs in a package.
>
> * guix/packages.scm (<package>): Set outputs field as thunked,
> (package->bag): adapt make-bag call accordingly.

For which package did you have a needed for that?

Thunked fields add some overhead (CPU and memory), so I’d rather avoid
it until we have a strong need.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:49
Re: [bug#36477] [PATCH v3 39/48] linux-initrd: Use native gzip.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87v9u82pmc.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (3 lines)
> * gnu/system/linux-initrd.scm (expression->initrd): Pass native gzip to
> build-initrd procedure.

LGTM!
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:50
Re: [bug#36477] [PATCH v3 34/48] gnu: guile-wm: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87r24w2pko.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (4 lines)
> From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
>
> * gnu/packages/guile-wm.scm (guile-wm): Add guile and guile-xcb to native-inputs.

LGTM!
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:52
Re: [bug#36477] [PATCH v3 23/48] gnu: make-linux-libre: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87mufk2pho.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (20 lines)
> * gnu/packages/linux.scm (make-linux-libre)[arguments]: Unset CROSS_CPATH to
> make sure that cross-libc is not found. Otherwise, some of its header would
> conflict with the one from linux (stdint.h and linux/types.h).
> ---
> gnu/packages/linux.scm | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index afa860830b..9c1ba6d5b9 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -665,6 +665,9 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
> (replace 'configure
> (lambda* (#:key inputs native-inputs target #:allow-other-keys)
> ;; Avoid introducing timestamps
> + ,@(if (%current-target-system)
> + '((unsetenv "CROSS_CPATH"))
> + '())
> (setenv "KCONFIG_NOTIMESTAMP" "1")

Could you move the comment about timestamps right above
KCONFIG_NOTIMESTAMP, and turn the explanation about CROSS_CPATH that you
put in the commit log into a comment above CROSS_CPATH?

OK with these changes, thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 14:54
Re: [bug#36477] [PATCH v3 03/48] gnu: texinfo: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87imq82pea.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (7 lines)
> * gnu/packages/texinfo.scm (texinfo)[arguments]: Do not reset environment
> before running configure with the native compiler, in a cross-compilation
> context,
> [inputs]: move perl from here ...
> [native-inputs]: ... to here. Also add ncurses that is needed in a
> cross-compilation context to build texinfo native tools.

[...]

Toggle quote (8 lines)
> + (arguments
> + ;; When cross-compiling, the package is configured twice: once with the
> + ;; native compiler and once with the cross-compiler. During the configure
> + ;; with the native compiler, the environment is reset. This leads to
> + ;; multiple environment variables missing. Do not reset the environment
> + ;; to prevent that.
> + `(,@(if (%current-target-system)

Simply: (arguments (if (%current-target-system) …)).

Toggle quote (2 lines)
> + ;; When cross-compiling, texinfo will build some of it's own binaries with

s/it’s/its/

Toggle quote (5 lines)
> + ;; the native compiler. This means ncurses is needed both in both inputs
> + ;; and native-inputs.
> + (native-inputs `(("perl" ,perl)
> + ("ncurses" ,ncurses)))

Could you check whether that triggers a full rebuild? If it doesn’t,
you can push to master.

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 15:00
Re: [bug#36477] [PATCH v3 04/48] gnu: cmake: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87d0gg2p30.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (25 lines)
> * gnu/packages/cmake.scm (cmake-minimal-cross): New package.
> * guix/build-system/cmake.scm (default-cmake): Add new target argument and use
> it to select cmake-minimal or cmake-minimal-cross.
> (lower): Pass target to default-cmake.
> ---
> gnu/packages/cmake.scm | 8 ++++++++
> guix/build-system/cmake.scm | 9 ++++++---
> 2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
> index 1d8d829ec5..9bf0273f00 100644
> --- a/gnu/packages/cmake.scm
> +++ b/gnu/packages/cmake.scm
> @@ -207,6 +207,14 @@ and workspaces that can be used in the compiler environment of your choice.")
> (outputs '("out" "doc"))
> (properties (alist-delete 'hidden? (package-properties cmake-minimal)))))
>
> +(define-public cmake-minimal-cross
> + (package
> + (inherit cmake-minimal)
> + (name "cmake-minimal-cross")
> + (native-search-paths '())
> + (search-paths
> + (package-native-search-paths cmake-minimal))))

It seems to be enough to just add ‘search-paths’ to ‘cmake’:
Toggle diff (12 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 7186cf98df..9f517238a0 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -151,6 +151,7 @@
(list (search-path-specification
(variable "CMAKE_PREFIX_PATH")
(files '("")))))
+ (search-paths native-search-paths)
(home-page "https://cmake.org/")
(synopsis "Cross-platform build system")
(description
… and it doesn’t trigger a full rebuild.

Please push that to ‘master’ if it works for you!

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 15:01
Re: [bug#36477] [PATCH v3 14/48] gnu: glibc-utf8-locales: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
878sr42p18.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (5 lines)
> * gnu/packages/base.scm (glibc-utf8-locales)[inputs]: Move to ...
> [native-inputs]: ... here, in order to fix cross-compilation.
> * gnu/packages/commencement.scm (glibc-utf8-locales-final)[inputs]: Move to ...
> [native-inputs]: ... here, in order to fix cross-compilation.

LGTM. If it doesn’t trigger a full rebuild, you can push to master.

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 15:12
Re: [bug#36477] [PATCH v3 16/48] gnu: eudev: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
8736hc2ok4.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (5 lines)
> * gnu/packages/linux.scm (eudev)[arguments]: Look for xsltproc in both
> native-inputs and inputs. Also, do not run udevadm when cross-compiling.
>
> We need to find another way to generate hwdb.bin file for cross-built systems.

[...]

Toggle quote (10 lines)
> (add-before 'bootstrap 'patch-file-names
> - (lambda* (#:key inputs #:allow-other-keys)
> + (lambda* (#:key inputs native-inputs #:allow-other-keys)
> (substitute* "man/make.sh"
> (("/usr/bin/xsltproc")
> - (string-append (assoc-ref inputs "xsltproc")
> + (string-append (assoc-ref
> + (or native-inputs inputs) "xsltproc")
> "/bin/xsltproc")))

Put this way this leads to a rebuild. If you want to have it on master,
you’ll have to use ,@ tricks. (And ‘core-updates’ is frozen.)

Toggle quote (11 lines)
> (add-after 'install 'build-hwdb
> (lambda* (#:key outputs #:allow-other-keys)
> ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
> ;; similar tools to display product names.
> + ;;
> + ;; XXX: This can't be done when cross-compiling. Find another way
> + ;; to generate hwdb.bin for cross-built systems.
> (let ((out (assoc-ref outputs "out")))
> - (invoke (string-append out "/bin/udevadm")
> - "hwdb" "--update")))))

I guess we’d need to add ‘this-package’ to ‘native-inputs’ to do that,
right?

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 15:13
Re: [bug#36477] [PATCH v3 38/48] gnu: grub: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87y2z419ya.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (3 lines)
> * gnu/packages/bootloaders.scm (grub)[arguments]: Search for unifont in both
> native-inputs and inputs.

LGTM!
L
L
Ludovic Courtès wrote on 4 Sep 2019 15:14
Re: [bug#36477] [PATCH v3 40/48] gnu: linux-libre: Enable built-in ext4 support.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87sgpc19vh.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (7 lines)
> When running qemu-img from (gnu system vm) with an aarch64 kernel, mounting
> ext4 partitions fails because no modprobe of ext4 module is made. Like for
> other kernel configs, provide built-in support for ext4 partitions.
>
> * gnu/packages/aux-files/linux-libre/5.2-arm64.conf: Enable built-in ext4,
> like in intel and armhf configs.

IIRC Mark was reluctant to this change; or was it more about the longer
term?

Ludo’.
L
L
Ludovic Courtès wrote on 4 Sep 2019 15:23
Re: [bug#36477] [PATCH v3 06/48] gnu: groff: Fix cross compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87o90019g0.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (5 lines)
> * 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 a native-input when cross-compiling.

Please mention changes to ‘groff-minimal’.


[...]

Toggle quote (24 lines)
> + ,@(if (%current-target-system)
> + '((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)))

Wouldn’t it be easier to have:

(arguments
`(,@(if (%current-target-system)
`(#:make-flags (list (string-append "GROFF_BIN_PATH="
(assoc-ref %build-native-inputs "self)
…)))
'()
…))

?

Toggle quote (5 lines)
> (native-inputs `(("bison" ,bison)
> - ("perl" ,perl)))
> + ("perl" ,perl)
> + ("groff" ,groff)))

Should probably be:

("self" ,this-package)

for consistency.

Thanks,
Ludo’.
M
M
Mathieu Othacehe wrote on 4 Sep 2019 18:01
Re: [bug#36477] [PATCH v3 30/48] packages: Set outputs field as thunked.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87h85st5ij.fsf@gmail.com
Hey Ludo,

Thanks for you reviews :).

Toggle quote (2 lines)
> For which package did you have a needed for that?

That's for libnl which has python2 and python3 outputs for python
extensions. However, we do not currently support cross compilation of
python extensions.

Adding cross compilation of Python extension would be the right thing to
do but it's really hard. Nix is also struggling on that, see:

So I don't have anything better to propose. WDYT?

Thanks,

Mathieu
M
M
Mathieu Othacehe wrote on 4 Sep 2019 18:17
Re: [bug#36477] [PATCH v3 40/48] gnu: linux-libre: Enable built-in ext4 support.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87ftlct4s0.fsf@gmail.com
Toggle quote (3 lines)
> IIRC Mark was reluctant to this change; or was it more about the longer
> term?

Yes, but we discussed it together and decided to proceed with this patch
and in a follow-up, configure ext4 support as a module in all kernel
configurations and add it to default initrd modules.

Mathieu
M
M
Mathieu Othacehe wrote on 4 Sep 2019 18:28
Re: [bug#36477] [PATCH v3 03/48] gnu: texinfo: Fix cross-compilation.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87ef0wt49r.fsf@gmail.com
Toggle quote (3 lines)
> Could you check whether that triggers a full rebuild? If it doesn’t,
> you can push to master.

No mass-rebuild :) Fixed and pushed.

Thanks,

Mathieu
M
M
Marius Bakke wrote on 4 Sep 2019 23:21
(address . 36477@debbugs.gnu.org)
87h85rhi5y.fsf@devup.no
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (5 lines)
>> Could you check whether that triggers a full rebuild? If it doesn’t,
>> you can push to master.
>
> No mass-rebuild :) Fixed and pushed.

This did cause a mass-rebuild, and Cuirass is currently chugging away at
commit 210b641:


I reverted it in 4ab97ef, but don't know how to stop the Cuirass
evaluations.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl1wKskACgkQoqBt8qM6
VPr79AgApSBahvQAIfbnEmzRAZFdvD4aOeOuf0n2SB1GDqTCEjH9R7q+GlzFCXCt
SY0LK0JLs5ifUhObVzkmyYfXHLAeIh95zxmcp8Rt6fy9pcWSkGAEQQaqqq3i3B+1
GXDJyGrhTG3ksOmCtICg4iRwcIpd1Gp+lMq1G7micHTj9tKSHVkUsOrwbAeOXyiU
UfC/7APGFg+BNXxPfQcEin5fZ2dWNjY5bvlblmxjSOUM0roPeFQQSS3vwkz+6/Tp
ViZGmBZuMK5OG0OAKGx7ly9L4Ik90McmAZuMAj1fCgJRUekam8I/SN9pfu9lvRS8
rEVFU25kOEU26SNrO78S4b+Ny6aBkg==
=pqhr
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 5 Sep 2019 09:45
(address . 36477@debbugs.gnu.org)
87pnkfb2zr.fsf@ambrevar.xyz
Thanks Marius!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl1wvRgACgkQm9z0l6S7
zH9X6ggAoxmNA3yY9aG6K1dfJ07ZDAl7wVsbDLAUmzkqEBZUcV1e7mBep9WEHm2c
v1CIYnUfBt2sA0Rp6I3HfRh1F2V+j9u5yDrfXT+Ulhwf3qUvX21KT+uZ5MZ/r9Qy
Fi7nrARazuTWR+EBhSF+yUjelEAP5VhXo34WopoI+lEBXsqihpWTOjs2NXjWg4Jq
BXOvWH6IT2JUAczht1XRcTBRHOCBk2gFJ/D4En4uaVDyws7UTj4VSEwwyNk2KJWy
stVBTtTa/v5vRxUtpDLQGObOPU+ujd4AgomISpWnFhbqLd2oSy183PDIFZrxCdzi
xIdKZdKfEzsfa1EOoS13WgGdZgmIig==
=jFxe
-----END PGP SIGNATURE-----

M
M
Mathieu Othacehe wrote on 5 Sep 2019 09:53
(name . Marius Bakke)(address . mbakke@fastmail.com)
CANVeeZxEd4OsuELQ=wHSjxmMTaQECR7VjsJa1spptddsnAjkVA@mail.gmail.com
Hello Marius,

I'm surprised because the derivation was unchanged with this patch
when I tested it locally. Sorry, I must have made a mistake.
Thanks for taking care of this. I applied this patch on core-updates-next.

Mathieu

Le mer. 4 sept. 2019 à 23:21, Marius Bakke <mbakke@fastmail.com> a écrit :
Toggle quote (16 lines)
>
> Mathieu Othacehe <m.othacehe@gmail.com> writes:
>
> >> Could you check whether that triggers a full rebuild? If it doesn’t,
> >> you can push to master.
> >
> > No mass-rebuild :) Fixed and pushed.
>
> This did cause a mass-rebuild, and Cuirass is currently chugging away at
> commit 210b641:
>
> https://ci.guix.gnu.org/jobset/guix-master
> https://ci.guix.gnu.org/jobset/guix-modular-master
>
> I reverted it in 4ab97ef, but don't know how to stop the Cuirass
> evaluations.
L
L
Ludovic Courtès wrote on 5 Sep 2019 10:41
Re: [bug#36477] [PATCH v3 30/48] packages: Set outputs field as thunked.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
878sr3i18n.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (12 lines)
>> For which package did you have a needed for that?
>
> That's for libnl which has python2 and python3 outputs for python
> extensions. However, we do not currently support cross compilation of
> python extensions.
>
> Adding cross compilation of Python extension would be the right thing to
> do but it's really hard. Nix is also struggling on that, see:
> https://github.com/NixOS/nixpkgs/issues/53320.
>
> So I don't have anything better to propose. WDYT?

In (gnu packages …) there are no users of the “python2” and “python3”
outputs of libnl. What about making separate ‘libnl-python’ packages?
Marius, WDYT?

Ludo’.
L
L
Ludovic Courtès wrote on 5 Sep 2019 10:45
Re: [bug#36477] [PATCH v3 40/48] gnu: linux-libre: Enable built-in ext4 support.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87tv9rgmho.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (7 lines)
>> IIRC Mark was reluctant to this change; or was it more about the longer
>> term?
>
> Yes, but we discussed it together and decided to proceed with this patch
> and in a follow-up, configure ext4 support as a module in all kernel
> configurations and add it to default initrd modules.

Ah OK, so let’s go with this patch.

Ludo’.
L
L
Ludovic Courtès wrote on 5 Sep 2019 10:47
Re: [bug#36477] [PATCH v3 03/48] gnu: texinfo: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87lfv3gmem.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (5 lines)
>> Could you check whether that triggers a full rebuild? If it doesn’t,
>> you can push to master.
>
> No mass-rebuild :) Fixed and pushed.

Apparently it did cause a mass rebuild but Marius reverted it, so we’re
fine.

The way I check for a mass rebuild is either by running “guix build
libreoffice -n” after the change :-), or (better) by comparing the
output of:

./pre-inst-env guix build texinfo -nd

before and after the change.

Thanks,
Ludo’.
M
M
Mathieu Othacehe wrote on 20 Sep 2019 16:18
Re: [bug#36477] [PATCH v3 04/48] gnu: cmake: Fix cross-compilation.
(name . Ludovic Courtès)(address . ludo@gnu.org)
875zlnt5io.fsf@gmail.com
Hey Ludo,

Toggle quote (3 lines)
> It seems to be enough to just add ‘search-paths’ to ‘cmake’:
>

I tried to do that but it doesn't work. Let's consider libgit2 which
uses cmake, when cross-compiling, both native-search-paths and
search-paths are set. Both are passed to bag-build in
"bag->cross-derivation".

Then, gnu-build is called from cmake-build and "set-paths" function is
called. "set-path-environment-variable" is called for CMAKE_PREFIX_PATH
which is in search-paths and then called again for CMAKE_PREFIX_PATH in
native-search-paths.

The later will cause the first setenv to be undone, and we end-up with
only native-inputs in CMAKE_PREFIX_PATH variable.

Whereas, with my patch only search-paths is set, so it can't be "undone"
by native-search-paths. CMAKE_PREFIX_PATH is filled with only "inputs"
which is what is expected.

I hope I'm clear and I'm sorry to reply so late, didn't have any slack
in my day job :(

WDYT?

Thanks,

Mathieu
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:23
Re: [bug#36477] [PATCH v3 42/48] gexp: Pass target to compiled-modules in lower-gexp.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87sgob8psl.fsf@gmail.com
Hey Ludo,

Toggle quote (3 lines)
> The cross-compilation target should only affect things that the regex
> refers to with ‘ungexp’ or ‘ungexp-splicing’.

Well you're right, this is wrong and not needed. However the other patch
on (guix gexp), titled "Use cross extensions when cross-compiling" seems
needed.

WDYT?

Mathieu
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:25
Re: [bug#36477] [PATCH v3 43/48] utils: Use target-arm64? and target-arm? helpers.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87lfu38pon.fsf@gmail.com
Hey,

Toggle quote (3 lines)
> I’d call it ‘target-aarch64?’ because that’s what it’s called upstream,
> and that’s also the name we use elsewhere in Guix. WDYT?

Yes I renamed it to target-aarch64? in v4.

Mathieu
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:30
Re: [bug#36477] [PATCH v3 46/48] system: vm: Support cross-compilation.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87k19n8pg0.fsf@gmail.com
Toggle quote (2 lines)
> Uh, passing ‘os’ to ‘system-linux-image-file-name’ never worked, right?

Right!

Toggle quote (5 lines)
> All these inputs are added to $PATH just after, which shows that we run
> them natively. Thus, they must all be native.
>
> IOW, all we have to do is replace #$ by #+.

Yes that's true for expression->derivation-in-linux-vm where inputs are
added to PATH an turned to be native-inputs.

Toggle quote (11 lines)
> Same here: this is added to $PATH so it must be native.
>
>> (let ((inputs
>> - '#$(append (list qemu parted e2fsprogs dosfstools)
>> + '#$(append (list util-linux parted e2fsprogs dosfstools)
>> (map canonical-package
>> (list sed grep coreutils findutils gawk))))
>> + (native-inputs '#+(list qemu))
>
> Likewise.

However, here, those inputs are added to PATH, but this is the PATH on
the running VM, so they are supposed to be inputs and not native-inputs.

The issue I have is that qemu is not cross-compilable for now, plus it
is useless on the running VM. So I just removed it from both inputs
list.

Mathieu
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:38
Re: [bug#36477] [PATCH v3 16/48] gnu: eudev: Fix cross-compilation.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87imp78p1s.fsf@gmail.com
Hey,

Toggle quote (7 lines)
>> (let ((out (assoc-ref outputs "out")))
>> - (invoke (string-append out "/bin/udevadm")
>> - "hwdb" "--update")))))
>
> I guess we’d need to add ‘this-package’ to ‘native-inputs’ to do that,
> right?

Yes but as this commands produces a binary and there is no "target"
option, some portability issues could arise.

Mathieu
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 00/23] System cross-compilation
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-1-m.othacehe@gmail.com
Hello,

Here's a v4 of the serie. Since v3, half of the patches were pushed to
core-update-next. Among the remaining patches, I could not find a better
solution to cmake native-search-path issue.

I also turned libl python2 and python3 outputs into separate libnl-python2 and
libnl-python3 packages, so to avoid turning the output field into a thunked
field.

Thanks,

Mathieu

Mathieu Othacehe (21):
gnu: openssl: Fix cross-compilation.
gnu: cmake: Fix cross-compilation.
gnu: groff: Fix cross compilation.
gnu: cyrus-sasl: Fix cross-compilation.
gnu: icu4c: Fix cross-compilation.
gnu: boost: Fix cross-compilation.
gnu: eudev: Fix cross-compilation.
gnu: bdb: Fix cross-compilation.
gnu: openldap: Fix cross-compilation.
gnu: swig: Fix cross-compilation.
gnu: git: Fix cross-compilation.
gnu: doxygen: Fix cross-compilation.
gnu: guile-gcrypt: Fix cross-compilation.
gnu: guile-sqlite3: Fix cross-compilation.
gnu: libnl: Move python outputs to separate packages.
gexp: Use cross extensions when cross-compiling.
utils: Use target-aarch64? and target-arm? helpers.
build: vm: Fix arm32 support.
system: vm: Add arm64 support.
system: vm: Support cross-compilation.
scripts: system: Add --target option.

Pierre-Moana Levesque (2):
gnu: crda: Fix cross-compilation
gnu: cmake: Fix cross-compilation.

gnu/build/vm.scm | 27 +++-
gnu/local.mk | 3 +
gnu/packages/boost.scm | 59 +++++--
gnu/packages/cmake.scm | 14 +-
gnu/packages/cyrus-sasl.scm | 17 +-
gnu/packages/dbm.scm | 6 +-
gnu/packages/documentation.scm | 12 +-
gnu/packages/gnupg.scm | 18 ++-
gnu/packages/groff.scm | 22 ++-
gnu/packages/guile.scm | 7 +-
gnu/packages/icu4c.scm | 35 +++-
gnu/packages/linux.scm | 149 +++++++++++-------
gnu/packages/openldap.scm | 38 ++++-
gnu/packages/patches/boost-dumpversion.patch | 24 +++
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++
.../guile-sqlite3-fix-cross-compilation.patch | 55 +++++++
gnu/packages/swig.scm | 1 +
gnu/packages/tls.scm | 62 ++++++--
gnu/packages/version-control.scm | 23 ++-
gnu/system.scm | 15 +-
gnu/system/vm.scm | 33 ++--
guix/build-system/cmake.scm | 9 +-
guix/gexp.scm | 4 +-
guix/scripts/system.scm | 15 +-
guix/utils.scm | 8 +
25 files changed, 535 insertions(+), 133 deletions(-)
create mode 100644 gnu/packages/patches/boost-dumpversion.patch
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
create mode 100644 gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch

--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 01/23] gnu: openssl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-2-m.othacehe@gmail.com
* gnu/packages/tls.scm (openssl-next)[arguments]: Pass CROSS_COMPILE
environment variable and target system to configure script.
---
gnu/packages/tls.scm | 62 ++++++++++++++++++++++++++++++++------------
1 file changed, 45 insertions(+), 17 deletions(-)

Toggle diff (103 lines)
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 6689375da6..8797429dcf 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -301,6 +302,23 @@ required structures.")
#:disallowed-references ,(list (canonical-package perl))
#:phases
(modify-phases %standard-phases
+ ,@(if (%current-target-system)
+ '((add-before
+ 'configure 'set-cross-compile
+ (lambda* (#:key target outputs #:allow-other-keys)
+ (setenv "CROSS_COMPILE" (string-append target "-"))
+ (setenv "CONFIGURE_TARGET_ARCH"
+ (cond
+ ((string-prefix? "i686" target)
+ "linux-x86")
+ ((string-prefix? "x86_64" target)
+ "linux-x86_64")
+ ((string-prefix? "arm" target)
+ "linux-armv4")
+ ((string-prefix? "aarch64" target)
+ "linux-aarch64")))
+ #t)))
+ '())
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -310,7 +328,9 @@ required structures.")
(("/usr/bin/env")
(string-append (assoc-ref %build-inputs "coreutils")
"/bin/env")))
- (invoke "./config"
+ (invoke ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
"shared" ;build shared libraries
"--libdir=lib"
@@ -321,7 +341,10 @@ required structures.")
"/share/openssl-" ,version)
(string-append "--prefix=" out)
- (string-append "-Wl,-rpath," lib)))))
+ (string-append "-Wl,-rpath," lib)
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(add-after 'install 'move-static-libraries
(lambda* (#:key outputs #:allow-other-keys)
;; Move static libraries to the "static" output.
@@ -435,21 +458,26 @@ required structures.")
(("^MANDIR[[:blank:]]*=.*$")
(string-append "MANDIR = " out "/share/man\n")))
#t)))
- (replace 'configure
- ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (invoke "./config"
- "shared" ;build shared libraries
- "--libdir=lib"
-
- ;; The default for this catch-all directory is
- ;; PREFIX/ssl. Change that to something more
- ;; conventional.
- (string-append "--openssldir=" out
- "/share/openssl-" ,version)
-
- (string-append "--prefix=" out)))))
+ (replace 'configure
+ ;; Override this phase because OpenSSL 1.0 does not understand -rpath.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (invoke ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
+ "shared" ;build shared libraries
+ "--libdir=lib"
+
+ ;; The default for this catch-all directory is
+ ;; PREFIX/ssl. Change that to something more
+ ;; conventional.
+ (string-append "--openssldir=" out
+ "/share/openssl-" ,version)
+
+ (string-append "--prefix=" out)
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(delete 'move-extra-documentation)
(add-after 'install 'move-man3-pages
(lambda* (#:key outputs #:allow-other-keys)
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 02/23] gnu: cmake: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-3-m.othacehe@gmail.com
* gnu/packages/cmake.scm (cmake-minimal-cross): New package.
* guix/build-system/cmake.scm (default-cmake): Add new target argument and use
it to select cmake-minimal or cmake-minimal-cross.
(lower): Pass target to default-cmake.
---
gnu/packages/cmake.scm | 8 ++++++++
guix/build-system/cmake.scm | 9 ++++++---
2 files changed, 14 insertions(+), 3 deletions(-)

Toggle diff (48 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 64349be444..13252a9486 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -219,6 +219,14 @@ and workspaces that can be used in the compiler environment of your choice.")
(append (search-patches "cmake-curl-certificates.patch")
(origin-patches (package-source cmake))))))))
+(define-public cmake-minimal-cross
+ (package
+ (inherit cmake-minimal)
+ (name "cmake-minimal-cross")
+ (native-search-paths '())
+ (search-paths
+ (package-native-search-paths cmake-minimal))))
+
(define-public emacs-cmake-mode
(package
(inherit cmake)
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index ca88fadddf..aa0f4187ec 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -43,16 +43,19 @@
`((guix build cmake-build-system)
,@%gnu-build-system-modules))
-(define (default-cmake)
+(define (default-cmake target)
"Return the default CMake package."
;; Do not use `@' to avoid introducing circular dependencies.
(let ((module (resolve-interface '(gnu packages cmake))))
- (module-ref module 'cmake-minimal)))
+ (module-ref module
+ (if target
+ 'cmake-minimal-cross
+ 'cmake-minimal))))
(define* (lower name
#:key source inputs native-inputs outputs system target
- (cmake (default-cmake))
+ (cmake (default-cmake target))
#:allow-other-keys
#:rest arguments)
"Return a bag for NAME."
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 03/23] gnu: groff: Fix cross compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-4-m.othacehe@gmail.com
* gnu/packages/groff.scm (groff)[native-inputs]: Add self,
[arguments]: set GROFF_BIN_PATH and GROFFBIN variables when
cross-compiling.
(groff-minimal)[native-inputs]: Add groff.
---
gnu/packages/groff.scm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

Toggle diff (54 lines)
diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm
index 98f17914bf..5fe353a901 100644
--- a/gnu/packages/groff.scm
+++ b/gnu/packages/groff.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,12 +56,28 @@
;; from 'inputs'.
(inputs `(("ghostscript" ,ghostscript)))
- (native-inputs `(("bison" ,bison)
+
+ ;; When cross-compiling, this package depends upon a native install of
+ ;; itself.
+ (native-inputs `(,@(if (%current-target-system)
+ `(("self" ,this-package))
+ '())
+ ("bison" ,bison)
("perl" ,perl)
("psutils" ,psutils)
("texinfo" ,texinfo)))
(arguments
`(#:parallel-build? #f ; parallel build fails
+ ,@(if (%current-target-system)
+ `(#:make-flags
+ ;; In groff-minimal package, that inherits from this package,
+ ;; we'll need to locate "groff" instead of "self".
+ (let ((groff (or (assoc-ref %build-host-inputs "groff")
+ (assoc-ref %build-host-inputs "self"))))
+ (list
+ (string-append "GROFF_BIN_PATH=" groff)
+ (string-append "GROFFBIN=" groff "/bin/groff"))))
+ '())
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'disable-relocatability
@@ -115,7 +132,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.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 04/23] gnu: cyrus-sasl: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-5-m.othacehe@gmail.com
* gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/cyrus-sasl.scm (cyrus-sasl)[origin]: Apply it.
[native-tools]: Add autoconf, automake and libtool.
[arguments]: Run autoconf to apply m4 modification in patch above.
---
gnu/local.mk | 1 +
gnu/packages/cyrus-sasl.scm | 17 +++++++++++++++--
.../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch

Toggle diff (82 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index a1190af0db..3acb44e450 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -758,6 +758,7 @@ dist_patch_DATA = \
%D%/packages/patches/cube-nocheck.patch \
%D%/packages/patches/cursynth-wave-rand.patch \
%D%/packages/patches/cvs-CVE-2017-12836.patch \
+ %D%/packages/patches/cyrus-sasl-ac-try-run-fix.patch \
%D%/packages/patches/darkice-workaround-fpermissive-error.patch \
%D%/packages/patches/dbus-helper-search-path.patch \
%D%/packages/patches/dbus-c++-gcc-compat.patch \
diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm
index f84136e631..3e65a1faf6 100644
--- a/gnu/packages/cyrus-sasl.scm
+++ b/gnu/packages/cyrus-sasl.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,6 +21,7 @@
(define-module (gnu packages cyrus-sasl)
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages dbm)
#:use-module (gnu packages kerberos)
#:use-module (gnu packages tls)
@@ -41,8 +43,13 @@
"ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-"
version ".tar.gz")))
(sha256 (base32
- "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))))
+ "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6"))
+ (patches (search-patches "cyrus-sasl-ac-try-run-fix.patch"))))
(build-system gnu-build-system)
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
(inputs `(("gdbm" ,gdbm)
("openssl" ,openssl)))
(propagated-inputs
@@ -57,7 +64,13 @@
;; 'plugin_common.c'. When building the shared libraries there, libtool
;; ends up doing "ln -s plugin_common.lo plugin_common.o", which can
;; fail with EEXIST when building things in parallel.
- #:parallel-build? #f))
+ #:parallel-build? #f
+
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'autogen
+ (lambda _
+ (invoke "autoreconf" "-vif"))))))
(synopsis "Simple Authentication Security Layer implementation")
(description
"SASL (Simple Authentication Security Layer) is an Internet
diff --git a/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
new file mode 100644
index 0000000000..8662e812e9
--- /dev/null
+++ b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
@@ -0,0 +1,12 @@
+--- a/m4/sasl2.m4 2018-11-18 22:33:29.902625600 +0300
++++ b/m4/sasl2.m4 2018-11-18 22:33:59.828746176 +0300
+@@ -339,7 +339,8 @@
+ ],
+ [ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
+ AC_MSG_RESULT(yes) ],
+- AC_MSG_RESULT(no))
++ AC_MSG_RESULT(no),
++ AC_MSG_RESULT(no))
+ LIBS="$cmu_save_LIBS"
+
+ else
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 05/23] gnu: icu4c: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-6-m.othacehe@gmail.com
* gnu/packages/icu4c.scm (icu4c-build-root): New variable.
(icu4c)[native-inputs]: Add it.
[arguments]: Pass it as a configure-flag.
---
gnu/packages/icu4c.scm | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)

Toggle diff (74 lines)
diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 922dfbd348..c70871f7e7 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -27,6 +28,7 @@
#:use-module (gnu packages python)
#:use-module (guix licenses)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix build-system ant)
#:use-module (guix build-system gnu))
@@ -70,13 +72,23 @@
(sha256
(base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2"))))
(build-system gnu-build-system)
+ ;; When cross-compiling, this package needs a source directory of a
+ ;; native-build of itself.
(native-inputs
- `(("python" ,python-minimal)))
+ `(("python" ,python-minimal)
+ ,@(if (%current-target-system)
+ `(("icu4c-build-root" ,icu4c-build-root))
+ '())))
(inputs
`(("perl" ,perl)))
(arguments
`(#:configure-flags
- '("--enable-rpath")
+ (list
+ "--enable-rpath"
+ ,@(if (%current-target-system)
+ '((string-append "--with-cross-build="
+ (assoc-ref %build-inputs "icu4c-build-root")))
+ '()))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'chdir-to-source
@@ -105,6 +117,25 @@ C/C++ part.")
(license x11)
(home-page "http://site.icu-project.org/")))
+(define-public icu4c-build-root
+ (package
+ (inherit icu4c)
+ (name "icu4c-build-root")
+ (arguments
+ (substitute-keyword-arguments (package-arguments icu4c)
+ ((#:tests? _ '())
+ #f)
+ ((#:out-of-source? _ '())
+ #t)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (copy-recursively "../build" out)
+ #t)))))))
+ (native-inputs '())))
+
(define-public java-icu4j
(package
(name "java-icu4j")
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 06/23] gnu: boost: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-7-m.othacehe@gmail.com
* gnu/packages/patches/boost-dumpversion.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/boost.scm (boost)[source]: Apply it,
[native-inputs]: add python unless cross-compiling,
[arguments]: pass cross-compilation mandatory
flags and fill a user-config.jam file pointing to cross-compiler. Disable
python support that is broken when cross-compiling. Disable
provide-libboost_python when cross-compiling.
---
gnu/local.mk | 1 +
gnu/packages/boost.scm | 59 +++++++++++++++-----
gnu/packages/patches/boost-dumpversion.patch | 24 ++++++++
3 files changed, 71 insertions(+), 13 deletions(-)
create mode 100644 gnu/packages/patches/boost-dumpversion.patch

Toggle diff (149 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 3acb44e450..2ec5ffe29e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -715,6 +715,7 @@ dist_patch_DATA = \
%D%/packages/patches/binutils-loongson-workaround.patch \
%D%/packages/patches/blender-2.79-newer-ffmpeg.patch \
%D%/packages/patches/blender-2.79-python-3.7-fix.patch \
+ %D%/packages/patches/boost-dumpversion.patch \
%D%/packages/patches/byobu-writable-status.patch \
%D%/packages/patches/calibre-no-updates-dialog.patch \
%D%/packages/patches/calibre-remove-test-bs4.patch \
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index a2253a9efc..4e1e68204f 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -54,6 +55,8 @@
(string-append "https://dl.bintray.com/boostorg/release/"
version "/source/boost_"
version-with-underscores ".tar.bz2"))))
+ (patches
+ (search-patches "boost-dumpversion.patch"))
(sha256
(base32
"0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3"))))
@@ -62,7 +65,9 @@
("zlib" ,zlib)))
(native-inputs
`(("perl" ,perl)
- ("python" ,python-2)
+ ,@(if (%current-target-system)
+ '()
+ `(("python" ,python-2)))
("tcsh" ,tcsh)))
(arguments
`(#:tests? #f
@@ -76,7 +81,24 @@
;; Set the RUNPATH to $libdir so that the libs find each other.
(string-append "linkflags=-Wl,-rpath="
- (assoc-ref %outputs "out") "/lib"))
+ (assoc-ref %outputs "out") "/lib")
+ ,@(if (%current-target-system)
+ `("--user-config=user-config.jam"
+ ;; Python is not supported when cross-compiling.
+ "--without-python"
+ "binary-format=elf"
+ "target-os=linux"
+ ,@(cond
+ ((string-prefix? "arm" (%current-target-system))
+ '("abi=aapcs"
+ "address-model=32"
+ "architecture=arm"))
+ ((string-prefix? "aarch64" (%current-target-system))
+ '("abi=aapcs"
+ "address-model=64"
+ "architecture=arm"))
+ (else '())))
+ '()))
#:phases
(modify-phases %standard-phases
(delete 'bootstrap)
@@ -94,6 +116,14 @@
(setenv "SHELL" (which "sh"))
(setenv "CONFIG_SHELL" (which "sh"))
+ ,@(if (%current-target-system)
+ `((call-with-output-file "user-config.jam"
+ (lambda (port)
+ (format port
+ "using gcc : cross : ~a-c++ ;"
+ ,(%current-target-system)))))
+ '())
+
(invoke "./bootstrap.sh"
(string-append "--prefix=" out)
;; Auto-detection looks for ICU only in traditional
@@ -108,17 +138,20 @@
(replace 'install
(lambda* (#:key make-flags #:allow-other-keys)
(apply invoke "./b2" "install" make-flags)))
- (add-after 'install 'provide-libboost_python
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- ;; Boost can build support for both Python 2 and Python 3 since
- ;; version 1.67.0, and suffixes each library with the Python
- ;; version. Many consumers only check for libboost_python
- ;; however, so we provide it here as suggested in
- ;; <https://github.com/boostorg/python/issues/203>.
- (with-directory-excursion (string-append out "/lib")
- (symlink "libboost_python27.so" "libboost_python.so"))
- #t))))))
+ ,@(if (%current-target-system)
+ '()
+ '((add-after 'install 'provide-libboost_python
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; Boost can build support for both Python 2 and
+ ;; Python 3 since version 1.67.0, and suffixes each
+ ;; library with the Python version. Many consumers
+ ;; only check for libboost_python however, so we
+ ;; provide it here as suggested in
+ ;; <https://github.com/boostorg/python/issues/203>.
+ (with-directory-excursion (string-append out "/lib")
+ (symlink "libboost_python27.so" "libboost_python.so"))
+ #t))))))))
(home-page "https://www.boost.org")
(synopsis "Peer-reviewed portable C++ source libraries")
diff --git a/gnu/packages/patches/boost-dumpversion.patch b/gnu/packages/patches/boost-dumpversion.patch
new file mode 100644
index 0000000000..7df779cfe6
--- /dev/null
+++ b/gnu/packages/patches/boost-dumpversion.patch
@@ -0,0 +1,24 @@
+This issue is described here: https://github.com/openwrt/packages/pull/8685
+and has not been solved as of 1.70.0 release.
+
+--- a/tools/build/src/tools/common.jam
++++ b/tools/build/src/tools/common.jam
+@@ -973,18 +973,6 @@
+ }
+ }
+
+- # From GCC 5, versioning changes and minor becomes patch
+- if $(tag) = gcc && [ numbers.less 4 $(version[1]) ]
+- {
+- version = $(version[1]) ;
+- }
+-
+- # Ditto, from Clang 4
+- if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ]
+- {
+- version = $(version[1]) ;
+- }
+-
+ # On intel, version is not added, because it does not matter and it is the
+ # version of vc used as backend that matters. Ideally, we should encode the
+ # backend version but that would break compatibility with V1.
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 07/23] gnu: eudev: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-8-m.othacehe@gmail.com
* gnu/packages/linux.scm (eudev)[arguments]: Look for xsltproc in both
native-inputs and inputs. Also, do not run udevadm when cross-compiling.

We need to find another way to generate hwdb.bin file for cross-built systems.
---
gnu/packages/linux.scm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 461c019d64..c40072a706 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2576,7 +2576,7 @@ from the module-init-tools project.")
(patches (search-patches "eudev-rules-directory.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'make-source-writable
(lambda _
@@ -2585,19 +2585,25 @@ from the module-init-tools project.")
(for-each make-file-writable (find-files "."))
#t))
(add-before 'bootstrap 'patch-file-names
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
(substitute* "man/make.sh"
(("/usr/bin/xsltproc")
- (string-append (assoc-ref inputs "xsltproc")
+ (string-append (assoc-ref
+ (or native-inputs inputs) "xsltproc")
"/bin/xsltproc")))
#t))
(add-after 'install 'build-hwdb
(lambda* (#:key outputs #:allow-other-keys)
;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
;; similar tools to display product names.
+ ;;
+ ;; XXX: This can't be done when cross-compiling. Find another way
+ ;; to generate hwdb.bin for cross-built systems.
(let ((out (assoc-ref outputs "out")))
- (invoke (string-append out "/bin/udevadm")
- "hwdb" "--update")))))
+ ,@(if (%current-target-system)
+ '(#t)
+ '((invoke (string-append out "/bin/udevadm")
+ "hwdb" "--update")))))))
#:configure-flags (list "--enable-manpages")))
(native-inputs
`(("autoconf" ,autoconf)
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 08/23] gnu: bdb: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-9-m.othacehe@gmail.com
* gnu/packages/dbm.scm (bdb-4.8)[arguments]: Pass host argument to configure
when cross-compiling.
---
gnu/packages/dbm.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm
index 5191c475c2..84c5817a79 100644
--- a/gnu/packages/dbm.scm
+++ b/gnu/packages/dbm.scm
@@ -55,7 +55,7 @@
#:phases
(modify-phases %standard-phases
(replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key target outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(doc (assoc-ref outputs "doc")))
;; '--docdir' is not honored, so we need to patch.
@@ -74,6 +74,10 @@
'("--build=aarch64-unknown-linux-gnu")
'())
+ ,@(if (%current-target-system) ; cross building
+ '((string-append "--host=" target))
+ '())
+
;; Remove 7 MiB of .a files.
"--disable-static"
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 09/23] gnu: openldap: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-10-m.othacehe@gmail.com
* gnu/packages/openldap.scm (openldap)[inputs]: Move groff from here to ...
[native-inputs]: ... here. Also add bdb and automake.
[arguments]: Add cross-compilation specific configure-flags. Do not strip when
cross-compiling. Add a new fix-configure phase to update outdated config.sub
and config.guess. Add a fix-cross-gcc phase to set CC variable to
cross-compiler name when cross-compiling.
---
gnu/packages/openldap.scm | 38 +++++++++++++++++++++++++++++++++++---
1 file changed, 35 insertions(+), 3 deletions(-)

Toggle diff (72 lines)
diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index 2f80920ed4..2c9b0d428e 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -50,6 +51,7 @@
#:use-module (gnu packages)
#:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl))
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python))
@@ -79,16 +81,46 @@
(inputs `(("bdb" ,bdb-5.3)
("cyrus-sasl" ,cyrus-sasl)
("gnutls" ,gnutls)
- ("groff" ,groff)
("icu4c" ,icu4c)
("libgcrypt" ,libgcrypt)
("zlib" ,zlib)))
- (native-inputs `(("libtool" ,libtool)))
+ (native-inputs `(("libtool" ,libtool)
+ ("groff" ,groff)
+ ("bdb" ,bdb-5.3)
+ ;; For up to date 'config.guess' and 'config.sub'.
+ ("automake" ,automake)))
(arguments
`(#:tests? #f
- #:configure-flags '("--disable-static")
+ #:configure-flags
+ '("--disable-static"
+ ,@(if (%current-target-system)
+ '("--with-yielding_select=yes"
+ "ac_cv_func_memcmp_working=yes")
+ '()))
+ ;; Disable install stripping as it breaks cross-compiling.
+ #:make-flags '("STRIP=")
#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ ;; Replace outdated config.sub and config.guess:
+ (with-directory-excursion "build"
+ (for-each (lambda (file)
+ (install-file (string-append
+ (assoc-ref
+ (or native-inputs inputs) "automake")
+ "/share/automake-"
+ ,(version-major+minor
+ (package-version automake))
+ "/" file) "."))
+ '("config.sub" "config.guess")))
+ #t))
+ ,@(if (%current-target-system)
+ '((add-before 'configure 'fix-cross-gcc
+ (lambda* (#:key target #:allow-other-keys)
+ (setenv "CC" (string-append target "-gcc"))
+ #t)))
+ '())
(add-after 'install 'patch-sasl-path
;; Give -L arguments for cyrus-sasl to avoid propagation.
(lambda* (#:key inputs outputs #:allow-other-keys)
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 10/23] gnu: swig: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-11-m.othacehe@gmail.com
* gnu/packages/swig.scm (swig)[inputs]: Add pcre that is needed when cross-compiling.
---
gnu/packages/swig.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/swig.scm b/gnu/packages/swig.scm
index b1b17fc68d..90d698a8b4 100644
--- a/gnu/packages/swig.scm
+++ b/gnu/packages/swig.scm
@@ -62,6 +62,7 @@
(native-inputs `(("boost" ,boost)
("pcre" ,pcre "bin"))) ;for 'pcre-config'
(inputs `(;; Provide these to run the corresponding tests.
+ ("pcre" ,pcre)
("guile" ,guile-2.0)
("perl" ,perl)))
;; FIXME: reactivate input python as soon as the test failures
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 11/23] gnu: git: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-12-m.othacehe@gmail.com
* gnu/packages/version-control.scm (git-cross-configure-flags): New variable,
(git)[arguments]: add it to configure-flags. Also add cross curl-config script
to PATH.
(git-minimal): Add previous variable to configure-flags.
---
gnu/packages/version-control.scm | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 192fa666d9..947873e6d5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -141,6 +141,10 @@ changes to project files over time. It supports both a distributed workflow
as well as the classic centralized workflow.")
(license license:gpl2+)))
+(define git-cross-configure-flags
+ '("ac_cv_fread_reads_directories=yes"
+ "ac_cv_snprintf_returns_bogus=no"))
+
(define-public git
(package
(name "git")
@@ -233,7 +237,10 @@ as well as the classic centralized workflow.")
;; absolute file name to 'wish'.
#:configure-flags (list (string-append "--with-tcltk="
(assoc-ref %build-inputs "tk")
- "/bin/wish8.6")) ; XXX
+ "/bin/wish8.6") ; XXX
+ ,@(if (%current-target-system)
+ git-cross-configure-flags
+ '()))
#:modules ((srfi srfi-1)
(srfi srfi-26)
@@ -250,6 +257,15 @@ as well as the classic centralized workflow.")
(remove (cut string-prefix? bash-full <>) path)
":"))
#t)))
+ ;; Add cross curl-config script to PATH when cross-compiling.
+ ,@(if (%current-target-system)
+ '((add-before 'configure 'add-cross-curl-config
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "PATH"
+ (string-append (assoc-ref inputs "curl") "/bin:"
+ (getenv "PATH")))
+ #t)))
+ '())
(add-after 'configure 'patch-makefiles
(lambda _
(substitute* "Makefile"
@@ -506,7 +522,10 @@ everything from small to very large projects with speed and efficiency.")
(string-append out "/share/gitweb"))
#t)))))
((#:configure-flags flags)
- ''())
+ `(list
+ ,@(if (%current-target-system)
+ git-cross-configure-flags
+ '())))
((#:disallowed-references lst '())
`(,perl ,@lst))))
(outputs '("out"))
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 12/23] gnu: doxygen: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-13-m.othacehe@gmail.com
* gnu/packages/documentation.scm (doxygen)[arguments]: Force cmake to use
iconv.h from cross-libc.
---
gnu/packages/documentation.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 19c42b00eb..eda8ca3368 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2017 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.
;;;
@@ -31,6 +32,7 @@
#:use-module (guix build-system cmake)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages python)
#:use-module (gnu packages bison)
@@ -145,7 +147,15 @@ markup) can be customized and extended by the user.")
(inputs
`(("bash" ,bash-minimal)))
(arguments
- `(#:test-target "tests"
+ ;; Force cmake to use iconv header from cross-libc instead of the one
+ ;; from native libc.
+ `(,@(if (%current-target-system)
+ '(#:configure-flags
+ (list (string-append "-DICONV_INCLUDE_DIR="
+ (assoc-ref %build-inputs "cross-libc")
+ "/include")))
+ '())
+ #:test-target "tests"
#:phases (modify-phases %standard-phases
(add-before 'configure 'patch-sh
(lambda* (#:key inputs #:allow-other-keys)
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 13/23] gnu: guile-gcrypt: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-14-m.othacehe@gmail.com
* gnu/packages/gnupg.scm (guile-gcrypt) [native-inputs]: Add guile,
[arguments]: add libgcrypt-config to PATH when cross-compiling.
---
gnu/packages/gnupg.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 4acc434093..9ec51d8201 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -479,11 +480,26 @@ gpgpme starting with version 1.7.")
"1mhc5m4xygkfj7x18f8apiqpfdn9mrql0am5sk13cf5xn8x1r63z"))
(file-name (string-append name "-" version "-checkout"))))
(build-system gnu-build-system)
+ (arguments
+ ;; When cross-compiling, the bash script libgcrypt-config provided by
+ ;; libgcrypt must be accessible during configure phase.
+ `(,@(if (%current-target-system)
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'add-libgrypt-config
+ (lambda _
+ (setenv "PATH" (string-append
+ (assoc-ref %build-inputs "libgcrypt")
+ "/bin:"
+ (getenv "PATH")))
+ #t))))
+ '())))
(native-inputs
`(("pkg-config" ,pkg-config)
("autoconf" ,autoconf)
("automake" ,automake)
- ("texinfo" ,texinfo)))
+ ("texinfo" ,texinfo)
+ ("guile" ,guile-2.2)))
(inputs
`(("guile" ,guile-2.2)
("libgcrypt" ,libgcrypt)))
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 15/23] gnu: libnl: Move python outputs to separate packages.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-16-m.othacehe@gmail.com
Cross compiling python extensions is currently broken. To allow libnl
cross compilation, move its python2 and python3 outputs to separate
packages.

* gnu/packages/linux.scm (libnl)[outputs]: Remove python2 and python3
and replace by ...
(libnl-python-package): ... this new procedure,
(libnl-python2, libnl-python3): new variables.
---
gnu/packages/linux.scm | 66 +++++++++++++++++++++++++++---------------
1 file changed, 43 insertions(+), 23 deletions(-)

Toggle diff (92 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c40072a706..8ba3c7d9db 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1953,35 +1953,18 @@ transparently through a bridge.")
"/libnl-doc-" version ".tar.gz"))
(sha256
(base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
- (inputs
- `(("python-2" ,python-2)
- ("python-3" ,python-3)))
- (outputs '("out" "doc" "python2" "python3"))
+ (outputs `("out" "doc"))
(arguments
- `(#:modules ((guix build gnu-build-system)
- (guix build utils)
- (srfi srfi-1))
- #:phases
+ `(#:phases
(modify-phases %standard-phases
- (add-after 'install 'install-python
- (lambda* (#:key outputs #:allow-other-keys)
- (define (python-inst python)
- (invoke python "setup.py" "build")
- (invoke python "setup.py" "install"
- (string-append "--prefix="
- (assoc-ref %outputs python)))
- (invoke python "setup.py" "clean"))
- (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
- (assoc-ref %outputs "out")))
- (with-directory-excursion "./python"
- (for-each python-inst '("python2" "python3")))
- #t))
(add-after 'install 'install-doc
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
(let ((dest (string-append (assoc-ref outputs "doc")
"/share/doc/libnl")))
(mkdir-p dest)
- (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
+ (invoke "tar" "xf" (assoc-ref
+ (or native-inputs inputs)
+ "libnl3-doc")
"--strip-components=1" "-C" dest)))))))
(home-page "https://www.infradead.org/~tgr/libnl/")
(synopsis "NetLink protocol library suite")
@@ -1996,6 +1979,43 @@ configuration and monitoring interfaces.")
;; 'nl-addr-add.c'), so the result is GPLv2-only.
(license license:gpl2)))
+;; libnl python extensions used to be outputs of libnl. However, as
+;; cross-compiling python extensions is currently broken, create separate
+;; packages for libnl python extensions.
+(define (libnl-python-package python)
+ (let ((name (string-append "libnl-" python)))
+ (package
+ (inherit libnl)
+ (name name)
+ (inputs `(,@(cond
+ ((string=? python "python2")
+ `(("python-2" ,python-2)))
+ ((string=? python "python3")
+ `(("python-3" ,python-3))))))
+ (propagated-inputs `(("libnl" ,libnl)))
+ (outputs '("out"))
+ (arguments
+ `(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1))
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (define (python-inst python)
+ (invoke python "setup.py" "build")
+ (invoke python "setup.py" "install"
+ (string-append "--prefix="
+ (assoc-ref %outputs "out")))
+ (invoke python "setup.py" "clean"))
+ (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
+ (assoc-ref inputs "libnl")))
+ (with-directory-excursion "./python" (python-inst ,python))
+ #t))))))))
+
+(define-public libnl-python2 (libnl-python-package "python2"))
+(define-public libnl-python3 (libnl-python-package "python3"))
+
(define-public iw
(package
(name "iw")
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 16/23] gnu: crda: Fix cross-compilation
(address . 36477@debbugs.gnu.org)(name . Pierre-Moana Levesque)(address . pierre.moana.levesque@gmail.com)
20191002095904.6325-17-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/linux.scm (crda)[arguments]: Patch Makefile to use cross
pkg-config when cross-compiling. Also search for wireless-regdb in both
native-inputs and inputs. Set CC variable to cross-compiler when
cross-compiling.
---
gnu/packages/linux.scm | 67 ++++++++++++++++++++++++++----------------
1 file changed, 42 insertions(+), 25 deletions(-)

Toggle diff (100 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 8ba3c7d9db..177c8f44ed 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2810,13 +2810,23 @@ interface.")
(patches (search-patches "crda-optional-gcrypt.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
+ `(#:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'gzip-determinism
(lambda _
(substitute* "Makefile"
(("gzip") "gzip --no-name"))
#t))
+ ,@(if (%current-target-system)
+ '((add-after
+ 'unpack 'fix-pkg-config
+ (lambda* (#:key target #:allow-other-keys)
+ (substitute*
+ "Makefile"
+ (("pkg-config")
+ (string-append target "-pkg-config")))
+ #t)))
+ '())
(add-before
'build 'no-werror-no-ldconfig
(lambda _
@@ -2826,37 +2836,44 @@ interface.")
#t))
(add-before
'build 'set-regulator-db-file-name
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
;; Tell CRDA where to find our database.
- (let ((regdb (assoc-ref inputs "wireless-regdb")))
+ (let ((regdb (assoc-ref (or native-inputs inputs)
+ "wireless-regdb")))
(substitute* "crda.c"
(("\"/lib/crda/regulatory.bin\"")
(string-append "\"" regdb
"/lib/crda/regulatory.bin\"")))
#t))))
#:test-target "verify"
- #:make-flags (let ((out (assoc-ref %outputs "out"))
- (regdb (assoc-ref %build-inputs "wireless-regdb")))
- (list "CC=gcc" "V=1"
-
- ;; Disable signature-checking on 'regulatory.bin'.
- ;; The reason is that this simplifies maintenance
- ;; on our side (no need to manage a distro key
- ;; pair), and we can guarantee integrity of
- ;; 'regulatory.bin' by other means anyway, such as
- ;; 'guix gc --verify'. See
- ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
- ;; for a discssion.
- "USE_OPENSSL=0"
-
- (string-append "PREFIX=" out)
- (string-append "SBINDIR=" out "/sbin/")
- (string-append "UDEV_RULE_DIR="
- out "/lib/udev/rules.d")
- (string-append "LDFLAGS=-Wl,-rpath="
- out "/lib -L.")
- (string-append "REG_BIN=" regdb
- "/lib/crda/regulatory.bin")))))
+ #:make-flags (let ((out (assoc-ref %outputs "out"))
+ (regdb (assoc-ref %build-inputs "wireless-regdb"))
+ (target ,(%current-target-system)))
+ (list
+ (string-append
+ "CC=" (if target
+ (string-append target "-gcc") "gcc"))
+ "V=1"
+
+ ;; Disable signature-checking on 'regulatory.bin'.
+ ;; The reason is that this simplifies maintenance
+ ;; on our side (no need to manage a distro key
+ ;; pair), and we can guarantee integrity of
+ ;; 'regulatory.bin' by other means anyway, such as
+ ;; 'guix gc --verify'. See
+ ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
+ ;; for a discssion.
+ "USE_OPENSSL=0"
+
+ (string-append "PREFIX=" out)
+ (string-append "SBINDIR=" out "/sbin/")
+ (string-append "UDEV_RULE_DIR="
+ out "/lib/udev/rules.d")
+ (string-append "LDFLAGS=-Wl,-rpath="
+ out "/lib -L.")
+ (string-append "REG_BIN=" regdb
+ "/lib/crda/regulatory.bin")
+ "all_noverify"))))
(native-inputs `(("pkg-config" ,pkg-config)
("python" ,python-2)
("wireless-regdb" ,wireless-regdb)))
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 14/23] gnu: guile-sqlite3: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-15-m.othacehe@gmail.com
* gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/guile.scm (guile-sqlite3)[source]: Apply previous patch,
[native-inputs]: add guile.
---
gnu/local.mk | 1 +
gnu/packages/guile.scm | 7 ++-
.../guile-sqlite3-fix-cross-compilation.patch | 55 +++++++++++++++++++
3 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch

Toggle diff (104 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 2ec5ffe29e..42bc29783b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -935,6 +935,7 @@ dist_patch_DATA = \
%D%/packages/patches/guile-relocatable.patch \
%D%/packages/patches/guile-rsvg-pkgconfig.patch \
%D%/packages/patches/guile-emacs-fix-configure.patch \
+ %D%/packages/patches/guile-sqlite3-fix-cross-compilation.patch \
%D%/packages/patches/gstreamer-buffer-reset-offset.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 478b8faebe..bc57a55052 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -9,7 +9,7 @@
;;; Copyright © 2016, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017, 2018 Amirouche <amirouche@hypermove.net>
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
@@ -521,11 +521,14 @@ Guile's foreign function interface.")
(sha256
(base32
"1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
- (file-name (string-append name "-" version "-checkout"))))
+ (file-name (string-append name "-" version "-checkout"))
+ (patches
+ (search-patches "guile-sqlite3-fix-cross-compilation.patch"))))
(build-system gnu-build-system)
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
+ ("guile" ,guile-2.2)
("pkg-config" ,pkg-config)))
(inputs
`(("guile" ,guile-2.2)
diff --git a/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
new file mode 100644
index 0000000000..9ea9a47677
--- /dev/null
+++ b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
@@ -0,0 +1,55 @@
+From a6e9e62a77ecc5012929613e20da23b2636450a5 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <mathieu.othacehe@parrot.com>
+Date: Mon, 25 Mar 2019 11:00:38 +0100
+Subject: [PATCH] cross compile
+
+---
+ build-aux/guile.am | 2 +-
+ configure.ac | 19 ++++++++++++-------
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/build-aux/guile.am b/build-aux/guile.am
+index dc1e63f..3126372 100644
+--- a/build-aux/guile.am
++++ b/build-aux/guile.am
+@@ -16,4 +16,4 @@ EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
+ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+ SUFFIXES = .scm .go
+ .scm.go:
+- $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
++ $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
+diff --git a/configure.ac b/configure.ac
+index f648fcb..2d34d0a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,15 +21,20 @@ PKG_CHECK_MODULES([SQLITE], [sqlite3])
+ SQLITE_LIBDIR="`"$PKG_CONFIG" sqlite3 --variable libdir`"
+ AC_SUBST([SQLITE_LIBDIR])
+
+-AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
+-GUILE_CHECK([retval],
+- [(dynamic-func \"sqlite3_open_v2\"
++if test "$cross_compiling" = "no"; then
++ AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
++ GUILE_CHECK([retval],
++ [(dynamic-func \"sqlite3_open_v2\"
+ (dynamic-link \"$SQLITE_LIBDIR/libsqlite3\"))])
+-if test "$retval" != 0; then
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ if test "$retval" != 0; then
++ AC_MSG_RESULT([no])
++ AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ else
++ AC_MSG_RESULT([yes])
++ fi
+ else
+- AC_MSG_RESULT([yes])
++ GUILE_TARGET="--target=$host_alias"
++ AC_SUBST([GUILE_TARGET])
+ fi
+
+ AC_CONFIG_FILES([Makefile sqlite3.scm])
+--
+2.17.1
+
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 17/23] gnu: cmake: Fix cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Pierre-Moana Levesque)(address . pierre.moana.levesque@gmail.com)
20191002095904.6325-18-m.othacehe@gmail.com
From: Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>

* gnu/packages/cmake.scm (cmake-minimal)[inputs]: Move all inputs to ...
[native-inputs]: ... here, except for ncurses.
---
gnu/packages/cmake.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 13252a9486..b9ac84ad7e 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -145,16 +146,17 @@
(replace 'configure
(lambda* (#:key (configure-flags '()) #:allow-other-keys)
(apply invoke "./configure" configure-flags))))))
- (inputs
+ (native-inputs
`(("bzip2" ,bzip2)
("curl" ,curl)
("expat" ,expat)
("file" ,file)
("libarchive" ,libarchive)
("libuv" ,libuv)
- ("ncurses" ,ncurses) ; required for ccmake
("rhash" ,rhash)
("zlib" ,zlib)))
+ (inputs
+ `(("ncurses" ,ncurses))) ; required for ccmake
(native-search-paths
(list (search-path-specification
(variable "CMAKE_PREFIX_PATH")
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:59
[PATCH v4 19/23] utils: Use target-aarch64? and target-arm? helpers.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-20-m.othacehe@gmail.com
* guix/utils.scm (target-aarch64?, target-arm?): New exported procedures.
---
guix/utils.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (28 lines)
diff --git a/guix/utils.scm b/guix/utils.scm
index 1f99c5b3f5..c9236ad165 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -78,6 +78,8 @@
package-name->name+version
target-mingw?
target-arm32?
+ target-aarch64?
+ target-arm?
target-64bit?
version-compare
version>?
@@ -494,6 +496,12 @@ a character other than '@'."
(define (target-arm32?)
(string-prefix? "arm" (or (%current-target-system) (%current-system))))
+(define (target-aarch64?)
+ (string-prefix? "aarch64" (or (%current-target-system) (%current-system))))
+
+(define (target-arm?)
+ (or (target-arm32?) (target-aarch64?)))
+
(define (target-64bit?)
(let ((system (or (%current-target-system) (%current-system))))
(any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))))
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:58
[PATCH v4 18/23] gexp: Use cross extensions when cross-compiling.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-19-m.othacehe@gmail.com
---
guix/gexp.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index d9bdde2e42..514422cb08 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1513,7 +1513,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
(string-append extension
"/share/guile/site/"
(effective-version)))
- '((ungexp-native-splicing extensions)))
+ '((ungexp-splicing extensions)))
%load-path)))
(set! %load-compiled-path
(cons (ungexp compiled)
@@ -1522,7 +1522,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
"/lib/guile/"
(effective-version)
"/site-ccache"))
- '((ungexp-native-splicing extensions)))
+ '((ungexp-splicing extensions)))
%load-compiled-path)))))))))
(define* (gexp->script name exp
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:59
[PATCH v4 20/23] build: vm: Fix arm32 support.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-21-m.othacehe@gmail.com
* gnu/build/vm.scm (load-in-linux-vm): Disable qemu highmem support on ARM32
systems.
---
gnu/build/vm.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Toggle diff (21 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a5d9fefa62..b85398ed24 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -102,6 +102,14 @@ the #:references-graphs parameter of 'derivation'."
;; hardware limits imposed by other machines.
,@(if target-arm32? '("-M" "virt") '())
+ ;; On ARM32, if the kernel is built without LPAE support, ECAM conflicts
+ ;; with VIRT_PCIE_MMIO causing PCI devices not to show up. Disable
+ ;; explicitely highmem to fix it.
+ ;; See: https://bugs.launchpad.net/qemu/+bug/1790975.
+ ,@(if target-arm32?
+ '("-machine" "highmem=off")
+ '())
+
;; Only enable kvm if we see /dev/kvm exists. This allows users without
;; hardware virtualization to still use these commands. KVM support is
;; still buggy on some ARM32 boards. Do not use it even if available.
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:59
[PATCH v4 21/23] system: vm: Add arm64 support.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-22-m.othacehe@gmail.com
* gnu/build/vm.scm (load-in-linux-vm): Add target-arm64? argument and use it
to pass correct arguments to qemu.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass the new
target-arm64? argument added above. Do not add ESP partition on all ARM
targets. Do not pass grub-efi package to initialize-hard-disk on ARM targets.
---
gnu/build/vm.scm | 19 +++++++++++++------
gnu/system/vm.scm | 15 +++++++++------
2 files changed, 22 insertions(+), 12 deletions(-)

Toggle diff (113 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index b85398ed24..6f920aec9e 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -82,6 +82,7 @@
make-disk-image?
single-file-output?
target-arm32?
+ target-aarch64?
(disk-image-size (* 100 (expt 2 20)))
(disk-image-format "qcow2")
(references-graphs '()))
@@ -97,10 +98,14 @@ access it via /dev/hda.
REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
the #:references-graphs parameter of 'derivation'."
+ (define target-arm? (or target-arm32? target-aarch64?))
+
(define arch-specific-flags
`(;; On ARM, a machine has to be specified. Use "virt" machine to avoid
;; hardware limits imposed by other machines.
- ,@(if target-arm32? '("-M" "virt") '())
+ ,@(if target-arm?
+ '("-M" "virt")
+ '())
;; On ARM32, if the kernel is built without LPAE support, ECAM conflicts
;; with VIRT_PCIE_MMIO causing PCI devices not to show up. Disable
@@ -112,9 +117,9 @@ the #:references-graphs parameter of 'derivation'."
;; Only enable kvm if we see /dev/kvm exists. This allows users without
;; hardware virtualization to still use these commands. KVM support is
- ;; still buggy on some ARM32 boards. Do not use it even if available.
+ ;; still buggy on some ARM boards. Do not use it even if available.
,@(if (and (file-exists? "/dev/kvm")
- (not target-arm32?))
+ (not target-arm?))
'("-enable-kvm")
'())
@@ -125,11 +130,11 @@ the #:references-graphs parameter of 'derivation'."
;; The serial port name differs between emulated
;; architectures/machines.
" console="
- (if target-arm32? "ttyAMA0" "ttyS0"))
+ (if target-arm? "ttyAMA0" "ttyS0"))
;; NIC is not supported on ARM "virt" machine, so use a user mode
;; network stack instead.
- ,@(if target-arm32?
+ ,@(if target-arm?
'("-device" "virtio-net-pci,netdev=mynet"
"-netdev" "user,id=mynet")
'("-net" "nic,model=virtio"))))
@@ -153,7 +158,9 @@ the #:references-graphs parameter of 'derivation'."
(_ #f))
(apply invoke qemu "-nographic" "-no-reboot"
- "-smp" (number->string (parallel-job-count))
+ ;; CPU "max" behaves as "host" when KVM is enabled, and like a system
+ ;; CPU with the maximum possible feature set otherwise.
+ "-cpu" "max"
"-m" (number->string memory-size)
"-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
"-device" "virtio-rng-pci,rng=guixsd-vm-rng"
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index ac6e4ded92..de20030848 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -235,10 +235,12 @@ made available under the /xchg CIFS share."
#:memory-size #$memory-size
#:make-disk-image? #$make-disk-image?
#:single-file-output? #$single-file-output?
- ;; FIXME: ‘target-arm32?’ may not operate on
- ;; the right system/target values. Rewrite
+ ;; FIXME: ‘target-arm32?’ and
+ ;; ‘target-aarch64?’ may not operate on the
+ ;; right system/target values. Rewrite
;; using ‘let-system’ when available.
#:target-arm32? #$(target-arm32?)
+ #:target-aarch64? #$(target-aarch64?)
#:disk-image-format #$disk-image-format
#:disk-image-size size
#:references-graphs graphs))))))
@@ -452,10 +454,10 @@ system."
;; bootloaders if we are not targeting ARM because UEFI
;; support in U-Boot is experimental.
;;
- ;; FIXME: ‘target-arm32?’ may be not operate on the right
+ ;; FIXME: ‘target-arm?’ may be not operate on the right
;; system/target values. Rewrite using ‘let-system’ when
;; available.
- (if #$(target-arm32?)
+ (if #$(target-arm?)
'()
(list (partition
;; The standalone grub image is about 10MiB, but
@@ -466,10 +468,11 @@ system."
;; when mounting. The actual FAT-ness is based
;; on file system size (16 in this case).
(file-system "vfat")
- (flags '(esp))))))))
+ (flags '(esp)))))))
+ (grub-efi #$(and (not (target-arm?)) grub-efi)))
(initialize-hard-disk "/dev/vda"
#:partitions partitions
- #:grub-efi #$grub-efi
+ #:grub-efi grub-efi
#:bootloader-package
#$(bootloader-package bootloader)
#:bootcfg #$bootcfg-drv
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:59
[PATCH v4 22/23] system: vm: Support cross-compilation.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-23-m.othacehe@gmail.com
* gnu/system.scm (system-linux-image-file-name): Add support for cross-built
systems. Remove system argument that was ignored,
(operating-system-kernel-file): adapt by removing ignored os argument.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add target
argument and turn inputs into native-inputs. Pass target to qemu-command
and gexp->derivation calls.
(iso9660-image): Add target argument and pass it to
expression->derivation-in-linux-vm. Remove qemu from inputs as it
is not necessary.
(qemu-image): Add target argument, also remove qemu from inputs. Pass
target argument to expression->derivation-in-linux-vm call.
---
gnu/system.scm | 15 ++++++++-------
gnu/system/vm.scm | 18 +++++++++++++-----
2 files changed, 21 insertions(+), 12 deletions(-)

Toggle diff (136 lines)
diff --git a/gnu/system.scm b/gnu/system.scm
index 37573fd153..fcd6203c70 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -447,20 +447,21 @@ from the initrd."
"Return the list of swap services for OS."
(map swap-service (operating-system-swap-devices os)))
-(define* (system-linux-image-file-name #:optional (system (%current-system)))
+(define* (system-linux-image-file-name)
"Return the basename of the kernel image file for SYSTEM."
;; FIXME: Evaluate the conditional based on the actual current system.
- (cond
- ((string-prefix? "arm" (%current-system)) "zImage")
- ((string-prefix? "mips" (%current-system)) "vmlinuz")
- ((string-prefix? "aarch64" (%current-system)) "Image")
- (else "bzImage")))
+ (let ((target (or (%current-target-system) (%current-system))))
+ (cond
+ ((string-prefix? "arm" target) "zImage")
+ ((string-prefix? "mips" target) "vmlinuz")
+ ((string-prefix? "aarch64" target) "Image")
+ (else "bzImage"))))
(define (operating-system-kernel-file os)
"Return an object representing the absolute file name of the kernel image of
OS."
(file-append (operating-system-kernel os)
- "/" (system-linux-image-file-name os)))
+ "/" (system-linux-image-file-name)))
(define* (operating-system-directory-base-entries os)
"Return the basic entries of the 'system' directory of OS for use as the
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index de20030848..c900b2d435 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -143,7 +143,7 @@
(define* (expression->derivation-in-linux-vm name exp
#:key
- (system (%current-system))
+ (system (%current-system)) target
(linux linux-libre)
initrd
(qemu qemu-minimal)
@@ -214,7 +214,8 @@ made available under the /xchg CIFS share."
(use-modules (guix build utils)
(gnu build vm))
- (let* ((inputs '#$(list qemu (canonical-package coreutils)))
+ (let* ((native-inputs
+ '#+(list qemu (canonical-package coreutils)))
(linux (string-append #$linux "/"
#$(system-linux-image-file-name)))
(initrd #$initrd)
@@ -222,16 +223,18 @@ made available under the /xchg CIFS share."
(graphs '#$(match references-graphs
(((graph-files . _) ...) graph-files)
(_ #f)))
+ (target #$(or (%current-target-system) (%current-system)))
(size #$(if (eq? 'guess disk-image-size)
#~(+ (* 70 (expt 2 20)) ;ESP
(estimated-partition-size graphs))
disk-image-size)))
- (set-path-environment-variable "PATH" '("bin") inputs)
+ (set-path-environment-variable "PATH" '("bin") native-inputs)
(load-in-linux-vm loader
#:output #$output
#:linux linux #:initrd initrd
+ #:qemu (qemu-command target)
#:memory-size #$memory-size
#:make-disk-image? #$make-disk-image?
#:single-file-output? #$single-file-output?
@@ -248,6 +251,7 @@ made available under the /xchg CIFS share."
(gexp->derivation name builder
;; TODO: Require the "kvm" feature.
#:system system
+ #:target target
#:env-vars env-vars
#:guile-for-build guile-for-build
#:references-graphs references-graphs)))
@@ -263,6 +267,7 @@ made available under the /xchg CIFS share."
file-system-label
file-system-uuid
(system (%current-system))
+ (target (%current-target-system))
(qemu qemu-minimal)
os
bootcfg-drv
@@ -299,7 +304,7 @@ INPUTS is a list of inputs (as for packages)."
(setlocale LC_ALL "en_US.utf8")
(let ((inputs
- '#$(append (list qemu parted e2fsprogs dosfstools xorriso)
+ '#$(append (list parted e2fsprogs dosfstools xorriso)
(map canonical-package
(list sed grep coreutils findutils gawk))))
@@ -328,6 +333,7 @@ INPUTS is a list of inputs (as for packages)."
#:volume-uuid #$(and=> file-system-uuid
uuid-bytevector))))))
#:system system
+ #:target target
;; Keep a local file system for /tmp so that we can populate it directly as
;; root and have files owned by root. See <https://bugs.gnu.org/31752>.
@@ -346,6 +352,7 @@ INPUTS is a list of inputs (as for packages)."
(define* (qemu-image #:key
(name "qemu-image")
(system (%current-system))
+ (target (%current-target-system))
(qemu qemu-minimal)
(disk-image-size 'guess)
(disk-image-format "qcow2")
@@ -404,7 +411,7 @@ system."
(setlocale LC_ALL "en_US.utf8")
(let ((inputs
- '#$(append (list qemu parted e2fsprogs dosfstools)
+ '#$(append (list parted e2fsprogs dosfstools)
(map canonical-package
(list sed grep coreutils findutils gawk))))
@@ -481,6 +488,7 @@ system."
#:bootloader-installer
#$(bootloader-installer bootloader)))))))
#:system system
+ #:target target
#:make-disk-image? #t
#:disk-image-size disk-image-size
#:disk-image-format disk-image-format
--
2.23.0
M
M
Mathieu Othacehe wrote on 2 Oct 2019 11:59
[PATCH v4 23/23] scripts: system: Add --target option.
(address . 36477@debbugs.gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
20191002095904.6325-24-m.othacehe@gmail.com
* guix/scripts/system.scm (%options): Add target option,
(%default-options): ditto,
(process-action): Rename existing target variable to target-file and pass new
target variable to run-with-store procedure.
---
guix/scripts/system.scm | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

Toggle diff (72 lines)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 27b014db68..d3e10b6dc7 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2016, 2017, 2018 Chris Marusich <cmmarusich@gmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
;;;
@@ -931,6 +931,8 @@ Some ACTIONS support additional ARGS.\n"))
--full-boot for 'vm', make a full boot sequence"))
(display (G_ "
--skip-checks skip file system and initrd module safety checks"))
+ (display (G_ "
+ --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\""))
(display (G_ "
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
(newline)
@@ -1004,6 +1006,10 @@ Some ACTIONS support additional ARGS.\n"))
(lambda (opt name arg result)
(alist-cons 'system arg
(alist-delete 'system result eq?))))
+ (option '("target") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'target arg
+ (alist-delete 'target result eq?))))
(option '(#\r "root") #t #f
(lambda (opt name arg result)
(alist-cons 'gc-root arg result)))
@@ -1012,6 +1018,7 @@ Some ACTIONS support additional ARGS.\n"))
(define %default-options
;; Alist of default option values.
`((system . ,(%current-system))
+ (target . #f)
(substitutes? . #t)
(build-hook? . #t)
(print-build-trace? . #t)
@@ -1045,6 +1052,7 @@ resulting from command-line parsing."
((x . _) x)))
(expr (assoc-ref opts 'expression))
(system (assoc-ref opts 'system))
+ (target (assoc-ref opts 'target))
(os (ensure-operating-system
(or file expr)
(cond
@@ -1061,7 +1069,7 @@ resulting from command-line parsing."
(dry? (assoc-ref opts 'dry-run?))
(bootloader? (assoc-ref opts 'install-bootloader?))
- (target (match args
+ (target-file (match args
((first second) second)
(_ #f)))
(bootloader-target
@@ -1103,9 +1111,10 @@ resulting from command-line parsing."
(_ #f))
opts)
#:install-bootloader? bootloader?
- #:target target
+ #:target target-file
#:bootloader-target bootloader-target
#:gc-root (assoc-ref opts 'gc-root)))))
+ #:target target
#:system system))
(warn-about-disk-space)))
--
2.23.0
E
E
Efraim Flashner wrote on 2 Oct 2019 12:17
Re: [bug#36477] [PATCH v4 01/23] gnu: openssl: Fix cross-compilation.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . 36477@debbugs.gnu.org)
20191002101714.GD590@E5400
Attachment: file
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl2UeScACgkQQarn3Mo9
g1Hd6w//dVWoEQoSXc8s2i+pXMQAzZDnRNVOQNEUwqi4+6Js+MO1RlgPeJCFlrKF
WcwlXH1or68SRlqlKGvsnuNcIayTOG8eS4AzhEn9ozr2rM/ja2rDUxmDHspK+c+4
eB1JpTxLYU+2wdfMV5wvsiijlJ29+mBU5R+cSOiAC7b4eqp6yUo0fPki1K/cY5L0
E5PJpSWnqEGxkUcdIqJYayAjof1m8YKSd4T9G4NjwLayMtkWLSRHlNlKdRZdAn8T
OR9UXOqDfhRIcMmFWRx9699enfH0QnC7suUTA1EKyoerSaikfjbxObkzZ+uLXbXR
WQTTxk0YVj8R39Y3ZvuKKkBQAXID+DXXiAtEb/FHlUykMVggkM1MxDstihI9ZBiO
Nzh5SPDYC2GI/FjPxP2V32lsRSV79v1dyl24K2frXge4JiMsp0gS4QfE6z2tGHgA
J1Lz9Ke2v9uW8p6TdtW/ztRRIHW6yAtY/UKKKPyrECJ2R2ZA//q9mjBgh/KpQiuG
6IrfK2j0tr4m+B8j+tmh4kNQKtIp/4APl1C6C6g1EQWEN9T6Fl/LTrbaZJ77yYlH
MXLv6wFKrFoAsjUFHX8WZarA5Zn9dGU88h+vae44x83v6jMEdTclw31vz+Rx8NZL
ZWmMp/MBbLFEJsEYaVumT0Ch5HOerfDFEZkDAq5vGPlNFb6R1q0=
=Z5iI
-----END PGP SIGNATURE-----


M
M
Mathieu Othacehe wrote on 2 Oct 2019 15:12
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 36477@debbugs.gnu.org)
87h84r8f6k.fsf@gmail.com
Hey Efraim,

Thanks for reviewing.

Toggle quote (8 lines)
> This needs a null case. I think I'd try
> (_
> (string-append "linux-" (string-tokenize
> (%current-target-system)
> (char-set-compliment (char-set #\-)))))
> This would create something somewhat usable for uncovered cases, and in
> the case of x86_64-linux, it would (should) spit out "linux-x86_64"

Ok I'll add it (something like a "car" is missing to take only the first
part of %current-target-system which is referring to the architecture).

Toggle quote (6 lines)
> could this be changed to
> ,@(when (%current-target-system)
> '((getenv "CONFIGURE_TARGET_ARCH")))
>
> if it works then you don't need the 'if not' null case.

Nope, sadly it wouldn't work :(

,@(when #t '(1)) -> '(1)

but,

,@(when #f '(1)) -> "Unknown meta command: @"

Mathieu
M
M
Mathieu Othacehe wrote on 2 Oct 2019 16:47
Re: [PATCH v4 18/23] gexp: Use cross extensions when cross-compiling.
(address . 36477@debbugs.gnu.org)
CANVeeZwqrkWy6aLatiYSoBw9Mh1tw9EtqAY4AAZpAP75ri8kbA@mail.gmail.com
I forget the commit message. It would be:

* guix/gexp.scm (load-path-expression): Use ungexp-splicing instead of
ungexp-native-splicing
so that the cross modules are used when target is set.

Mathieu

Le mer. 2 oct. 2019 à 11:59, Mathieu Othacehe <m.othacehe@gmail.com> a écrit :
Toggle quote (30 lines)
>
> ---
> guix/gexp.scm | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/guix/gexp.scm b/guix/gexp.scm
> index d9bdde2e42..514422cb08 100644
> --- a/guix/gexp.scm
> +++ b/guix/gexp.scm
> @@ -1513,7 +1513,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
> (string-append extension
> "/share/guile/site/"
> (effective-version)))
> - '((ungexp-native-splicing extensions)))
> + '((ungexp-splicing extensions)))
> %load-path)))
> (set! %load-compiled-path
> (cons (ungexp compiled)
> @@ -1522,7 +1522,7 @@ are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
> "/lib/guile/"
> (effective-version)
> "/site-ccache"))
> - '((ungexp-native-splicing extensions)))
> + '((ungexp-splicing extensions)))
> %load-compiled-path)))))))))
>
> (define* (gexp->script name exp
> --
> 2.23.0
>
L
L
Ludovic Courtès wrote on 11 Oct 2019 12:21
Re: [bug#36477] [PATCH v4 18/23] gexp: Use cross extensions when cross-compiling.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . 36477@debbugs.gnu.org)
87d0f3popz.fsf@gnu.org
Hi Mathieu,

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

Toggle quote (6 lines)
> I forget the commit message. It would be:
>
> * guix/gexp.scm (load-path-expression): Use ungexp-splicing instead of
> ungexp-native-splicing
> so that the cross modules are used when target is set.

This one LGTM because ‘load-path-expression’ is used in ‘gexp->file’ and
‘gexp->script’, where, indeed, we want to use the target extensions (and
target modules too!).

Please push to ‘master’ (I don’t think it triggers a full rebuild, but
I’d suggest double-checking anyway :-)).

Thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 11 Oct 2019 12:22
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . 36477@debbugs.gnu.org)
87blunpoon.fsf@gnu.org
Hi Mathieu,

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

Toggle quote (6 lines)
> I forget the commit message. It would be:
>
> * guix/gexp.scm (load-path-expression): Use ungexp-splicing instead of
> ungexp-native-splicing
> so that the cross modules are used when target is set.

This one LGTM because ‘load-path-expression’ is used in ‘gexp->file’ and
‘gexp->script’, where, indeed, we want to use the target extensions (and
target modules too!).

Please push to ‘master’ (I don’t think it triggers a full rebuild, but
I’d suggest double-checking anyway :-)).

Thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 11 Oct 2019 12:22
Re: [bug#36477] [PATCH v3 42/48] gexp: Pass target to compiled-modules in lower-gexp.
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
877e5bponj.fsf@gnu.org
Howdy!

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

Toggle quote (7 lines)
>> The cross-compilation target should only affect things that the regex
>> refers to with ‘ungexp’ or ‘ungexp-splicing’.
>
> Well you're right, this is wrong and not needed. However the other patch
> on (guix gexp), titled "Use cross extensions when cross-compiling" seems
> needed.

Indeed, I’ve just replied.

Thanks, and once again, apologies for the delay!

Ludo’.
M
M
Mathieu Othacehe wrote on 14 Oct 2019 10:00
Re: [bug#36477] [PATCH v4 18/23] gexp: Use cross extensions when cross-compiling.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 36477@debbugs.gnu.org)
87sgnvdae4.fsf@gmail.com
Hey Ludo,

Toggle quote (3 lines)
> Please push to ‘master’ (I don’t think it triggers a full rebuild, but
> I’d suggest double-checking anyway :-)).

Pushed to master, thanks for the review :)

Mathieu
M
M
Mathieu Othacehe wrote on 18 Oct 2019 14:17
Re: [PATCH v4 00/23] System cross-compilation
(address . 36477@debbugs.gnu.org)
CANVeeZxpZ2gxKDsdiebBRkujS4vKXO0iNJSkqaO=zkqTgWh-Qw@mail.gmail.com
Hello,

Quick update on this serie. The gexp patch has been pushed to master.
Now, I would like to push this serie by the end of the month. The only
wobbly part is the patch 02, where I add a cmake-minimal-cross for
Any kind reviewer on this topic :) ?

Thanks,

Mathieu

Le mer. 2 oct. 2019 à 11:59, Mathieu Othacehe <m.othacehe@gmail.com> a écrit :
Toggle quote (75 lines)
>
> Hello,
>
> Here's a v4 of the serie. Since v3, half of the patches were pushed to
> core-update-next. Among the remaining patches, I could not find a better
> solution to cmake native-search-path issue.
>
> I also turned libl python2 and python3 outputs into separate libnl-python2 and
> libnl-python3 packages, so to avoid turning the output field into a thunked
> field.
>
> Thanks,
>
> Mathieu
>
> Mathieu Othacehe (21):
> gnu: openssl: Fix cross-compilation.
> gnu: cmake: Fix cross-compilation.
> gnu: groff: Fix cross compilation.
> gnu: cyrus-sasl: Fix cross-compilation.
> gnu: icu4c: Fix cross-compilation.
> gnu: boost: Fix cross-compilation.
> gnu: eudev: Fix cross-compilation.
> gnu: bdb: Fix cross-compilation.
> gnu: openldap: Fix cross-compilation.
> gnu: swig: Fix cross-compilation.
> gnu: git: Fix cross-compilation.
> gnu: doxygen: Fix cross-compilation.
> gnu: guile-gcrypt: Fix cross-compilation.
> gnu: guile-sqlite3: Fix cross-compilation.
> gnu: libnl: Move python outputs to separate packages.
> gexp: Use cross extensions when cross-compiling.
> utils: Use target-aarch64? and target-arm? helpers.
> build: vm: Fix arm32 support.
> system: vm: Add arm64 support.
> system: vm: Support cross-compilation.
> scripts: system: Add --target option.
>
> Pierre-Moana Levesque (2):
> gnu: crda: Fix cross-compilation
> gnu: cmake: Fix cross-compilation.
>
> gnu/build/vm.scm | 27 +++-
> gnu/local.mk | 3 +
> gnu/packages/boost.scm | 59 +++++--
> gnu/packages/cmake.scm | 14 +-
> gnu/packages/cyrus-sasl.scm | 17 +-
> gnu/packages/dbm.scm | 6 +-
> gnu/packages/documentation.scm | 12 +-
> gnu/packages/gnupg.scm | 18 ++-
> gnu/packages/groff.scm | 22 ++-
> gnu/packages/guile.scm | 7 +-
> gnu/packages/icu4c.scm | 35 +++-
> gnu/packages/linux.scm | 149 +++++++++++-------
> gnu/packages/openldap.scm | 38 ++++-
> gnu/packages/patches/boost-dumpversion.patch | 24 +++
> .../patches/cyrus-sasl-ac-try-run-fix.patch | 12 ++
> .../guile-sqlite3-fix-cross-compilation.patch | 55 +++++++
> gnu/packages/swig.scm | 1 +
> gnu/packages/tls.scm | 62 ++++++--
> gnu/packages/version-control.scm | 23 ++-
> gnu/system.scm | 15 +-
> gnu/system/vm.scm | 33 ++--
> guix/build-system/cmake.scm | 9 +-
> guix/gexp.scm | 4 +-
> guix/scripts/system.scm | 15 +-
> guix/utils.scm | 8 +
> 25 files changed, 535 insertions(+), 133 deletions(-)
> create mode 100644 gnu/packages/patches/boost-dumpversion.patch
> create mode 100644 gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
> create mode 100644 gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
>
> --
> 2.23.0
>
M
M
Mathieu Othacehe wrote on 15 Nov 2019 17:39
Closing guix system --target support
87k181ccwo.fsf@gmail.com
Hello,

I pushed the few remaining bits of the serie to core-updates, which
means that it should be possible to cross compile a guix system on that
branch.

There's still some work to do because some packages (and build-systems)
have broken or no cross-compilation support.

Mathieu
Closed
L
L
Ludovic Courtès wrote on 17 Nov 2019 21:45
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87tv72jkpx.fsf@gnu.org
Hi!

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

Toggle quote (4 lines)
> I pushed the few remaining bits of the serie to core-updates, which
> means that it should be possible to cross compile a guix system on that
> branch.

Awesome!

Toggle quote (3 lines)
> There's still some work to do because some packages (and build-systems)
> have broken or no cross-compilation support.

Yeah, let’s address them one-by-one.

Thanks for your work on this!

Ludo’.
Closed
?