1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils fortran-2 autotools multilib flag-o-matic toolchain-funcs
11 DESCRIPTION="Basic Linear Algebra Subprograms F77 reference implementations"
12 HOMEPAGE="http://www.netlib.org/blas/"
13 SRC_URI="http://www.netlib.org/lapack/${LAPACKPN}-${LAPACKPV}.tgz"
17 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
20 DEPEND="app-eselect/eselect-blas"
22 doc? ( app-doc/blas-docs )"
24 S="${WORKDIR}/${LAPACKPN}-${LAPACKPV}"
27 ESELECT_PROF=reference
29 "${FILESDIR}"/${P}-autotool.patch \
30 "${FILESDIR}"/${P}-pkg-config.patch
33 cp "${FILESDIR}"/eselect.blas.reference "${T}"/eselect.blas.reference || die
34 sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.blas.reference || die
35 if [[ ${CHOST} == *-darwin* ]] ; then
36 sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
37 "${T}"/eselect.blas.reference || die
43 --libdir="${EPREFIX}"/usr/$(get_libdir)/blas/reference
47 emake LDFLAGS="${LDFLAGS}"
52 eselect blas add $(get_libdir) "${T}"/eselect.blas.reference ${ESELECT_PROF}
57 local current_lib=$(eselect ${p} show | cut -d' ' -f2)
58 if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
59 # work around eselect bug #189942
60 local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
61 [[ -e ${configfile} ]] && rm -f ${configfile}
62 eselect ${p} set ${ESELECT_PROF}
63 elog "${p} has been eselected to ${ESELECT_PROF}"
65 elog "Current eselected ${p} is ${current_lib}"
66 elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
67 elog "\t eselect ${p} set ${ESELECT_PROF}"