commit:     9a75190cb8ceebb36554b6d974787afcc54dabca
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat May 14 21:56:44 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 15 01:18:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a75190c

sci-libs/superlu_mt: [QA] tc-has-openmp → tc-check-openmp

Signed-off-by: David Seifert <soap <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/25488
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild 
b/sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild
index ec84973ee7d0..adfa9a6f3431 100644
--- a/sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild
+++ b/sci-libs/superlu_mt/superlu_mt-3.1-r1.ebuild
@@ -31,18 +31,12 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.1-fix-predefs.patch
 )
 
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && ! use threads && 
tc-check-openmp
+}
+
 pkg_setup() {
-       if use openmp && ! use threads; then
-               if [[ "$(tc-getCC)" == *gcc ]] && ! tc-has-openmp; then
-                       ewarn "OpenMP is not available in your current selected 
gcc"
-                       die "need openmp capable gcc"
-               fi
-               CTHREADS="-D__OPENMP"
-               [[ "$(tc-getCC)" == *gcc ]] && LDTHREADS="-fopenmp"
-       else
-               CTHREADS="-D__PTHREAD"
-               LDTHREADS="-pthread"
-       fi
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && ! use threads && 
tc-check-openmp
 }
 
 src_prepare() {
@@ -68,6 +62,14 @@ src_prepare() {
                -e '/:.*$(SUPERLULIB)/s|../lib/$(SUPERLULIB)||g' \
                -e 's|../lib/$(SUPERLULIB)|-lsuperlu_mt|g' \
                -i EXAMPLE/Makefile || die
+
+       if use openmp && ! use threads; then
+               CTHREADS="-D__OPENMP"
+               LDTHREADS="-fopenmp"
+       else
+               CTHREADS="-D__PTHREAD"
+               LDTHREADS="-pthread"
+       fi
 }
 
 src_compile() {

Reply via email to