dev-qt/qtpositioning: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sci-libs / blas-reference / blas-reference-20070226-r4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit eutils fortran-2 autotools multilib flag-o-matic toolchain-funcs
7
8 LAPACKPV="3.1.1"
9 LAPACKPN="lapack-lite"
10
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"
14
15 LICENSE="BSD"
16 SLOT="0"
17 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
18 IUSE="doc"
19
20 DEPEND="app-eselect/eselect-blas"
21 RDEPEND="${DEPEND}
22         doc? ( app-doc/blas-docs )"
23
24 S="${WORKDIR}/${LAPACKPN}-${LAPACKPV}"
25
26 src_prepare() {
27         ESELECT_PROF=reference
28         epatch \
29                 "${FILESDIR}"/${P}-autotool.patch \
30                 "${FILESDIR}"/${P}-pkg-config.patch
31         eautoreconf
32
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
38         fi
39 }
40
41 src_configure() {
42         econf \
43                 --libdir="${EPREFIX}"/usr/$(get_libdir)/blas/reference
44 }
45
46 src_compile() {
47         emake LDFLAGS="${LDFLAGS}"
48 }
49
50 src_install() {
51         default
52         eselect blas add $(get_libdir) "${T}"/eselect.blas.reference ${ESELECT_PROF}
53 }
54
55 pkg_postinst() {
56         local p=blas
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}"
64         else
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}"
68         fi
69 }