From c84cc07add2d8a5351d07e6797e8fd7c24e4af21 Mon Sep 17 00:00:00 2001 From: Mo Zhou Date: Thu, 11 Jul 2019 02:53:07 +0000 Subject: [PATCH] sci-libs/openblas: add the missing postinst steps and maintainer. Closes: https://github.com/gentoo/gentoo/pull/12422 Package-Manager: Portage-2.3.52, Repoman-2.3.12 Signed-off-by: Mo Zhou Signed-off-by: Benda Xu --- sci-libs/openblas/metadata.xml | 4 +++ sci-libs/openblas/openblas-0.3.5.ebuild | 40 ++++++++++++++++++------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/sci-libs/openblas/metadata.xml b/sci-libs/openblas/metadata.xml index a5e019212f0d..987eb126d9c1 100644 --- a/sci-libs/openblas/metadata.xml +++ b/sci-libs/openblas/metadata.xml @@ -5,6 +5,10 @@ sci@gentoo.org Gentoo Science Project + + lumin@debian.org + Mo Zhou + OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. diff --git a/sci-libs/openblas/openblas-0.3.5.ebuild b/sci-libs/openblas/openblas-0.3.5.ebuild index b41803760ae9..ba14ee30b531 100644 --- a/sci-libs/openblas/openblas-0.3.5.ebuild +++ b/sci-libs/openblas/openblas-0.3.5.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -14,11 +14,11 @@ IUSE="dynamic openmp pthread serial static-libs eselect-ldso" REQUIRED_USE="?? ( openmp pthread serial )" RDEPEND=" ->=app-eselect/eselect-blas-0.2 ->=app-eselect/eselect-lapack-0.2 +eselect-ldso? ( >=app-eselect/eselect-blas-0.2 + !app-eselect/eselect-cblas + >=app-eselect/eselect-lapack-0.2 ) " -DEPEND="${RDEPEND} - virtual/pkgconfig" +DEPEND="virtual/pkgconfig" PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" ) @@ -69,11 +69,31 @@ src_install () { } pkg_postinst () { - if use eselect-ldso; then - eselect blas add $(get_libdir) \ - "${EROOT}"/usr/$(get_libdir)/blas/openblas openblas - eselect lapack add $(get_libdir) \ - "${EROOT}"/usr/$(get_libdir)/lapack/openblas openblas + use eselect-ldso || return + local libdir=$(get_libdir) me="openblas" + + # check blas + eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me} + local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2) + if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then + eselect blas set ${libdir} ${me} + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." + else + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." + elog "To use blas [${me}] implementation, you have to issue (as root):" + elog "\t eselect blas set ${libdir} ${me}" + fi + + # check lapack + eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me} + local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2) + if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then + eselect lapack set ${libdir} ${me} + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]." + else + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]." + elog "To use lapack [${me}] implementation, you have to issue (as root):" + elog "\t eselect lapack set ${libdir} ${me}" fi } -- 2.26.2