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

Contents of /sci-libs/gsl/gsl-1.13-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Feb 21 21:36:16 2013 UTC (6 years, 10 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
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 # Copyright 1999-2012 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.13-r2.ebuild,v 1.3 2012/05/04 08:22:52 jdhore 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 ~x86-macos ~sparc-solaris ~x86-solaris"
16 IUSE="cblas-external"
17
18 RDEPEND="cblas-external? ( virtual/cblas )"
19 DEPEND="${RDEPEND}
20 app-admin/eselect-cblas
21 virtual/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-external && [[ ${current_lib} == gsl ]]; then
28 ewarn "USE flag cblas-external 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 epatch "${FILESDIR}"/${P}-cblas-vars.patch
39 eautoreconf
40
41 cp "${FILESDIR}"/eselect.cblas.gsl "${T}"/
42 sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.cblas.gsl || die
43 if [[ ${CHOST} == *-darwin* ]] ; then
44 sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
45 "${T}"/eselect.cblas.gsl || die
46 fi
47 }
48
49 src_configure() {
50 if use cblas-external; then
51 export CBLAS_LIBS="$(pkg-config --libs cblas)"
52 export CBLAS_CFLAGS="$(pkg-config --cflags cblas)"
53 fi
54 econf $(use_with cblas-external cblas)
55 }
56
57 src_install() {
58 emake install DESTDIR="${D}" || die "emake install failed."
59 dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
60
61 # take care of pkgconfig file for cblas implementation.
62 sed -e "s/@LIBDIR@/$(get_libdir)/" \
63 -e "s/@PV@/${PV}/" \
64 -e "/^prefix=/s:=:=${EPREFIX}:" \
65 -e "/^libdir=/s:=:=${EPREFIX}:" \
66 "${FILESDIR}"/cblas.pc.in > cblas.pc \
67 || die "sed cblas.pc failed"
68 insinto /usr/$(get_libdir)/blas/gsl
69 doins cblas.pc || die "installing cblas.pc failed"
70 eselect cblas add $(get_libdir) "${T}"/eselect.cblas.gsl \
71 ${ESELECT_PROF}
72 }
73
74 pkg_postinst() {
75 local p=cblas
76 local current_lib=$(eselect ${p} show | cut -d' ' -f2)
77 if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
78 # work around eselect bug #189942
79 local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
80 [[ -e ${configfile} ]] && rm -f ${configfile}
81 eselect ${p} set ${ESELECT_PROF}
82 elog "${p} has been eselected to ${ESELECT_PROF}"
83 else
84 elog "Current eselected ${p} is ${current_lib}"
85 elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
86 elog "\t eselect ${p} set ${ESELECT_PROF}"
87 fi
88 }

  ViewVC Help
Powered by ViewVC 1.1.20