diff --git a/0001-Minimal-compatibility-with-C-17.patch b/0001-Minimal-compatibility-with-C-17.patch new file mode 100644 index 0000000..923db81 --- /dev/null +++ b/0001-Minimal-compatibility-with-C-17.patch @@ -0,0 +1,134 @@ +From dc96dcab3f4c414e87384daed329ff726d669ab0 Mon Sep 17 00:00:00 2001 +From: Mikhail Novosyolov +Date: Wed, 1 Apr 2020 08:01:56 +0300 +Subject: [PATCH 1/2] Minimal compatibility with C++17 + +C++17 removed std::bind*nd and LLVM libc++ removed them without a way to force backwards compatibility. + +Based on patch from Daniel Arndt +https://github.com/dealii/dealii/pull/6126/commits/01fba74717d2b8c896317f1a6ad1894fb03d67a0 + +Note: std:auto_ptr currently can be reenabled in libc++: +https://libcxx.llvm.org/docs/UsingLibcxx.html#c-17-specific-configuration-macros + +Signed-off-by: Mikhail Novosyolov +--- + boost/container/string.hpp | 22 +++++++++++++++++++ + .../distributed/detail/mpi_process_group.ipp | 4 ++++ + boost/random/uniform_on_sphere.hpp | 2 +- + .../core/non_terminal/impl/grammar.ipp | 2 +- + 4 files changed, 28 insertions(+), 2 deletions(-) + +diff --git a/boost/container/string.hpp b/boost/container/string.hpp +index 33f5f661..22d59e4d 100644 +--- a/boost/container/string.hpp ++++ b/boost/container/string.hpp +@@ -528,7 +528,11 @@ class basic_string + bool operator()(const typename Tr::char_type& x) const + { + return std::find_if(m_first, m_last, ++ #if __cplusplus < 201703L + std::bind1st(Eq_traits(), x)) == m_last; ++ #else ++ [](const argument_type &ch) {return Eq_traits(x, ch)}) == m_last; ++ #endif + } + }; + #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED +@@ -2109,7 +2113,11 @@ class basic_string + pointer finish = addr + sz; + const const_iterator result = + std::find_if(addr + pos, finish, ++ #if __cplusplus < 201703L + std::bind2nd(Eq_traits(), c)); ++ #else ++ [](const argument_type &ch) {return Eq_traits(ch, c)}); ++ #endif + return result != finish ? result - begin() : npos; + } + } +@@ -2169,7 +2177,11 @@ class basic_string + const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1; + const_reverse_iterator rresult = + std::find_if(const_reverse_iterator(last), rend(), ++ #if __cplusplus < 201703L + std::bind2nd(Eq_traits(), c)); ++ #else ++ [](const argument_type &ch) {return Eq_traits(ch, c)}); ++ #endif + return rresult != rend() ? (rresult.base() - 1) - begin() : npos; + } + } +@@ -2312,8 +2324,13 @@ class basic_string + const pointer addr = this->priv_addr(); + const pointer finish = addr + this->priv_size(); + const const_iterator result ++ #if __cplusplus < 201703L + = std::find_if(addr + pos, finish, + std::not1(std::bind2nd(Eq_traits(), c))); ++ #else ++ = std::find_if_not(addr + pos, finish, ++ [](const argument_type &ch) {return Eq_traits(ch, c)}); ++ #endif + return result != finish ? result - begin() : npos; + } + } +@@ -2368,8 +2385,13 @@ class basic_string + else { + const const_iterator last = begin() + container_detail::min_value(len - 1, pos) + 1; + const const_reverse_iterator rresult = ++ #if __cplusplus < 201703L + std::find_if(const_reverse_iterator(last), rend(), + std::not1(std::bind2nd(Eq_traits(), c))); ++ #else ++ std::find_if_not(const_reverse_iterator(last), rend(), ++ [](const argument_type &ch) {return Eq_traits(ch, c)}); ++ #endif + return rresult != rend() ? (rresult.base() - 1) - begin() : npos; + } + } +diff --git a/boost/graph/distributed/detail/mpi_process_group.ipp b/boost/graph/distributed/detail/mpi_process_group.ipp +index a4d35462..02058b00 100644 +--- a/boost/graph/distributed/detail/mpi_process_group.ipp ++++ b/boost/graph/distributed/detail/mpi_process_group.ipp +@@ -841,7 +841,11 @@ all_gather(const mpi_process_group& pg, InputIterator first, + + // Adjust sizes based on the number of bytes + std::transform(sizes.begin(), sizes.end(), sizes.begin(), ++ #if __cplusplus < 201703L + std::bind2nd(std::multiplies(), sizeof(T))); ++ #else ++ [](const int& size){return std::multiplies(size, sizeof(T))}); ++ #endif + + // Compute displacements + std::vector displacements; +diff --git a/boost/random/uniform_on_sphere.hpp b/boost/random/uniform_on_sphere.hpp +index 72c25ef7..d5037352 100644 +--- a/boost/random/uniform_on_sphere.hpp ++++ b/boost/random/uniform_on_sphere.hpp +@@ -19,7 +19,7 @@ + + #include + #include // std::transform +-#include // std::bind2nd, std::divides ++#include // std::divides + #include + #include + #include +diff --git a/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp b/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp +index 002d221e..cdb01862 100644 +--- a/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp ++++ b/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp +@@ -286,7 +286,7 @@ struct grammar_definition + helper_list_t& helpers = + grammartract_helper_list::do_(self); + +-# if defined(BOOST_INTEL_CXX_VERSION) ++# if (defined(BOOST_INTEL_CXX_VERSION) || (__cplusplus >= 201703L)) + typedef typename helper_list_t::vector_t::reverse_iterator iterator_t; + + for (iterator_t i = helpers.rbegin(); i != helpers.rend(); ++i) +-- +2.20.1 + diff --git a/0002-Avoid-auto_ptr-in-bundled-boost.patch b/0002-Avoid-auto_ptr-in-bundled-boost.patch new file mode 100644 index 0000000..e3b1a78 --- /dev/null +++ b/0002-Avoid-auto_ptr-in-bundled-boost.patch @@ -0,0 +1,233 @@ +From f41f9f61150eea670aa9a0351a310ff41e94c0a6 Mon Sep 17 00:00:00 2001 +From: Daniel Arndt +Date: Fri, 30 Mar 2018 12:54:48 +0200 +Subject: [PATCH 2/2] Avoid auto_ptr in bundled boost + +[ mikhailnov@ROSA: + changed "#if defined(BOOST_NO_CXX11_SMART_PTR)" to "#if __cplusplus < 201703L" +] +Source: https://github.com/dealii/dealii/pull/6126/commits/92b86577ed847ce8dd3eaf7820bda86bdd925e73 + +This patch is not mandantory as GNU libstdc++ is backwards compatible by default, +and LLVM libc++ can be forced to be compatible with std::auto_ptr: +https://libcxx.llvm.org/docs/UsingLibcxx.html#c-17-specific-configuration-macros + +Signed-off-by: Mikhail Novosyolov +--- + boost/date_time/gregorian/greg_facet.hpp | 8 ++++++++ + boost/detail/lightweight_thread.hpp | 12 ++++++++++++ + boost/graph/detail/adjacency_list.hpp | 4 ++++ + boost/iostreams/chain.hpp | 5 +++++ + boost/random/uniform_on_sphere.hpp | 8 ++++++-- + .../home/classic/core/non_terminal/impl/grammar.ipp | 5 +++++ + boost/spirit/home/classic/symbols/impl/tst.ipp | 8 ++++++++ + .../spirit/home/support/detail/lexer/generator.hpp | 13 +++++++++++++ + 8 files changed, 61 insertions(+), 2 deletions(-) + +diff --git a/boost/date_time/gregorian/greg_facet.hpp b/boost/date_time/gregorian/greg_facet.hpp +index b8c6d57f..2343cb95 100644 +--- a/boost/date_time/gregorian/greg_facet.hpp ++++ b/boost/date_time/gregorian/greg_facet.hpp +@@ -290,7 +290,11 @@ namespace gregorian { + * names as a default. */ + catch(std::bad_cast&){ + charT a = '\0'; ++#if __cplusplus < 201703L + std::auto_ptr< const facet_def > f(create_facet_def(a)); ++#else ++ std::unique_ptr< const facet_def > f(create_facet_def(a)); ++#endif + num = date_time::find_match(f->get_short_month_names(), + f->get_long_month_names(), + (greg_month::max)(), s); // greg_month spans 1..12, so max returns the array size, +@@ -332,7 +336,11 @@ namespace gregorian { + * names as a default. */ + catch(std::bad_cast&){ + charT a = '\0'; ++#if __cplusplus < 201703L + std::auto_ptr< const facet_def > f(create_facet_def(a)); ++#else ++ std::unique_ptr< const facet_def > f(create_facet_def(a)); ++#endif + num = date_time::find_match(f->get_short_weekday_names(), + f->get_long_weekday_names(), + (greg_weekday::max)() + 1, s); // greg_weekday spans 0..6, so increment is needed +diff --git a/boost/detail/lightweight_thread.hpp b/boost/detail/lightweight_thread.hpp +index 6fe70a61..f46568c1 100644 +--- a/boost/detail/lightweight_thread.hpp ++++ b/boost/detail/lightweight_thread.hpp +@@ -77,7 +77,11 @@ public: + + extern "C" void * lw_thread_routine( void * pv ) + { ++#if __cplusplus < 201703L + std::auto_ptr pt( static_cast( pv ) ); ++#else ++ std::unique_ptr pt( static_cast( pv ) ); ++#endif + + pt->run(); + +@@ -88,7 +92,11 @@ extern "C" void * lw_thread_routine( void * pv ) + + unsigned __stdcall lw_thread_routine( void * pv ) + { ++#if __cplusplus < 201703L + std::auto_ptr pt( static_cast( pv ) ); ++#else ++ std::unique_ptr pt( static_cast( pv ) ); ++#endif + + pt->run(); + +@@ -117,7 +125,11 @@ private: + + template int lw_thread_create( pthread_t & pt, F f ) + { ++#if __cplusplus < 201703L + std::auto_ptr p( new lw_thread_impl( f ) ); ++#else ++ std::unique_ptr p( new lw_thread_impl( f ) ); ++#endif + + int r = pthread_create( &pt, 0, lw_thread_routine, p.get() ); + +diff --git a/boost/graph/detail/adjacency_list.hpp b/boost/graph/detail/adjacency_list.hpp +index 1145d88d..8a33c411 100644 +--- a/boost/graph/detail/adjacency_list.hpp ++++ b/boost/graph/detail/adjacency_list.hpp +@@ -283,7 +283,11 @@ namespace boost { + // invalidation for add_edge() with EdgeList=vecS. Instead we + // hold a pointer to the property. std::auto_ptr is not + // a perfect fit for the job, but it is darn close. ++#if __cplusplus < 201703L + std::auto_ptr m_property; ++#else ++ std::unique_ptr m_property; ++#endif + }; + #else + template +diff --git a/boost/iostreams/chain.hpp b/boost/iostreams/chain.hpp +index 4af8cc98..8d9edeea 100644 +--- a/boost/iostreams/chain.hpp ++++ b/boost/iostreams/chain.hpp +@@ -253,8 +253,13 @@ private: + pback_size != -1 ? + pback_size : + pimpl_->pback_size_; ++#if __cplusplus < 201703L + std::auto_ptr + buf(new streambuf_t(t, buffer_size, pback_size)); ++#else ++ std::unique_ptr ++ buf(new streambuf_t(t, buffer_size, pback_size)); ++#endif + list().push_back(buf.get()); + buf.release(); + if (is_device::value) { +diff --git a/boost/random/uniform_on_sphere.hpp b/boost/random/uniform_on_sphere.hpp +index d5037352..cad1a777 100644 +--- a/boost/random/uniform_on_sphere.hpp ++++ b/boost/random/uniform_on_sphere.hpp +@@ -225,8 +225,12 @@ public: + } + } while(sqsum == 0); + // for all i: result[i] /= sqrt(sqsum) +- std::transform(_container.begin(), _container.end(), _container.begin(), +- std::bind2nd(std::multiplies(), 1/sqrt(sqsum))); ++ RealType inverse_distance = 1 / sqrt(sqsum); ++ for(typename Cont::iterator it = _container.begin(); ++ it != _container.end(); ++ ++it) { ++ *it *= inverse_distance; ++ } + } + } + return _container; +diff --git a/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp b/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp +index cdb01862..33991c57 100644 +--- a/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp ++++ b/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp +@@ -156,8 +156,13 @@ struct grammar_definition + if (definitions[id]!=0) + return *definitions[id]; + ++#if __cplusplus < 201703L + std::auto_ptr + result(new definition_t(target_grammar->derived())); ++#else ++ std::unique_ptr ++ result(new definition_t(target_grammar->derived())); ++#endif + + #ifdef BOOST_SPIRIT_THREADSAFE + boost::unique_lock lock(helpers.mutex()); +diff --git a/boost/spirit/home/classic/symbols/impl/tst.ipp b/boost/spirit/home/classic/symbols/impl/tst.ipp +index 1a4a0c10..6e68e4b9 100644 +--- a/boost/spirit/home/classic/symbols/impl/tst.ipp ++++ b/boost/spirit/home/classic/symbols/impl/tst.ipp +@@ -62,7 +62,11 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + tst_node* + clone() const + { ++#if __cplusplus < 201703L + std::auto_ptr copy(new tst_node(value)); ++#else ++ std::unique_ptr copy(new tst_node(value)); ++#endif + + if (left) + copy->left = left->clone(); +@@ -75,7 +79,11 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + } + else + { ++#if __cplusplus < 201703L + std::auto_ptr mid_data(new T(*middle.data)); ++#else ++ std::unique_ptr mid_data(new T(*middle.data)); ++#endif + copy->middle.data = mid_data.release(); + } + +diff --git a/boost/spirit/home/support/detail/lexer/generator.hpp b/boost/spirit/home/support/detail/lexer/generator.hpp +index daa06e79..347aa203 100644 +--- a/boost/spirit/home/support/detail/lexer/generator.hpp ++++ b/boost/spirit/home/support/detail/lexer/generator.hpp +@@ -116,10 +116,18 @@ public: + protected: + typedef detail::basic_charset charset; + typedef detail::ptr_list charset_list; ++#if __cplusplus < 201703L + typedef std::auto_ptr charset_ptr; ++#else ++ typedef std::unique_ptr charset_ptr; ++#endif + typedef detail::equivset equivset; + typedef detail::ptr_list equivset_list; ++#if __cplusplus < 201703L + typedef std::auto_ptr equivset_ptr; ++#else ++ typedef std::unique_ptr equivset_ptr; ++#endif + typedef typename charset::index_set index_set; + typedef std::vector index_set_vector; + typedef detail::basic_parser parser; +@@ -377,8 +385,13 @@ protected: + if (followpos_->empty ()) return npos; + + std::size_t index_ = 0; ++#if __cplusplus < 201703L + std::auto_ptr set_ptr_ (new node_set); + std::auto_ptr vector_ptr_ (new node_vector); ++#else ++ std::unique_ptr set_ptr_ (new node_set); ++ std::unique_ptr vector_ptr_ (new node_vector); ++#endif + + for (typename detail::node::node_vector::const_iterator iter_ = + followpos_->begin (), end_ = followpos_->end (); +-- +2.20.1 + diff --git a/boost.spec b/boost.spec index 4a35bb4..cc5baf5 100644 --- a/boost.spec +++ b/boost.spec @@ -52,7 +52,7 @@ Summary: Portable C++ libraries Name: boost Version: 1.61.0 -Release: 6 +Release: 7 License: Boost Group: Development/C++ Url: http://boost.org/ @@ -79,6 +79,12 @@ Patch12: boost-1.50.0-polygon.patch # https://bugzilla.redhat.com/show_bug.cgi?id=828856 # https://bugzilla.redhat.com/show_bug.cgi?id=828857 Patch15: boost-1.61.0-pool.patch +# From https://github.com/dealii/dealii/pull/6126 +# To use this old boost with libc++ from LLVM +# (e.g. to build LibreOffice 6.x in rosa2016.1 where libstdc++ +# is too old and does not support C++17) +Patch16: 0001-Minimal-compatibility-with-C-17.patch +Patch17: 0002-Avoid-auto_ptr-in-bundled-boost.patch BuildRequires: doxygen BuildRequires: xsltproc BuildRequires: bzip2-devel @@ -840,6 +846,8 @@ symlinks needed for Boost development. %patch10 -p1 %patch12 -p3 %patch15 -p0 +%patch16 -p1 +%patch17 -p1 # Preparing the docs mkdir packagedoc