[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#36477] [PATCH v2 32/61] gnu: boost: Fix cross-compilation.
From: |
Mathieu Othacehe |
Subject: |
[bug#36477] [PATCH v2 32/61] gnu: boost: Fix cross-compilation. |
Date: |
Wed, 21 Aug 2019 10:54:26 +0200 |
* 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
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 <address@hidden>
;;; Copyright © 2018 Maxim Cournoyer <address@hidden>
;;; Copyright © 2018 Efraim Flashner <address@hidden>
+;;; Copyright © 2019 Mathieu Othacehe <address@hidden>
;;;
;;; 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
- [bug#36477] [PATCH v2 35/61] gnu: nghttp2: Fix cross-compilation., (continued)
- [bug#36477] [PATCH v2 35/61] gnu: nghttp2: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 24/61] gnu: xmlto: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 18/61] gnu: bc: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 31/61] gnu: glibc-utf8-locales: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 33/61] gnu: eudev: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 34/61] gnu: lvm2: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 29/61] gnu: alsa-utils: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 37/61] gnu: swig: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 36/61] gnu: openldap: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 38/61] gnu: git: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 32/61] gnu: boost: Fix cross-compilation.,
Mathieu Othacehe <=
- [bug#36477] [PATCH v2 41/61] gnu: doxygen: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 39/61] gnu: make-linux-libre: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 42/61] gnu: guile-sqlite3: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 48/61] gnu: guile-xcb: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 40/61] gnu: procps: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 49/61] gnu: guile-wm: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 43/61] gnu: guile-gcrypt: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 44/61] gnu: libtool: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 50/61] gnu: cmake: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 52/61] gnu: mdadm: Fix cross-compilation., Mathieu Othacehe, 2019/08/21