summaryrefslogtreecommitdiff
blob: 2a32fcc8fae89b209f34d7a55c25ee0f3f6bf4c3 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-libs/libcore/libcore-1.7.ebuild,v 1.5 2009/02/02 23:01:37 bicatali Exp $

inherit eutils toolchain-funcs

DESCRIPTION="Robust numerical and geometric computation library"
HOMEPAGE="http://www.cs.nyu.edu/exact/core_pages/"
MYP="${PN/lib}"
SRC_URI="http://cs.nyu.edu/exact/core/download/prerelease/${MYP}_v${PV}x_std.tgz"

LICENSE="QPL-1.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc"

DEPEND="dev-libs/gmp
	doc? ( virtual/latex-base ) "
RDEPEND=""

S="${WORKDIR}/${MYP}_v${PV}x"

src_unpack(){
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/${P}.patch
	sed -i \
		-e "s/-O2/${CXXFLAGS}/g" \
		-e "s/-shared/-shared ${LDFLAGS}/g" \
		Make.config || die
}

src_compile(){
	emake CXX="$(tc-getCXX)" corelib || die "Unable to create corelib"
	emake CXX="$(tc-getCXX)" corex || die "Unable to create corex"
	if use doc; then
		cd "${S}/doc"
		emake all || die "Unable to create doc"
	fi
}

src_install(){
	dolib lib/*.a lib/*.so || die "Unable to find libraries"
	for i in $(find "${D}/usr/lib/" -name "*so" | sed "s:${D}::g"); do
		dosym $i $i.1 && dosym $i $i.1.0.0 || die "Unable to sym $i"
	done

	dodir /usr/include || die "Unable to create include dir"
	cp -r ./inc/* "${D}/usr/include/" || die "Unable to copy headers"

	dodoc FAQs README || die "Unable to install default doc"
	if use doc; then
		dodoc doc/ANNOUNCEMENT* doc/*pdf doc/papers/* || \
			die "Unable to install doc"
	fi
}