1 |
commit: 95cae20e05d591fbb744f6e4921e46f996811b40 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 8 05:05:57 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 8 05:06:05 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95cae20e |
7 |
|
8 |
sci-libs/symengine: fix pthread detection |
9 |
|
10 |
Closes: https://bugs.gentoo.org/849803 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../files/symengine-0.9.0-pthread-cmake.patch | 63 ++++++++++++++++++++++ |
14 |
...gine-0.9.0.ebuild => symengine-0.9.0-r1.ebuild} | 3 +- |
15 |
sci-libs/symengine/symengine-0.9.0.ebuild | 1 + |
16 |
3 files changed, 66 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/sci-libs/symengine/files/symengine-0.9.0-pthread-cmake.patch b/sci-libs/symengine/files/symengine-0.9.0-pthread-cmake.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..0fa049dbf218 |
21 |
--- /dev/null |
22 |
+++ b/sci-libs/symengine/files/symengine-0.9.0-pthread-cmake.patch |
23 |
@@ -0,0 +1,63 @@ |
24 |
+From 6ad9620ffc578abdb920b84ea5e393c726389ac0 Mon Sep 17 00:00:00 2001 |
25 |
+From: Sam James <sam@g.o> |
26 |
+Date: Wed, 8 Jun 2022 06:02:25 +0100 |
27 |
+Subject: [PATCH] cmake: fix pthread detection |
28 |
+ |
29 |
+The homebrew FindPTHREAD.cmake module was hardcoding the path to libpthread |
30 |
+in the installed CMake config file which broke consumers when upgrading from |
31 |
+< glibc-2.34 (e.g. glibc-2.33 -> glibc-2.34). |
32 |
+ |
33 |
+CMake provides FindThreads which does the job fine for us. Tested with both |
34 |
+glibc-2.33 (with a previously bad generated file, and then fixed) and glibc-2.35. |
35 |
+ |
36 |
+This should be fine on musl and friends too. This brings symengine in line |
37 |
+with most CMake packages. |
38 |
+ |
39 |
+Bug: https://bugs.gentoo.org/849803 |
40 |
+Fixes: https://github.com/symengine/symengine/issues/1910 |
41 |
+--- a/CMakeLists.txt |
42 |
++++ b/CMakeLists.txt |
43 |
+@@ -335,11 +335,10 @@ if (WITH_PIRANHA) |
44 |
+ endif() |
45 |
+ |
46 |
+ if (WITH_PTHREAD) |
47 |
+- find_package(PTHREAD REQUIRED) |
48 |
+- include_directories(SYSTEM ${PTHREAD_INCLUDE_DIRS}) |
49 |
+- set(LIBS ${LIBS} ${PTHREAD_TARGETS}) |
50 |
++ find_package(Threads) |
51 |
++ set(THREADS_PREFER_PTHREAD_FLAG ON) |
52 |
++ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT}) |
53 |
+ set(HAVE_SYMENGINE_PTHREAD yes) |
54 |
+- set(PKGS ${PKGS} "PTHREAD") |
55 |
+ endif() |
56 |
+ |
57 |
+ if (WITH_MPFR) |
58 |
+@@ -761,10 +760,6 @@ if (WITH_BOOST) |
59 |
+ endif() |
60 |
+ |
61 |
+ message("WITH_PTHREAD: ${WITH_PTHREAD}") |
62 |
+-if (WITH_PTHREAD) |
63 |
+- message("PTHREAD_INCLUDE_DIRS: ${PTHREAD_INCLUDE_DIRS}") |
64 |
+- message("PTHREAD_LIBRARIES: ${PTHREAD_LIBRARIES}") |
65 |
+-endif() |
66 |
+ |
67 |
+ message("WITH_MPC: ${WITH_MPC}") |
68 |
+ if (WITH_MPC) |
69 |
+--- a/cmake/FindPTHREAD.cmake |
70 |
++++ /dev/null |
71 |
+@@ -1,14 +0,0 @@ |
72 |
+-include(LibFindMacros) |
73 |
+- |
74 |
+-libfind_include(pthread.h pthread) |
75 |
+-libfind_library(pthread pthread) |
76 |
+- |
77 |
+-set(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}) |
78 |
+-set(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR}) |
79 |
+-set(PTHREAD_TARGETS pthread) |
80 |
+- |
81 |
+-include(FindPackageHandleStandardArgs) |
82 |
+-find_package_handle_standard_args(PTHREAD DEFAULT_MSG PTHREAD_LIBRARIES |
83 |
+- PTHREAD_INCLUDE_DIRS) |
84 |
+- |
85 |
+-mark_as_advanced(PTHREAD_INCLUDE_DIR PTHEARD_LIBRARY) |
86 |
+ |
87 |
|
88 |
diff --git a/sci-libs/symengine/symengine-0.9.0.ebuild b/sci-libs/symengine/symengine-0.9.0-r1.ebuild |
89 |
similarity index 96% |
90 |
copy from sci-libs/symengine/symengine-0.9.0.ebuild |
91 |
copy to sci-libs/symengine/symengine-0.9.0-r1.ebuild |
92 |
index bf374c6ddaca..d0cb975cca8a 100644 |
93 |
--- a/sci-libs/symengine/symengine-0.9.0.ebuild |
94 |
+++ b/sci-libs/symengine/symengine-0.9.0-r1.ebuild |
95 |
@@ -31,7 +31,8 @@ DEPEND="${RDEPEND} |
96 |
BDEPEND="doc? ( app-doc/doxygen[dot] )" |
97 |
|
98 |
PATCHES=( |
99 |
- "${FILESDIR}/${PN}-0.7.0-cmake-build-type.patch" |
100 |
+ "${FILESDIR}"/${PN}-0.7.0-cmake-build-type.patch |
101 |
+ "${FILESDIR}"/${PN}-0.9.0-pthread-cmake.patch |
102 |
) |
103 |
|
104 |
pkg_pretend() { |
105 |
|
106 |
diff --git a/sci-libs/symengine/symengine-0.9.0.ebuild b/sci-libs/symengine/symengine-0.9.0.ebuild |
107 |
index bf374c6ddaca..98e672759860 100644 |
108 |
--- a/sci-libs/symengine/symengine-0.9.0.ebuild |
109 |
+++ b/sci-libs/symengine/symengine-0.9.0.ebuild |
110 |
@@ -32,6 +32,7 @@ BDEPEND="doc? ( app-doc/doxygen[dot] )" |
111 |
|
112 |
PATCHES=( |
113 |
"${FILESDIR}/${PN}-0.7.0-cmake-build-type.patch" |
114 |
+ "${FILESDIR}"/symengine-0.9.0-pthread-cmake.patch |
115 |
) |
116 |
|
117 |
pkg_pretend() { |