From f68287afe97623b0a0e09c8625fcb79148b64f33 Mon Sep 17 00:00:00 2001 From: ketsubouchi Date: Tue, 20 Oct 2020 22:39:57 +0900 Subject: [PATCH] boost: fix building old versions with non-system glib and bzip2 (#19389) --- .../builtin/packages/boost/boost_154.patch | 31 +++++++++++++++++++ .../repos/builtin/packages/boost/package.py | 4 +++ 2 files changed, 35 insertions(+) create mode 100644 var/spack/repos/builtin/packages/boost/boost_154.patch diff --git a/var/spack/repos/builtin/packages/boost/boost_154.patch b/var/spack/repos/builtin/packages/boost/boost_154.patch new file mode 100644 index 0000000000..76e7fb2d6a --- /dev/null +++ b/var/spack/repos/builtin/packages/boost/boost_154.patch @@ -0,0 +1,31 @@ +--- a/tools/build/src/build/ac.jam ++++ b/tools/build/src/build/ac.jam +@@ -76,14 +76,6 @@ rule construct-library ( name : property-set : provided-path ? ) + rule find-library ( properties : names + : provided-path ? ) + { + local result ; +- if ! $(.main.cpp) +- { +- local a = [ class.new action : ac.generate-main : +- [ property-set.empty ] ] ; +- .main.cpp = [ virtual-target.register +- [ class.new file-target main.cpp exact +- : CPP : $(.project) : $(a) ] ] ; +- } + if [ $(properties).get ] = shared + { + link-opts = shared static ; +@@ -100,8 +92,12 @@ rule find-library ( properties : names + : provided-path ? ) + { + local name = $(names-iter[1]) ; + local lib = [ construct-library $(name) : $(properties) : $(provided-path) ] ; ++ local a = [ class.new action : ac.generate-main : ++ [ property-set.empty ] ] ; ++ local main.cpp = [ virtual-target.register ++ [ class.new file-target main-$(name).cpp exact : CPP : $(.project) : $(a) ] ] ; + local test = [ generators.construct $(.project) $(name) : EXE +- : [ $(properties).add $(lib[1]) ] : $(.main.cpp) $(lib[2-]) ++ : [ $(properties).add $(lib[1]) ] : $(main.cpp) $(lib[2-]) + : true ] ; + local jam-targets ; + for t in $(test[2-]) diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index 0715c90803..a9fd437b51 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -248,6 +248,10 @@ def libs(self): sha256='246508e052c44b6f4e8c2542a71c06cacaa72cd1447ab8d2a542b987bc35ace9', when='@1.73.0') + # Support bzip2 and gzip in other directory + # See https://github.com/boostorg/build/pull/154 + patch('boost_154.patch', when='@:1.63.99') + def url_for_version(self, version): if version >= Version('1.63.0'): url = "https://dl.bintray.com/boostorg/release/{0}/source/boost_{1}.tar.bz2"