mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
gnu: boost: Fix cross-compilation.
* 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.
This commit is contained in:
parent
63eb30c191
commit
a4c04bee7b
3 changed files with 71 additions and 13 deletions
|
@ -720,6 +720,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/binutils-loongson-workaround.patch \
|
%D%/packages/patches/binutils-loongson-workaround.patch \
|
||||||
%D%/packages/patches/blender-2.79-newer-ffmpeg.patch \
|
%D%/packages/patches/blender-2.79-newer-ffmpeg.patch \
|
||||||
%D%/packages/patches/blender-2.79-python-3.7-fix.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/byobu-writable-status.patch \
|
||||||
%D%/packages/patches/calibre-no-updates-dialog.patch \
|
%D%/packages/patches/calibre-no-updates-dialog.patch \
|
||||||
%D%/packages/patches/calibre-remove-test-bs4.patch \
|
%D%/packages/patches/calibre-remove-test-bs4.patch \
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
|
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
|
||||||
;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||||
|
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -54,6 +55,8 @@ (define-public boost
|
||||||
(string-append "https://dl.bintray.com/boostorg/release/"
|
(string-append "https://dl.bintray.com/boostorg/release/"
|
||||||
version "/source/boost_"
|
version "/source/boost_"
|
||||||
version-with-underscores ".tar.bz2"))))
|
version-with-underscores ".tar.bz2"))))
|
||||||
|
(patches
|
||||||
|
(search-patches "boost-dumpversion.patch"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3"))))
|
"0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3"))))
|
||||||
|
@ -62,7 +65,9 @@ (define-public boost
|
||||||
("zlib" ,zlib)))
|
("zlib" ,zlib)))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("perl" ,perl)
|
`(("perl" ,perl)
|
||||||
("python" ,python-2)
|
,@(if (%current-target-system)
|
||||||
|
'()
|
||||||
|
`(("python" ,python-2)))
|
||||||
("tcsh" ,tcsh)))
|
("tcsh" ,tcsh)))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #f
|
`(#:tests? #f
|
||||||
|
@ -76,7 +81,24 @@ (define-public boost
|
||||||
|
|
||||||
;; Set the RUNPATH to $libdir so that the libs find each other.
|
;; Set the RUNPATH to $libdir so that the libs find each other.
|
||||||
(string-append "linkflags=-Wl,-rpath="
|
(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
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(delete 'bootstrap)
|
(delete 'bootstrap)
|
||||||
|
@ -94,6 +116,14 @@ (define-public boost
|
||||||
(setenv "SHELL" (which "sh"))
|
(setenv "SHELL" (which "sh"))
|
||||||
(setenv "CONFIG_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"
|
(invoke "./bootstrap.sh"
|
||||||
(string-append "--prefix=" out)
|
(string-append "--prefix=" out)
|
||||||
;; Auto-detection looks for ICU only in traditional
|
;; Auto-detection looks for ICU only in traditional
|
||||||
|
@ -108,17 +138,20 @@ (define-public boost
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key make-flags #:allow-other-keys)
|
(lambda* (#:key make-flags #:allow-other-keys)
|
||||||
(apply invoke "./b2" "install" make-flags)))
|
(apply invoke "./b2" "install" make-flags)))
|
||||||
(add-after 'install 'provide-libboost_python
|
,@(if (%current-target-system)
|
||||||
|
'()
|
||||||
|
'((add-after 'install 'provide-libboost_python
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(let ((out (assoc-ref outputs "out")))
|
||||||
;; Boost can build support for both Python 2 and Python 3 since
|
;; Boost can build support for both Python 2 and
|
||||||
;; version 1.67.0, and suffixes each library with the Python
|
;; Python 3 since version 1.67.0, and suffixes each
|
||||||
;; version. Many consumers only check for libboost_python
|
;; library with the Python version. Many consumers
|
||||||
;; however, so we provide it here as suggested in
|
;; only check for libboost_python however, so we
|
||||||
|
;; provide it here as suggested in
|
||||||
;; <https://github.com/boostorg/python/issues/203>.
|
;; <https://github.com/boostorg/python/issues/203>.
|
||||||
(with-directory-excursion (string-append out "/lib")
|
(with-directory-excursion (string-append out "/lib")
|
||||||
(symlink "libboost_python27.so" "libboost_python.so"))
|
(symlink "libboost_python27.so" "libboost_python.so"))
|
||||||
#t))))))
|
#t))))))))
|
||||||
|
|
||||||
(home-page "https://www.boost.org")
|
(home-page "https://www.boost.org")
|
||||||
(synopsis "Peer-reviewed portable C++ source libraries")
|
(synopsis "Peer-reviewed portable C++ source libraries")
|
||||||
|
|
24
gnu/packages/patches/boost-dumpversion.patch
Normal file
24
gnu/packages/patches/boost-dumpversion.patch
Normal file
|
@ -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.
|
Loading…
Reference in a new issue