From 2c2b9856f3b5af00d2d3c4c2c569ef830219c1bc Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Thu, 11 Nov 2021 19:19:18 +0100 Subject: [PATCH 1/2] gnu: Add boost-for-sourcetrail. * gnu/packages/boost.scm (boost-for-sourcetrail): New variable. * gnu/packages/patches/boost-fix-icu-build.patch: New file. * gnu/local.mk: Add patch. diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index 40e4ca399e..a3899d0419 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -303,6 +303,86 @@ (define-public boost-static (symlink libboost_pythonNN.a "libboost_python.a")) #t))))))))) +(define-public boost-for-sourcetrail + ;; Older version for Sourcetrail 1.1.30. + (package + (name "boost") + (version "1.67.0") + (source (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/boost/boost/" version "/boost_" + (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version) + ".tar.bz2")) + (sha256 + (base32 + "1fmdlmkzsrd46wwk834jsi2ypxj68w2by0rfcg2pzrafk5rck116")) + (patches (search-patches "boost-fix-icu-build.patch")))) + (build-system gnu-build-system) + (inputs `(("icu4c" ,icu4c) + ("zlib" ,zlib))) + (native-inputs + `(("perl" ,perl) + ("python" ,python-2) + ("tcsh" ,tcsh))) + (arguments + `(#:tests? #f + #:make-flags + (list "threading=multi" "link=shared" + + ;; Set the RUNPATH to $libdir so that the libs find each other. + (string-append "linkflags=-Wl,-rpath=" + (assoc-ref %outputs "out") "/lib") + + ;; Boost's 'context' library is not yet supported on mips64, so + ;; we disable it. The 'coroutine' library depends on 'context', + ;; so we disable that too. + ,@(if (string-prefix? "mips64" (or (%current-target-system) + (%current-system))) + '("--without-context" + "--without-coroutine" "--without-coroutine2") + '())) + #:phases + (modify-phases %standard-phases + (delete 'bootstrap) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((icu (assoc-ref inputs "icu4c")) + (out (assoc-ref outputs "out"))) + (substitute* '("libs/config/configure" + "libs/spirit/classic/phoenix/test/runtest.sh" + "tools/build/doc/bjam.qbk" + "tools/build/src/engine/execunix.c" + "tools/build/src/engine/Jambase" + "tools/build/src/engine/jambase.c") + (("/bin/sh") (which "sh"))) + + (setenv "SHELL" (which "sh")) + (setenv "CONFIG_SHELL" (which "sh")) + + (invoke "./bootstrap.sh" + (string-append "--prefix=" out) + ;; Auto-detection looks for ICU only in traditional + ;; install locations. + (string-append "--with-icu=" icu) + "--with-toolset=gcc")))) + (replace 'build + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "./b2" + (format #f "-j~a" (parallel-job-count)) + make-flags))) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "./b2" "install" make-flags)))))) + + (home-page "http://www.boost.org") + (synopsis "Peer-reviewed portable C++ source libraries") + (description + "A collection of libraries intended to be widely useful, and usable +across a broad spectrum of applications.") + (license (license:x11-style "http://www.boost.org/LICENSE_1_0.txt" + "Some components have other similar licences.")))) + (define-public boost-for-mysql ;; Older version for MySQL 5.7.23. (package diff --git a/gnu/packages/patches/boost-fix-icu-build.patch b/gnu/packages/patches/boost-fix-icu-build.patch new file mode 100644 index 0000000000..556f91b8f7 --- /dev/null +++ b/gnu/packages/patches/boost-fix-icu-build.patch @@ -0,0 +1,53 @@ +Pass -std=c++11 when compiling files that include the ICU headers. Without +this flag, compilation fails and causes Boost's build system to remove ICU +support. Note that $(pkg-config --variable=CXXFLAGS icu-uc) includes +"-std=c++11", but Boost's build system does not use 'pkg-config'. + +--- boost_1_66_0/libs/locale/build/Jamfile.v2.orig 2017-12-13 18:56:44.000000000 -0500 ++++ boost_1_66_0/libs/locale/build/Jamfile.v2 2018-04-08 15:18:58.673025760 -0400 +@@ -65,8 +65,8 @@ + + if $(ICU_LINK) + { +- ICU_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin shared ; +- ICU64_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin64 shared ; ++ ICU_OPTS = $(ICU_PATH)/include -std=c++11 $(ICU_LINK) $(ICU_PATH)/bin shared ; ++ ICU64_OPTS = $(ICU_PATH)/include -std=c++11 $(ICU_LINK) $(ICU_PATH)/bin64 shared ; + } + else + { +@@ -121,6 +121,7 @@ + explicit icuuc icudt icuin ; + + ICU_OPTS = $(ICU_PATH)/include ++ -std=c++11 + icuuc/shared/shared + icudt/shared/shared + icuin/shared/shared +@@ -180,6 +181,7 @@ + explicit icuuc_64 icudt_64 icuin_64 ; + + ICU64_OPTS = $(ICU_PATH)/include ++ -std=c++11 + icuuc_64/shared/shared + icudt_64/shared/shared + icuin_64/shared/shared +--- boost_1_66_0/libs/regex/build/Jamfile.v2.orig 2017-12-13 18:56:48.000000000 -0500 ++++ boost_1_66_0/libs/regex/build/Jamfile.v2 2018-04-08 15:20:40.865532505 -0400 +@@ -44,7 +44,7 @@ + + if $(ICU_LINK) + { +- ICU_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin BOOST_HAS_ICU=1 shared ; ++ ICU_OPTS = $(ICU_PATH)/include -std=c++11 $(ICU_LINK) $(ICU_PATH)/bin BOOST_HAS_ICU=1 shared ; + } + else + { +@@ -78,6 +78,7 @@ + + ICU_OPTS = + $(ICU_PATH)/include ++ -std=c++11 + shared:icuuc/shared + shared:icudt/shared + shared:icuin/shared -- 2.38.1