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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Oct 11 16:55:45 2007 UTC (12 years, 4 months ago) by bicatali
Branch: MAIN
Changes since 1.1: +2 -2 lines
fixed lib->get_libdir for eselect bug workaround
(Portage version: 2.1.3.12)

1 # Copyright 1999-2007 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.10.ebuild,v 1.1 2007/10/10 13:22:40 bicatali Exp $
4
5 inherit eutils flag-o-matic toolchain-funcs autotools
6
7 DESCRIPTION="The GNU Scientific Library"
8 HOMEPAGE="http://www.gnu.org/software/gsl/"
9 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
10
11 LICENSE="GPL-3"
12 SLOT="0"
13 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
14 IUSE="cblas"
15
16 RDEPEND="app-admin/eselect-cblas
17 cblas? ( virtual/cblas )"
18
19 DEPEND="${RDEPEND}
20 dev-util/pkgconfig"
21
22 pkg_setup() {
23 # icc-10.0.026 did not pass rng tests (last check: gsl-1.10)
24 if [[ $(tc-getCC) == icc ]]; then
25 eerror "icc known to fail tests. Revert to safer compiler and re-emerge."
26 die "gsl does not work when compiled with icc"
27 fi
28 }
29
30 src_unpack() {
31 unpack ${A}
32 cd "${S}"
33 epatch "${FILESDIR}"/gsl-cblas.patch
34 eautoreconf
35 }
36
37 src_compile() {
38 # could someone check if they are still needed?
39 replace-cpu-flags k6 k6-2 k6-3 i586
40 filter-flags -ffast-math
41 local myconf=
42 use cblas && myconf="--with-cblas=$(pkg-config --libs cblas)"
43 econf "${myconf}"|| die "econf failed"
44 emake || die "emake failed"
45 }
46
47 src_install() {
48 emake install DESTDIR="${D}" || die "emake install failed."
49 dodoc AUTHORS BUGS ChangeLog NEWS README SUPPORT \
50 THANKS TODO || die "dodoc failed"
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_PROF=gsl
60 eselect cblas add $(get_libdir) "${FILESDIR}"/eselect.cblas.gsl ${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