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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Sep 17 22:13:22 2009 UTC (10 years, 5 months ago) by bicatali
Branch: MAIN
Version bump, removed old. Note gsl-1.9-r1 is kept for GPL-2 compat until we close bug #199451
(Portage version: 2.2_rc40/cvs/Linux x86_64)

1 bicatali 1.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.8 2009/04/23 13:23:11 armin76 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     epatch "${FILESDIR}"/${P}-cblas.patch
37     eautoreconf
38     }
39    
40     src_configure() {
41     if use cblas; then
42     export CBLAS_LIBS="$(pkg-config --libs cblas)"
43     export CBLAS_CFLAGS="$(pkg-config --cflags cblas)"
44     fi
45     econf $(use_with cblas)
46     }
47    
48     src_install() {
49     emake install DESTDIR="${D}" || die "emake install failed."
50     dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
51    
52     # take care of pkgconfig file for cblas implementation.
53     sed -e "s/@LIBDIR@/$(get_libdir)/" \
54     -e "s/@PV@/${PV}/" \
55     "${FILESDIR}"/cblas.pc.in > cblas.pc \
56     || die "sed cblas.pc failed"
57     insinto /usr/$(get_libdir)/blas/gsl
58     doins cblas.pc || die "installing cblas.pc failed"
59     eselect cblas add $(get_libdir) "${FILESDIR}"/eselect.cblas.gsl \
60     ${ESELECT_PROF}
61     }
62    
63     pkg_postinst() {
64     local p=cblas
65     local current_lib=$(eselect ${p} show | cut -d' ' -f2)
66     if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
67     # work around eselect bug #189942
68     local configfile="${ROOT}"/etc/env.d/${p}/$(get_libdir)/config
69     [[ -e ${configfile} ]] && rm -f ${configfile}
70     eselect ${p} set ${ESELECT_PROF}
71     elog "${p} has been eselected to ${ESELECT_PROF}"
72     else
73     elog "Current eselected ${p} is ${current_lib}"
74     elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
75     elog "\t eselect ${p} set ${ESELECT_PROF}"
76     fi
77     }

  ViewVC Help
Powered by ViewVC 1.1.20