/[gentoo-x86]/dev-libs/ntl/ntl-5.5.2.ebuild
Gentoo

Contents of /dev-libs/ntl/ntl-5.5.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu Feb 24 04:56:07 2011 UTC (3 years, 6 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +11 -6 lines
Added static-libs flag and downgrade O3 and above flags to O2 (bug #356087)

(Portage version: 2.1.9.40/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/ntl/ntl-5.5.2.ebuild,v 1.6 2010/12/25 12:07:27 grobian Exp $
4
5 EAPI=3
6 inherit toolchain-funcs eutils multilib flag-o-matic
7
8 DESCRIPTION="High-performance and portable Number Theory C++ library"
9 HOMEPAGE="http://shoup.net/ntl/"
10 SRC_URI="http://www.shoup.net/ntl/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
15 IUSE="doc static-libs test"
16
17 RDEPEND=">=dev-libs/gmp-4.3
18 >=dev-libs/gf2x-0.9"
19 DEPEND="${RDEPEND}
20 dev-lang/perl"
21
22 S="${WORKDIR}/${P}/src"
23
24 src_prepare() {
25 # fix parallel make
26 sed -i -e "s/make/make ${MAKEOPTS}/g" WizardAux || die
27 cd ..
28 # enable compatibility with singular
29 epatch "$FILESDIR/${P}-singular.patch"
30 # implement a call back framework (submitted upstream)
31 epatch "$FILESDIR/${P}-sage-tools.patch"
32 # sanitize the makefile and allow the building of shared library
33 epatch "$FILESDIR/${P}-shared.patch"
34 replace-flags -O[3-9] -O2
35 }
36
37 src_configure() {
38 perl DoConfig \
39 PREFIX="${EPREFIX}"/usr \
40 CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" \
41 CC="$(tc-getCC)" CXX="$(tc-getCXX)" \
42 AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
43 NTL_STD_CXX=on NTL_GMP_LIP=on NTL_GF2X_LIB=on \
44 || die "DoConfig failed"
45 }
46
47 src_compile() {
48 # split the targets to allow parallel make to run properly
49 emake setup1 setup2 || die "emake setup failed"
50 emake setup3 || die "emake setup failed"
51 sh Wizard on || die "Tuning wizard failed"
52 if use static-libs || use test; then
53 emake ntl.a || die "emake static failed"
54 fi
55 local trg=so
56 [[ ${CHOST} == *-darwin* ]] && trg=dylib
57 emake shared${trg} || die "emake shared failed"
58 }
59
60 src_install() {
61 if use static-libs; then
62 newlib.a ntl.a libntl.a || die "installation of static library failed"
63 fi
64 dolib.so lib*$(get_libname) || die "installation of shared library failed"
65
66 cd ..
67 insinto /usr/include
68 doins -r include/NTL || die "installation of the headers failed"
69
70 dodoc README
71 if use doc ; then
72 dodoc doc/*.txt || die
73 dohtml doc/* || die
74 fi
75 }

  ViewVC Help
Powered by ViewVC 1.1.20