From be8b6a8f9aa5c220c163e99b37aa1183daf1c5e1 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 30 Apr 2020 16:03:30 -0500 Subject: sci-libs/ginkgo: improve ebuild Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Matthias Maier --- .../ginkgo/files/ginkgo-1.1.1-set_soname.patch | 14 +++++ sci-libs/ginkgo/ginkgo-1.1.1-r1.ebuild | 60 ++++++++++++++++++++++ sci-libs/ginkgo/ginkgo-1.1.1.ebuild | 44 ---------------- sci-libs/ginkgo/ginkgo-9999.ebuild | 34 ++++++++---- sci-libs/ginkgo/metadata.xml | 1 + 5 files changed, 99 insertions(+), 54 deletions(-) create mode 100644 sci-libs/ginkgo/files/ginkgo-1.1.1-set_soname.patch create mode 100644 sci-libs/ginkgo/ginkgo-1.1.1-r1.ebuild delete mode 100644 sci-libs/ginkgo/ginkgo-1.1.1.ebuild (limited to 'sci-libs/ginkgo') diff --git a/sci-libs/ginkgo/files/ginkgo-1.1.1-set_soname.patch b/sci-libs/ginkgo/files/ginkgo-1.1.1-set_soname.patch new file mode 100644 index 000000000000..9feceee00f7b --- /dev/null +++ b/sci-libs/ginkgo/files/ginkgo-1.1.1-set_soname.patch @@ -0,0 +1,14 @@ +diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake +index 8a8ad04..03c6db6 100644 +--- a/cmake/build_helpers.cmake ++++ b/cmake/build_helpers.cmake +@@ -17,6 +17,9 @@ function(ginkgo_compile_features name) + if(GINKGO_WITH_IWYU AND GINKGO_IWYU_PATH) + set_property(TARGET "${name}" PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${GINKGO_IWYU_PATH}) + endif() ++ # Set an appropriate SONAME ++ set_property(TARGET "${name}" PROPERTY ++ SOVERSION "${Ginkgo_VERSION}") + if(GINKGO_CHANGED_SHARED_LIBRARY) + # Put all shared libraries and corresponding imported libraries into the specified path + set_property(TARGET "${name}" PROPERTY diff --git a/sci-libs/ginkgo/ginkgo-1.1.1-r1.ebuild b/sci-libs/ginkgo/ginkgo-1.1.1-r1.ebuild new file mode 100644 index 000000000000..5348b9a51be6 --- /dev/null +++ b/sci-libs/ginkgo/ginkgo-1.1.1-r1.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake-utils + +DESCRIPTION="Numerical linear algebra software package" +HOMEPAGE="https://ginkgo-project.github.io/" + +if [[ ${PV} = *9999* ]]; then + EGIT_REPO_URI="https://github.com/ginkgo-project/ginkgo" + SRC_URI="" + KEYWORDS="" + inherit git-r3 +else + SRC_URI="https://github.com/${PN}-project/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="BSD-with-attribution" +SLOT="0" +IUSE="+openmp cuda" + +RDEPEND=" + cuda? ( dev-util/nvidia-cuda-sdk )" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-1.1.1-set_soname.patch +) + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]] && \ + use openmp && ! tc-has-openmp ; then + die "Need an OpenMP capable compiler" + fi +} + +src_prepare() { + sed -i \ + -e "s#\"lib\"#\"$(get_libdir)\"#g" \ + -e "s#\"lib/#\"$(get_libdir)/#g" \ + cmake/install_helpers.cmake || die "sed failed" + + cmake-utils_src_prepare +} + +src_configure() { + + local mycmakeargs=( + -DGINKGO_DEVEL_TOOLS=OFF + -DGINKGO_BUILD_TESTS=OFF + -DGINKGO_BUILD_BENCHMARKS=OFF + -DGINKGO_BUILD_REFERENCE=ON + -DGINKGO_BUILD_OMP="$(usex openmp)" + -DGINKGO_BUILD_CUDA="$(usex cuda)" + ) + cmake-utils_src_configure +} diff --git a/sci-libs/ginkgo/ginkgo-1.1.1.ebuild b/sci-libs/ginkgo/ginkgo-1.1.1.ebuild deleted file mode 100644 index a3c8615833dc..000000000000 --- a/sci-libs/ginkgo/ginkgo-1.1.1.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake-utils - -DESCRIPTION="Numerical linear algebra software package" -HOMEPAGE="https://ginkgo-project.github.io/" - -SRC_URI="https://github.com/${PN}-project/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" -KEYWORDS="~amd64 ~x86" - -LICENSE="BSD-with-attribution" -SLOT="0" -IUSE="" - -# TODO: add slepc use flag once slepc is packaged for gentoo-science -REQUIRED_USE="" - -RDEPEND="" - -DEPEND="" - -src_prepare() { - sed -i \ - -e "s#\"lib\"#\"$(get_libdir)\"#g" \ - -e "s#\"lib/#\"$(get_libdir)/#g" \ - cmake/install_helpers.cmake || die "sed failed" - - cmake-utils_src_prepare -} - -src_configure() { - - local mycmakeargs=( - -DGINKGO_DEVEL_TOOLS=OFF - -DGINKGO_BUILD_TESTS=OFF - -DGINKGO_BUILD_BENCHMARKS=OFF - -DGINKGO_BUILD_REFERENCE=ON - -DGINKGO_BUILD_OMP=ON - ) - cmake-utils_src_configure -} diff --git a/sci-libs/ginkgo/ginkgo-9999.ebuild b/sci-libs/ginkgo/ginkgo-9999.ebuild index 3b9102d21654..5348b9a51be6 100644 --- a/sci-libs/ginkgo/ginkgo-9999.ebuild +++ b/sci-libs/ginkgo/ginkgo-9999.ebuild @@ -8,21 +8,34 @@ inherit cmake-utils DESCRIPTION="Numerical linear algebra software package" HOMEPAGE="https://ginkgo-project.github.io/" -inherit git-r3 -EGIT_REPO_URI="https://github.com/ginkgo-project/ginkgo" -SRC_URI="" -KEYWORDS="" +if [[ ${PV} = *9999* ]]; then + EGIT_REPO_URI="https://github.com/ginkgo-project/ginkgo" + SRC_URI="" + KEYWORDS="" + inherit git-r3 +else + SRC_URI="https://github.com/${PN}-project/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi LICENSE="BSD-with-attribution" SLOT="0" -IUSE="" +IUSE="+openmp cuda" -# TODO: add slepc use flag once slepc is packaged for gentoo-science -REQUIRED_USE="" +RDEPEND=" + cuda? ( dev-util/nvidia-cuda-sdk )" +DEPEND="${RDEPEND}" -RDEPEND="" +PATCHES=( + "${FILESDIR}"/${PN}-1.1.1-set_soname.patch +) -DEPEND="" +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]] && \ + use openmp && ! tc-has-openmp ; then + die "Need an OpenMP capable compiler" + fi +} src_prepare() { sed -i \ @@ -40,7 +53,8 @@ src_configure() { -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_BENCHMARKS=OFF -DGINKGO_BUILD_REFERENCE=ON - -DGINKGO_BUILD_OMP=ON + -DGINKGO_BUILD_OMP="$(usex openmp)" + -DGINKGO_BUILD_CUDA="$(usex cuda)" ) cmake-utils_src_configure } diff --git a/sci-libs/ginkgo/metadata.xml b/sci-libs/ginkgo/metadata.xml index e67b34570313..2b6a2c10b332 100644 --- a/sci-libs/ginkgo/metadata.xml +++ b/sci-libs/ginkgo/metadata.xml @@ -15,6 +15,7 @@ implemented using modern C++, with GPU kernels implemented in CUDA. + Add support for cuda assimp (dev-util/nvidia-cuda-sdk) ginkgo-project/ginkgo -- cgit v1.2.3-65-gdbad