aboutsummaryrefslogtreecommitdiff
blob: 64518b4ce62d79dd256064256acc5646cf365ad2 (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
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit eutils

MY_PN="FoX"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="A library designed to allow the easy use of XML from Fortran"
HOMEPAGE="http://www1.gly.bris.ac.uk/~walker/FoX/"

LICENSE="BSD ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux"
IUSE="debug doc +dom +fast +sax +wcml +wkml +wxml"

SRC_URI=" doc? ( http://www1.gly.bris.ac.uk/~walker/FoX/source/${MY_P}-full.tar.gz )
	!doc? ( http://www1.gly.bris.ac.uk/~walker/FoX/source/${MY_P}.tar.gz
		dom? ( http://www1.gly.bris.ac.uk/~walker/FoX/source/${MY_P}-dom.tar.gz )
		sax? ( http://www1.gly.bris.ac.uk/~walker/FoX/source/${MY_P}-sax.tar.gz )
		wcml? ( http://www1.gly.bris.ac.uk/~walker/FoX/source/${MY_P}-wcml.tar.gz )
		wkml? ( http://www1.gly.bris.ac.uk/~walker/FoX/source/${MY_P}-wkml.tar.gz )
		wxml? ( http://www1.gly.bris.ac.uk/~walker/FoX/source/${MY_P}-wxml.tar.gz ) )"

S="${WORKDIR}/${MY_P}"

FORTRAN_STANDARD=90

src_prepare() {
	epatch "${FILESDIR}"/4.1.2-r2-install-customizations.patch
}

src_configure() {
		econf --prefix="${EPREFIX}/usr" \
		$(use_enable debug) \
		$(use_enable dom) \
		$(use_enable fast) \
		$(use_enable sax) \
		$(use_enable wcml) \
		$(use_enable wkml) \
		$(use_enable wxml) \
		FCFLAGS="${FCFLAGS:- ${FFLAGS:- -O2}}"
}

src_compile() {
	emake -j1
}

src_test() {
	emake -j1 check || ewarn "make check failed"
	einfo "Please look at the last few RESULT lines for a summary."
}

src_install() {
	sed -i -e's%^comp_prefix=.*$%comp_prefix=${EPREFIX}/usr%' \
		-e's%comp_prefix/finclude%comp_prefix/include%' \
		-e's%\$libdir/lib\([^ ]\+\)\.a\>%-l\1%g' \
		-e's%\(echo\( -I"$moddir"\)\?\) \$LIBS%\1 -L"$libdir" $LIBS%' \
		FoX-config
	emake -j1 DESTDIR="${D}" install
	dodoc README.FoX.txt
	if use doc; then
		dodoc Changelog
		dohtml -r DoX/
	fi
}