summaryrefslogtreecommitdiff
blob: cd7f1248299735573650b86620573bf9c11b46a8 (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-libs/arprec/arprec-2.2.2.ebuild,v 1.5 2011/06/21 15:42:20 jlec Exp $

EAPI=2

inherit eutils fortran-2

DESCRIPTION="Arbitrary precision float arithmetics and functions"
HOMEPAGE="http://crd.lbl.gov/~dhbailey/mpdist/"
SRC_URI="http://crd.lbl.gov/~dhbailey/mpdist/${P}.tar.gz"

SLOT="0"
LICENSE="BSD"
KEYWORDS="~x86"
IUSE="fortran qd"

DEPEND="
	fortran? ( virtual/fortran )
	qd? ( sci-libs/qd )"
RDEPEND="${DEPEND}"

pkg_setup() {
	use fortran && fortran-2_pkg_setup
}

src_prepare() {
	# bug #273996
	epatch "${FILESDIR}"/${P}-gcc44.patch
}

src_configure() {
	econf \
		$(use_enable fortran enable_fortran) \
		$(use_enable qd enable_qd)
}

src_compile() {
	emake || die "emake failed"
	if use fortran; then
		emake toolkit || die "emake toolkit failed"
	fi
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc README AUTHORS NEWS TODO || die "dodoc failed"
	if use fortran; then
		cd toolkit
		./mathinit || die "mathinit failed"
		exeinto /usr/libexec/${PN}
		doexe mathtool || die "mathtool install failed"
		insinto /usr/libexec/${PN}
		doins *.dat || die "mathtool data install failed"
		docinto toolkit
		dodoc README || die "mathtool doc install failed"
	fi
	cd "${D}"/usr/share/doc || die "cd failed"
	mv ${PN}/${PN}.pdf ${PF}/ || die "mv failed"
	rm -rf ${PN}/ || die "rm failed"
}