Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/lapack/
Date: Sun, 08 Mar 2020 04:35:33
Message-Id: 1583642086.09e858da1b3331b1ed8786235a3e3bdb9732956d.heroxbd@gentoo
1 commit: 09e858da1b3331b1ed8786235a3e3bdb9732956d
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Sat Feb 29 10:49:33 2020 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 8 04:34:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09e858da
7
8 sci-libs/lapack: readd deprecated functions.
9
10 Reported-By: leoricupero <AT> gmail.com
11 Closes: https://bugs.gentoo.org/702254
12 Closes: https://github.com/gentoo/gentoo/pull/14803
13 Package-Manager: Portage-2.3.89, Repoman-2.3.20
14 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
15 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
16
17 sci-libs/lapack/lapack-3.8.0-r1.ebuild | 92 ++++++++++++++++++++++++++++++++++
18 sci-libs/lapack/metadata.xml | 1 +
19 2 files changed, 93 insertions(+)
20
21 diff --git a/sci-libs/lapack/lapack-3.8.0-r1.ebuild b/sci-libs/lapack/lapack-3.8.0-r1.ebuild
22 new file mode 100644
23 index 00000000000..bf8ffd46029
24 --- /dev/null
25 +++ b/sci-libs/lapack/lapack-3.8.0-r1.ebuild
26 @@ -0,0 +1,92 @@
27 +# Copyright 1999-2020 Gentoo Authors
28 +# Distributed under the terms of the GNU General Public License v2
29 +
30 +EAPI=7
31 +CMAKE_MAKEFILE_GENERATOR=emake
32 +inherit cmake-utils
33 +
34 +DESCRIPTION="BLAS,CBLAS,LAPACK,LAPACKE reference implementations"
35 +HOMEPAGE="http://www.netlib.org/lapack/"
36 +SRC_URI="http://www.netlib.org/${PN}/${P}.tar.gz"
37 +
38 +LICENSE="BSD"
39 +SLOT="0"
40 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
41 +IUSE="lapacke deprecated doc eselect-ldso"
42 +# TODO: static-libs 64bit-index
43 +
44 +RDEPEND="
45 + eselect-ldso? ( >=app-eselect/eselect-blas-0.2
46 + >=app-eselect/eselect-lapack-0.2 )
47 + !app-eselect/eselect-cblas
48 + !sci-libs/blas-reference
49 + !sci-libs/cblas-reference
50 + !sci-libs/lapack-reference
51 + !sci-libs/lapacke-reference
52 + virtual/fortran
53 + doc? ( app-doc/blas-docs )"
54 +DEPEND="${RDEPEND}
55 + virtual/pkgconfig"
56 +
57 +src_configure() {
58 + local mycmakeargs=(
59 + -DCBLAS=ON
60 + -DLAPACKE=$(usex lapacke)
61 + -DBUILD_DEPRECATED=$(usex deprecated)
62 + -DBUILD_SHARED_LIBS=ON
63 + )
64 + cmake-utils_src_configure
65 +}
66 +
67 +src_install() {
68 + cmake-utils_src_install
69 +
70 + use eselect-ldso || return
71 + # Create private lib directory for eselect::blas (ld.so.conf)
72 + dodir /usr/$(get_libdir)/blas/reference
73 + dosym ../../libblas.so usr/$(get_libdir)/blas/reference/libblas.so
74 + dosym ../../libblas.so.3 usr/$(get_libdir)/blas/reference/libblas.so.3
75 + dosym ../../libcblas.so usr/$(get_libdir)/blas/reference/libcblas.so
76 + dosym ../../libcblas.so.3 usr/$(get_libdir)/blas/reference/libcblas.so.3
77 +
78 + # Create private lib directory for eselect::lapack (ld.so.conf)
79 + dodir /usr/$(get_libdir)/lapack/reference
80 + dosym ../../liblapack.so usr/$(get_libdir)/lapack/reference/liblapack.so
81 + dosym ../../liblapack.so.3 usr/$(get_libdir)/lapack/reference/liblapack.so.3
82 +}
83 +
84 +pkg_postinst() {
85 + use eselect-ldso || return
86 +
87 + local me=reference libdir=$(get_libdir)
88 + # check eselect-blas
89 + eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me}
90 + local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2)
91 + if [[ ${current_blas} == ${me} || -z ${current_blas} ]]; then
92 + eselect blas set ${libdir} ${me}
93 + elog "Current eselect: BLAS ($libdir) -> [${current_blas}]."
94 + else
95 + elog "Current eselect: BLAS ($libdir) -> [${current_blas}]."
96 + elog "To use blas [${me}] implementation, you have to issue (as root):"
97 + elog "\t eselect blas set ${libdir} ${me}"
98 + fi
99 +
100 + # check eselect-lapack
101 + eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me}
102 + local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2)
103 + if [[ ${current_lapack} == ${me} || -z ${current_lapack} ]]; then
104 + eselect lapack set ${libdir} ${me}
105 + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
106 + else
107 + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]."
108 + elog "To use lapack [${me}] implementation, you have to issue (as root):"
109 + elog "\t eselect lapack set ${libdir} ${me}"
110 + fi
111 +}
112 +
113 +pkg_postrm() {
114 + use eselect-ldso || return
115 +
116 + eselect blas validate
117 + eselect lapack validate
118 +}
119
120 diff --git a/sci-libs/lapack/metadata.xml b/sci-libs/lapack/metadata.xml
121 index adc276993c4..e4cd26e0166 100644
122 --- a/sci-libs/lapack/metadata.xml
123 +++ b/sci-libs/lapack/metadata.xml
124 @@ -23,6 +23,7 @@ that has found extensive use in the scientific community.
125 This package installs the reference FORTRAN 77 implementation from Netlib.
126 </longdescription>
127 <use>
128 + <flag name="deprecated">Also build deprecated functions</flag>
129 <flag name="lapacke">Build LAPACKE</flag>
130 <flag name="eselect-ldso">Enable runtime library switching by
131 eselect and ld.so.</flag>