| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sci-libs/blas-reference/blas-reference-20070226-r2.ebuild,v 1.12 2012/10/18 21:19:19 jlec Exp $
|
| 4 |
|
| 5 |
EAPI=3
|
| 6 |
|
| 7 |
inherit eutils fortran-2 autotools multilib flag-o-matic toolchain-funcs
|
| 8 |
|
| 9 |
LAPACKPV="3.1.1"
|
| 10 |
LAPACKPN="lapack-lite"
|
| 11 |
|
| 12 |
DESCRIPTION="Basic Linear Algebra Subprograms F77 reference implementations"
|
| 13 |
HOMEPAGE="http://www.netlib.org/blas/"
|
| 14 |
SRC_URI="http://www.netlib.org/lapack/${LAPACKPN}-${LAPACKPV}.tgz"
|
| 15 |
|
| 16 |
LICENSE="BSD"
|
| 17 |
SLOT="0"
|
| 18 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris"
|
| 19 |
IUSE="doc"
|
| 20 |
|
| 21 |
DEPEND="app-admin/eselect-blas"
|
| 22 |
RDEPEND="${DEPEND}
|
| 23 |
doc? ( app-doc/blas-docs )"
|
| 24 |
|
| 25 |
S="${WORKDIR}/${LAPACKPN}-${LAPACKPV}"
|
| 26 |
|
| 27 |
src_prepare() {
|
| 28 |
ESELECT_PROF=reference
|
| 29 |
epatch \
|
| 30 |
"${FILESDIR}"/${P}-autotool.patch \
|
| 31 |
"${FILESDIR}"/${P}-pkg-config.patch
|
| 32 |
eautoreconf
|
| 33 |
|
| 34 |
cp "${FILESDIR}"/eselect.blas.reference "${T}"/
|
| 35 |
sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.blas.reference || die
|
| 36 |
if [[ ${CHOST} == *-darwin* ]] ; then
|
| 37 |
sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
|
| 38 |
"${T}"/eselect.blas.reference || die
|
| 39 |
fi
|
| 40 |
}
|
| 41 |
|
| 42 |
src_configure() {
|
| 43 |
econf \
|
| 44 |
--libdir="${EPREFIX}"/usr/$(get_libdir)/blas/reference
|
| 45 |
}
|
| 46 |
|
| 47 |
src_compile() {
|
| 48 |
emake LDFLAGS="${LDFLAGS}" || die "emake failed"
|
| 49 |
}
|
| 50 |
|
| 51 |
src_install() {
|
| 52 |
emake DESTDIR="${D}" install || die "emake install failed"
|
| 53 |
eselect blas add $(get_libdir) "${T}"/eselect.blas.reference ${ESELECT_PROF}
|
| 54 |
}
|
| 55 |
|
| 56 |
pkg_postinst() {
|
| 57 |
local p=blas
|
| 58 |
local current_lib=$(eselect ${p} show | cut -d' ' -f2)
|
| 59 |
if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
|
| 60 |
# work around eselect bug #189942
|
| 61 |
local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
|
| 62 |
[[ -e ${configfile} ]] && rm -f ${configfile}
|
| 63 |
eselect ${p} set ${ESELECT_PROF}
|
| 64 |
elog "${p} has been eselected to ${ESELECT_PROF}"
|
| 65 |
else
|
| 66 |
elog "Current eselected ${p} is ${current_lib}"
|
| 67 |
elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
|
| 68 |
elog "\t eselect ${p} set ${ESELECT_PROF}"
|
| 69 |
fi
|
| 70 |
}
|