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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Apr 11 13:17:37 2009 UTC (10 years, 10 months ago) by nixnut
Branch: MAIN
Changes since 1.3: +2 -2 lines
ppc stable #265339
(Portage version: 2.1.6.11/cvs/Linux ppc)

1 # Copyright 1999-2009 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.12.ebuild,v 1.3 2009/04/08 03:52:28 jer 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"
16
17 RDEPEND="cblas? ( virtual/cblas )"
18 DEPEND="${RDEPEND}
19 app-admin/eselect-cblas
20 dev-util/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 && [[ ${current_lib} == gsl ]]; then
27 ewarn "USE flag cblas 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 replace-cpu-flags k6 k6-2 k6-3 i586
37 epatch "${FILESDIR}"/${P}-cblas.patch
38 eautoreconf
39 }
40
41 src_configure() {
42 if use cblas; then
43 export CBLAS_LIBS="$(pkg-config --libs cblas)"
44 export CBLAS_CFLAGS="$(pkg-config --cflags cblas)"
45 fi
46 econf $(use_with cblas)
47 }
48
49 src_install() {
50 emake install DESTDIR="${D}" || die "emake install failed."
51 dodoc AUTHORS BUGS ChangeLog NEWS README SUPPORT \
52 THANKS TODO || die "dodoc failed"
53
54 # take care of pkgconfig file for cblas implementation.
55 sed -e "s/@LIBDIR@/$(get_libdir)/" \
56 -e "s/@PV@/${PV}/" \
57 "${FILESDIR}"/cblas.pc.in > cblas.pc \
58 || die "sed cblas.pc failed"
59 insinto /usr/$(get_libdir)/blas/gsl
60 doins cblas.pc || die "installing cblas.pc failed"
61 eselect cblas add $(get_libdir) "${FILESDIR}"/eselect.cblas.gsl \
62 ${ESELECT_PROF}
63 }
64
65 pkg_postinst() {
66 local p=cblas
67 local current_lib=$(eselect ${p} show | cut -d' ' -f2)
68 if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
69 # work around eselect bug #189942
70 local configfile="${ROOT}"/etc/env.d/${p}/$(get_libdir)/config
71 [[ -e ${configfile} ]] && rm -f ${configfile}
72 eselect ${p} set ${ESELECT_PROF}
73 elog "${p} has been eselected to ${ESELECT_PROF}"
74 else
75 elog "Current eselected ${p} is ${current_lib}"
76 elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
77 elog "\t eselect ${p} set ${ESELECT_PROF}"
78 fi
79 }

  ViewVC Help
Powered by ViewVC 1.1.20