1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools eutils fortran-2 multilib toolchain-funcs
8 MyPN="${PN/-reference/}"
10 DESCRIPTION="C wrapper interface to the F77 reference BLAS implementation"
11 HOMEPAGE="http://www.netlib.org/blas/"
12 SRC_URI="http://www.netlib.org/blas/blast-forum/${MyPN}.tgz"
15 LICENSE="public-domain"
17 KEYWORDS="alpha amd64 hppa ppc ppc64 s390 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
21 app-eselect/eselect-cblas"
25 ESELECT_PROF=reference
29 epatch "${FILESDIR}"/${P}-autotool.patch
32 cp "${FILESDIR}"/eselect.cblas.reference "${T}"/ || die
33 sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.cblas.reference || die
34 if [[ ${CHOST} == *-darwin* ]] ; then
35 sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
36 "${T}"/eselect.cblas.reference || die
42 --libdir="${EPREFIX}"/usr/$(get_libdir)/blas/reference \
43 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
49 eselect cblas add $(get_libdir) "${T}"/eselect.cblas.reference ${ESELECT_PROF}
54 local current_lib=$(eselect ${p} show | cut -d' ' -f2)
55 if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
56 # work around eselect bug #189942
57 local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
58 [[ -e ${configfile} ]] && rm -f ${configfile}
59 eselect ${p} set ${ESELECT_PROF}
60 elog "${p} has been eselected to ${ESELECT_PROF}"
62 elog "Current eselected ${p} is ${current_lib}"
63 elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
64 elog "\t eselect ${p} set ${ESELECT_PROF}"