sci-libs/openblas: add the missing postinst steps and maintainer.
authorMo Zhou <cdluminate@gmail.com>
Thu, 11 Jul 2019 02:53:07 +0000 (02:53 +0000)
committerBenda Xu <heroxbd@gentoo.org>
Thu, 11 Jul 2019 10:55:22 +0000 (18:55 +0800)
Closes: https://github.com/gentoo/gentoo/pull/12422

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Mo Zhou <cdluminate@gmail.com>
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
sci-libs/openblas/metadata.xml
sci-libs/openblas/openblas-0.3.5.ebuild

index a5e019212f0d0ee5c40d98f2e92309b7fc20a5ea..987eb126d9c18bb37968a1df3867ef9e91a9efda 100644 (file)
@@ -5,6 +5,10 @@
                <email>sci@gentoo.org</email>
                <name>Gentoo Science Project</name>
        </maintainer>
+       <maintainer type="person">
+               <email>lumin@debian.org</email>
+               <name>Mo Zhou</name>
+       </maintainer>
        <longdescription lang="en">
                OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
        </longdescription>
index b41803760ae9c90d120d294ce80784f9c701cd94..ba14ee30b53100ff9ee2a17b3b2ad0a0db035d03 100644 (file)
@@ -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
 }