summaryrefslogtreecommitdiff
blob: 789549c7763f8876bdf0c859af8b856fac687431 (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
# 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.8.ebuild,v 1.1 2009/02/02 23:01:37 bicatali Exp $

EAPI=2
inherit eutils toolchain-funcs

MYP="${PN/lib}_v${PV}"

DESCRIPTION="Robust numerical and geometric computation library"
HOMEPAGE="http://www.cs.nyu.edu/exact/core_pages/"
SRC_URI="http://cs.nyu.edu/exact/core/download/${MYP}/${MYP}.tgz
	doc? ( http://cs.nyu.edu/exact/core/download/${MYP}/${MYP}_doc.tgz )"

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

DEPEND="dev-libs/gmp"
RDEPEND=""

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

src_prepare() {
	epatch "${FILESDIR}"/${PN}-1.7.patch
	sed -i \
		-e "s/-O2/${CXXFLAGS}/g" \
		-e "s/-shared/-shared ${LDFLAGS}/g" \
		Make.config || die
}

src_compile(){
	emake LINKAGE=shared corelib corex || die "emake shared failed"
	emake -C src clean && emake -C ext clean
	emake corelib corex || die "emake static failed"
	if use doc; then
		cd "${S}/doc"
		emake -j1 all || die "doc creation failed"
		emake -j1 -C doxy/latex pdf || die "pdf doc creation failed"
	fi
}

src_install(){
	dolib lib/*.a lib/*.so || die "Unable to find libraries"
	for i in $(find "${D}/usr/$(get_libdir)" -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/*.txt
		insinto /usr/share/doc/${PF}
		doins doc/papers/* doc/tutorial/tutorial.pdf || die
		doins -r doc/doxy/html doc/doxy/latex/*pdf || die
	fi
}