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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20