dev-util/mdds: Add IUSE=openmp
authorAndreas Sturmlechner <asturm@gentoo.org>
Thu, 28 May 2020 16:29:22 +0000 (18:29 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Thu, 28 May 2020 17:09:01 +0000 (19:09 +0200)
Reported-by: Sebastian Hamann <gentoo-bugs@ares-macrotechnology.com>
Closes: https://bugs.gentoo.org/725394
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
dev-util/mdds/mdds-1.6.0.ebuild
dev-util/mdds/mdds-9999.ebuild

index 7fa68c62a5eec6c95de855f95c1b74727a7dda32..a8ee00cd56bfb6ac77be178d308a272b792f0c0e 100644 (file)
@@ -16,8 +16,8 @@ DESCRIPTION="A collection of multi-dimensional data structure and indexing algor
 HOMEPAGE="https://gitlab.com/mdds/mdds"
 
 LICENSE="MIT"
-SLOT="1/1.5"
-IUSE="doc valgrind test"
+SLOT="1/1.5" # Check API version on version bumps!
+IUSE="doc openmp valgrind test"
 RESTRICT="!test? ( test )"
 
 BDEPEND="
@@ -32,9 +32,16 @@ RDEPEND="${DEPEND}"
 
 PATCHES=( "${FILESDIR}/${PN}-1.5.0-buildsystem.patch" )
 
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
 src_prepare() {
        default
-
        eautoreconf
 }
 
@@ -43,6 +50,12 @@ src_configure() {
                $(use_enable doc docs)
                $(use_enable valgrind memory_tests)
        )
+       if use openmp && tc-has-openmp; then
+               myeconfargs+=( --enable-openmp )
+       else
+               myeconfargs+=( --disable-openmp )
+       fi
+
        econf "${myeconfargs[@]}"
 }
 
index 1bede682c2d94835330b99829495dfd35f7a67a5..64e78d4d68f9dfa76fea6f36247b2d6485762b29 100644 (file)
@@ -17,7 +17,7 @@ HOMEPAGE="https://gitlab.com/mdds/mdds"
 
 LICENSE="MIT"
 SLOT="1/${PV%.*}" # Check API version on version bumps!
-IUSE="doc valgrind test"
+IUSE="doc openmp valgrind test"
 RESTRICT="!test? ( test )"
 
 BDEPEND="
@@ -32,9 +32,16 @@ RDEPEND="${DEPEND}"
 
 PATCHES=( "${FILESDIR}/${PN}-1.5.0-buildsystem.patch" )
 
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
 src_prepare() {
        default
-
        eautoreconf
 }
 
@@ -43,6 +50,11 @@ src_configure() {
                $(use_enable doc docs)
                $(use_enable valgrind memory_tests)
        )
+       if use openmp && tc-has-openmp; then
+               myeconfargs+=( --enable-openmp )
+       else
+               myeconfargs+=( --disable-openmp )
+       fi
        econf "${myeconfargs[@]}"
 }