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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Mon Aug 3 23:04:24 2015 UTC (4 years, 5 months ago) by mrueg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Remove old.

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key )

1 # Copyright 1999-2015 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.14-r1.ebuild,v 1.10 2015/04/29 06:35:06 patrick Exp $
4
5 EAPI="3"
6
7 inherit eutils flag-o-matic autotools toolchain-funcs
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 static-libs"
17
18 RDEPEND="cblas-external? ( virtual/cblas )"
19 DEPEND="${RDEPEND}
20 app-eselect/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 # bug 349005
37 [[ $(tc-getCC)$ == *gcc* ]] && \
38 [[ $(tc-getCC)$ != *apple* ]] && \
39 [[ $(gcc-major-version)$(gcc-minor-version) -eq 44 ]] \
40 && filter-mfpmath sse
41 filter-flags -ffast-math
42
43 epatch "${FILESDIR}"/${P}-cblas.patch
44 eautoreconf
45
46 cp "${FILESDIR}"/eselect.cblas.gsl "${T}"/
47 sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.cblas.gsl || die
48 if [[ ${CHOST} == *-darwin* ]] ; then
49 sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
50 "${T}"/eselect.cblas.gsl || die
51 fi
52 }
53
54 src_configure() {
55 if use cblas-external; then
56 export CBLAS_LIBS="$($(tc-getPKG_CONFIG) --libs cblas)"
57 export CBLAS_CFLAGS="$($(tc-getPKG_CONFIG) --cflags cblas)"
58 fi
59 econf \
60 --enable-shared \
61 $(use_with cblas-external cblas) \
62 $(use_enable static-libs static)
63 }
64
65 src_install() {
66 emake install DESTDIR="${D}" || die "emake install failed."
67 dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
68
69 # take care of pkgconfig file for cblas implementation.
70 sed -e "s/@LIBDIR@/$(get_libdir)/" \
71 -e "s/@PV@/${PV}/" \
72 -e "/^prefix=/s:=:=${EPREFIX}:" \
73 -e "/^libdir=/s:=:=${EPREFIX}:" \
74 "${FILESDIR}"/cblas.pc.in > cblas.pc \
75 || die "sed cblas.pc failed"
76 insinto /usr/$(get_libdir)/blas/gsl
77 doins cblas.pc || die "installing cblas.pc failed"
78 eselect cblas add $(get_libdir) "${T}"/eselect.cblas.gsl \
79 ${ESELECT_PROF}
80 }
81
82 pkg_postinst() {
83 local p=cblas
84 local current_lib=$(eselect ${p} show | cut -d' ' -f2)
85 if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
86 # work around eselect bug #189942
87 local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
88 [[ -e ${configfile} ]] && rm -f ${configfile}
89 eselect ${p} set ${ESELECT_PROF}
90 elog "${p} has been eselected to ${ESELECT_PROF}"
91 else
92 elog "Current eselected ${p} is ${current_lib}"
93 elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
94 elog "\t eselect ${p} set ${ESELECT_PROF}"
95 fi
96 }
97
98 src_test() {
99 emake -j1 check || die
100 }

  ViewVC Help
Powered by ViewVC 1.1.20