sci-libs/libgeodecomp: Fix boost detection
authorKurt Kanzenbach <kurt@kmk-computers.de>
Sun, 8 Mar 2020 11:33:31 +0000 (12:33 +0100)
committerJoonas Niilola <juippis@gentoo.org>
Sun, 15 Mar 2020 17:51:49 +0000 (19:51 +0200)
When hpx is installed libgeodecomp tries to use the boost libraries detected by
hpx. That doesn't work, because the wrong variables are referenced and hpx uses
fewer boost libraries than libgeodecomp.

So remove that and use the system boost libraries in all cases.

Closes: https://bugs.gentoo.org/686294
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
Closes: https://github.com/gentoo/gentoo/pull/14855
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
sci-libs/libgeodecomp/files/libgeodecomp-0.4.0-boost.patch [new file with mode: 0644]
sci-libs/libgeodecomp/libgeodecomp-0.4.0-r1.ebuild

diff --git a/sci-libs/libgeodecomp/files/libgeodecomp-0.4.0-boost.patch b/sci-libs/libgeodecomp/files/libgeodecomp-0.4.0-boost.patch
new file mode 100644 (file)
index 0000000..d706950
--- /dev/null
@@ -0,0 +1,92 @@
+From f964fc68b745cc200a1df9e442a2dd8e908f0248 Mon Sep 17 00:00:00 2001
+From: Kurt Kanzenbach <kurt@kmk-computers.de>
+Date: Sun, 8 Mar 2020 10:53:53 +0100
+Subject: [PATCH] cmake: Disable use of HPX boost libraries
+
+First of all the wrong variables are referenced. Second HPX doesn't include
+date_time which is needed by the tracing writer. So that does not work.
+
+Use the system boost libraries.
+
+Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
+---
+ src/CMakeLists.txt | 60 +++++++++++++++++-----------------------------
+ 1 file changed, 22 insertions(+), 38 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 2870446108d0..f1a15abb0161 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -2,47 +2,31 @@
+ find_package(HPX)
+-if(NOT HPX_FOUND)
+-  if(NOT DEFINED BOOST_ROOT)
+-    # deduce Boost location from environment (e.g. on woody.rrze.uni-erlangen.de)
+-    set(BOOST_ENV_LIBDIR "$ENV{BOOST_LIBDIR}")
+-    if(BOOST_ENV_LIBDIR)
+-      set(Boost_NO_SYSTEM_PATHS true)
+-      set(BOOST_ROOT "$ENV{BOOST_LIBDIR}/../")
+-      set(Boost_LIBRARY_DIRS "$ENV{BOOST_LIBDIR}")
+-      set(Boost_INCLUDE_DIR  "$ENV{BOOST_INCDIR}")
+-    endif()
++if(NOT DEFINED BOOST_ROOT)
++  # deduce Boost location from environment (e.g. on woody.rrze.uni-erlangen.de)
++  set(BOOST_ENV_LIBDIR "$ENV{BOOST_LIBDIR}")
++  if(BOOST_ENV_LIBDIR)
++    set(Boost_NO_SYSTEM_PATHS true)
++    set(BOOST_ROOT "$ENV{BOOST_LIBDIR}/../")
++    set(Boost_LIBRARY_DIRS "$ENV{BOOST_LIBDIR}")
++    set(Boost_INCLUDE_DIR  "$ENV{BOOST_INCDIR}")
+   endif()
+-
+-  # mandatory Boost libs go into the first line, optional ones into
+-  # their own call. This avoids leaving out any available lib during
+-  # link time. The reason for this ugly multi-stage discovery is the
+-  # following: since CMAKE 2.8.11 each call to find_package(Boost...)
+-  # will reset Boost_LIBRARIES.
+-  find_package(Boost REQUIRED COMPONENTS date_time filesystem system)
+-  set(ALL_BOOST_LIBS "${Boost_LIBRARIES}")
+-  find_package(Boost COMPONENTS serialization)
+-  set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
+-  find_package(Boost COMPONENTS thread)
+-  set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
+-  find_package(Boost COMPONENTS move)
+-  set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
+-else()
+-  # If HPX was found, we use the Boost libraries found by HPX
+-  set(ALL_BOOST_LIBS
+-    ${HPX_BOOST_DATE_TIME_LIBRARY}
+-    ${HPX_BOOST_FILESYSTEM_LIBRARY}
+-    ${HPX_BOOST_SYSTEM_LIBRARY}
+-    ${HPX_BOOST_SERIALIZATION_LIBRARY}
+-    ${HPX_BOOST_THREAD_LIBRARY}
+-  )
+-  set(Boost_DATE_TIME_FOUND true)
+-  set(Boost_FILESYSTEM_FOUND true)
+-  set(Boost_SYSTEM_FOUND true)
+-  set(Boost_SERIALIZATION_FOUND true)
+-  set(Boost_THREAD_FOUND true)
+ endif()
++# mandatory Boost libs go into the first line, optional ones into
++# their own call. This avoids leaving out any available lib during
++# link time. The reason for this ugly multi-stage discovery is the
++# following: since CMAKE 2.8.11 each call to find_package(Boost...)
++# will reset Boost_LIBRARIES.
++find_package(Boost REQUIRED COMPONENTS date_time filesystem system)
++set(ALL_BOOST_LIBS "${Boost_LIBRARIES}")
++find_package(Boost COMPONENTS serialization)
++set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
++find_package(Boost COMPONENTS thread)
++set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
++find_package(Boost COMPONENTS move)
++set(ALL_BOOST_LIBS "${ALL_BOOST_LIBS};${Boost_LIBRARIES}")
++
+ find_package(Boost COMPONENTS mpi)
+ set(Boost_MPI_LIBRARIES "${Boost_LIBRARIES}")
+-- 
+2.24.1
+
index d2867f448c3a9a4911c5867cc59a1ebafde36115..d1c5b322934170713659de6583645fe484b58fdf 100644 (file)
@@ -37,6 +37,7 @@ PATCHES=(
        "${FILESDIR}/${P}-scotch.patch"
        "${FILESDIR}/${P}-libdir.patch"
        "${FILESDIR}/${P}-lfa.patch"
+       "${FILESDIR}/${P}-boost.patch"
 )
 
 src_prepare() {