/[gentoo-x86]/sci-libs/gsl/gsl-1.14.ebuild
Gentoo

Contents of /sci-libs/gsl/gsl-1.14.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jun 24 21:07:08 2010 UTC (9 years, 8 months ago) by pacho
Branch: MAIN
Changes since 1.1: +2 -2 lines
stable amd64, bug 325179
(Portage version: 2.1.8.3/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/gsl/gsl-1.14.ebuild,v 1.1 2010/04/09 01:31:06 bicatali Exp $
4
5 EAPI="3"
6
7 inherit eutils flag-o-matic autotools
8
9 DESCRIPTION="The GNU Scientific Library"
10 HOMEPAGE="http://www.gnu.org/software/gsl/"
11 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
16 IUSE="cblas"
17
18 RDEPEND="cblas? ( virtual/cblas )"
19 DEPEND="${RDEPEND}
20 app-admin/eselect-cblas
21 dev-util/pkgconfig"
22
23 pkg_setup() {
24 ESELECT_PROF="gsl"
25 # prevent to use external cblas from a previously installed gsl
26 local current_lib=$(eselect cblas show | cut -d' ' -f2)
27 if use cblas && [[ ${current_lib} == gsl ]]; then
28 ewarn "USE flag cblas is set: linking gsl with an external cblas."
29 ewarn "However the current selected external cblas is gsl."
30 ewarn "Please install and/or eselect another cblas"
31 die "Circular gsl dependency"
32 fi
33 }
34
35 src_prepare() {
36 filter-flags -ffast-math
37 epatch "${FILESDIR}"/${P}-cblas.patch
38 eautoreconf
39
40 cp "${FILESDIR}"/eselect.cblas.gsl "${T}"/
41 sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.cblas.gsl || die
42 if [[ ${CHOST} == *-darwin* ]] ; then
43 sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
44 "${T}"/eselect.cblas.gsl || die
45 fi
46 }
47
48 src_configure() {
49 if use cblas; then
50 export CBLAS_LIBS="$(pkg-config --libs cblas)"
51 export CBLAS_CFLAGS="$(pkg-config --cflags cblas)"
52 fi
53 econf $(use_with cblas)
54 }
55
56 src_install() {
57 emake install DESTDIR="${D}" || die "emake install failed."
58 dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
59
60 # take care of pkgconfig file for cblas implementation.
61 sed -e "s/@LIBDIR@/$(get_libdir)/" \
62 -e "s/@PV@/${PV}/" \
63 -e "/^prefix=/s:=:=${EPREFIX}:" \
64 -e "/^libdir=/s:=:=${EPREFIX}:" \
65 "${FILESDIR}"/cblas.pc.in > cblas.pc \
66 || die "sed cblas.pc failed"
67 insinto /usr/$(get_libdir)/blas/gsl
68 doins cblas.pc || die "installing cblas.pc failed"
69 eselect cblas add $(get_libdir) "${T}"/eselect.cblas.gsl \
70 ${ESELECT_PROF}
71 }
72
73 pkg_postinst() {
74 local p=cblas
75 local current_lib=$(eselect ${p} show | cut -d' ' -f2)
76 if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
77 # work around eselect bug #189942
78 local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
79 [[ -e ${configfile} ]] && rm -f ${configfile}
80 eselect ${p} set ${ESELECT_PROF}
81 elog "${p} has been eselected to ${ESELECT_PROF}"
82 else
83 elog "Current eselected ${p} is ${current_lib}"
84 elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
85 elog "\t eselect ${p} set ${ESELECT_PROF}"
86 fi
87 }

  ViewVC Help
Powered by ViewVC 1.1.20