aboutsummaryrefslogtreecommitdiff
blob: cb37221d738c793d3fd11672faa6a7b47b51d080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit eutils fortran-2 multilib toolchain-funcs

DESCRIPTION="A Fortran interface to the GNU Scientific Library"
HOMEPAGE="http://www.lrz.de/services/software/mathematik/gsl/fortran/"
SRC_URI="http://www.lrz.de/services/software/mathematik/gsl/fortran/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="static-libs"

DEPEND="
	>=sci-libs/gsl-1.14
	virtual/fortran"
RDEPEND="${DEPEND}"
#TODO: make docs

FORTRAN_STANDARD=90

src_prepare() {
	epatch "${FILESDIR}"/${P}-sharedlibs.patch
	use amd64 && ln -s interface/integer_ilp64.finc integer.finc
	use x86 && ln -s interface/integer_ilp32.finc integer.finc
	cat <<- EOF > "${S}/make.inc"
		F90 = $(tc-getFC)
		CC = $(tc-getCC)
		GSL_LIB = $(pkg-config --libs gsl)
		GSL_INC = $(pkg-config --cflags gsl)
		PREFIX = /usr
		ARFLAGS = -csrv
		FPP = -cpp
		LIB = $(get_libdir)
	EOF
	use static-libs && echo "STATIC_LIBS = yes" >> "${S}/make.inc"
}

src_configure() {
	return
}

src_install() {
	dodoc NEWS README
	ln -s lib${PN}.so.0.0.0 lib${PN}.so.0
	ln -s lib${PN}.so.0.0.0 lib${PN}.so
	dolib.so lib${PN}.so*
	insinto /usr/include
	doins ${PN}.mod
	if use static-libs ; then
		newlib.a lib${PN}_$(tc-getFC).a lib${PN}.a
	fi
}