/[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.10 - (hide annotations) (download)
Thu Feb 21 21:36:16 2013 UTC (6 years, 11 months ago) by jlec
Branch: MAIN
Changes since 1.9: +5 -5 lines
sci-libs/gsl: Use tc-getPKG_CONFIG from toolchain-funcs.eclass instead of plain pkg-config; drop old

(Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)

1 jlec 1.10 # Copyright 1999-2013 Gentoo Foundation
2 bicatali 1.1 # Distributed under the terms of the GNU General Public License v2
3 jlec 1.10 # $Header: /var/cvsroot/gentoo-x86/sci-libs/gsl/gsl-1.14.ebuild,v 1.9 2012/05/04 08:22:52 jdhore Exp $
4 bicatali 1.1
5     EAPI="3"
6    
7 jlec 1.10 inherit autotools eutils flag-o-matic toolchain-funcs
8 bicatali 1.1
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 xarthisius 1.8 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x86-solaris"
16     IUSE="cblas-external"
17 bicatali 1.1
18 xarthisius 1.8 RDEPEND="cblas-external? ( virtual/cblas )"
19 bicatali 1.1 DEPEND="${RDEPEND}
20     app-admin/eselect-cblas
21 jdhore 1.9 virtual/pkgconfig"
22 bicatali 1.1
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 xarthisius 1.8 if use cblas-external && [[ ${current_lib} == gsl ]]; then
28     ewarn "USE flag cblas-external is set: linking gsl with an external cblas."
29 bicatali 1.1 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 xarthisius 1.8 if use cblas-external; then
50 jlec 1.10 export CBLAS_LIBS="$($(tc-getPKG_CONFIG) --libs cblas)"
51     export CBLAS_CFLAGS="$($(tc-getPKG_CONFIG) --cflags cblas)"
52 bicatali 1.1 fi
53 xarthisius 1.8 econf $(use_with cblas-external cblas)
54 bicatali 1.1 }
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