diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2009-08-10 23:22:39 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2009-08-10 23:22:39 +0000 |
commit | b7eaaab148e72dd3146e05511ab04a6f01c7ca2e (patch) | |
tree | 471829cac9816ba1a31c32df088275ac1b9509f3 /dev-libs/ntl | |
parent | Version bump, using real packaging system (diff) | |
download | gentoo-2-b7eaaab148e72dd3146e05511ab04a6f01c7ca2e.tar.gz gentoo-2-b7eaaab148e72dd3146e05511ab04a6f01c7ca2e.tar.bz2 gentoo-2-b7eaaab148e72dd3146e05511ab04a6f01c7ca2e.zip |
Version bump. Added gf2x use flag. Modernization, adapted from science overlay, thanks Francois Bissey for his work.
(Portage version: 2.2_rc36/cvs/Linux x86_64)
Diffstat (limited to 'dev-libs/ntl')
-rw-r--r-- | dev-libs/ntl/ChangeLog | 12 | ||||
-rw-r--r-- | dev-libs/ntl/files/linux.mk | 3 | ||||
-rw-r--r-- | dev-libs/ntl/files/ntl-5.5.1-sage-tools.patch | 53 | ||||
-rw-r--r-- | dev-libs/ntl/files/ntl-5.5.1-shared.patch | 191 | ||||
-rw-r--r-- | dev-libs/ntl/files/ntl-5.5.1-singular.patch | 12 | ||||
-rw-r--r-- | dev-libs/ntl/metadata.xml | 9 | ||||
-rw-r--r-- | dev-libs/ntl/ntl-5.5.1.ebuild | 68 |
7 files changed, 346 insertions, 2 deletions
diff --git a/dev-libs/ntl/ChangeLog b/dev-libs/ntl/ChangeLog index 776b73f6695f..3f0aee68d842 100644 --- a/dev-libs/ntl/ChangeLog +++ b/dev-libs/ntl/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for dev-libs/ntl -# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/ntl/ChangeLog,v 1.13 2007/02/18 15:13:09 nixnut Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/ntl/ChangeLog,v 1.14 2009/08/10 23:22:39 bicatali Exp $ + +*ntl-5.5.1 (10 Aug 2009) + + 10 Aug 2009; Sébastien Fabbro <bicatali@gentoo.org> +ntl-5.5.1.ebuild, + +files/ntl-5.5.1-sage-tools.patch, +files/ntl-5.5.1-shared.patch, + +files/ntl-5.5.1-singular.patch, +files/linux.mk, metadata.xml: + Version bump. Added gf2x use flag. Modernization, adapted from science + overlay, thanks Francois Bissey for his work. 18 Feb 2007; nixnut <nixnut@gentoo.org> ntl-5.4-r1.ebuild: Stable on ppc wrt bug 166529 diff --git a/dev-libs/ntl/files/linux.mk b/dev-libs/ntl/files/linux.mk new file mode 100644 index 000000000000..5df3673c3018 --- /dev/null +++ b/dev-libs/ntl/files/linux.mk @@ -0,0 +1,3 @@ +shared: DIRNAME $(SHOBJ) + $(LINK_CXX) $(PICFLAG) -shared -Wl,-soname,lib`cat DIRNAME`.so -o lib`cat DIRNAME`.so $(SHOBJ) $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) + ln -s lib`cat DIRNAME`.so libntl.so diff --git a/dev-libs/ntl/files/ntl-5.5.1-sage-tools.patch b/dev-libs/ntl/files/ntl-5.5.1-sage-tools.patch new file mode 100644 index 000000000000..28914b95b959 --- /dev/null +++ b/dev-libs/ntl/files/ntl-5.5.1-sage-tools.patch @@ -0,0 +1,53 @@ +--- include/NTL/tools.h.orig 2008-05-06 22:14:06.000000000 +1200 ++++ include/NTL/tools.h 2008-05-06 22:14:23.000000000 +1200 +@@ -249,6 +249,12 @@ + char IntValToChar(long a); + + ++/* ++ This function is not present in vanilla NTL 5.4.2. ++ See tools.c for documentation. ++ */ ++void SetErrorCallbackFunction(void (*func)(const char *s, void *context), void *context); ++ + + void Error(const char *s); + +--- src/tools.c.orig 2008-05-06 22:15:32.000000000 +1200 ++++ src/tools.c 2008-05-06 22:15:45.000000000 +1200 +@@ -8,8 +8,35 @@ + NTL_START_IMPL + + ++/* ++ The following code differs from vanilla NTL 5.4.2. ++ ++ We add a SetErrorCallbackFunction(). This sets a global callback function _function_, ++ which gets called with parameter _context_ and an error message string whenever Error() ++ gets called. ++ ++ Note that if the custom error handler *returns*, then NTL will dump the error message ++ back to stderr and abort() as it habitually does. ++ ++ -- David Harvey (2008-04-12) ++*/ ++ ++void (*ErrorCallbackFunction)(const char*, void*) = NULL; ++void *ErrorCallbackContext = NULL; ++ ++ ++void SetErrorCallbackFunction(void (*function)(const char*, void*), void *context) ++{ ++ ErrorCallbackFunction = function; ++ ErrorCallbackContext = context; ++} ++ ++ + void Error(const char *s) + { ++ if (ErrorCallbackFunction != NULL) ++ ErrorCallbackFunction(s, ErrorCallbackContext); ++ + cerr << s << "\n"; + abort(); + } diff --git a/dev-libs/ntl/files/ntl-5.5.1-shared.patch b/dev-libs/ntl/files/ntl-5.5.1-shared.patch new file mode 100644 index 000000000000..91c0bdd6ecde --- /dev/null +++ b/dev-libs/ntl/files/ntl-5.5.1-shared.patch @@ -0,0 +1,191 @@ +--- src/DoConfig.orig 2009-05-05 07:46:39.000000000 +0100 ++++ src/DoConfig 2009-08-10 19:24:43.000000000 +0100 +@@ -25,14 +25,16 @@ + 'LDFLAGS_CXX' => '$(LDFLAGS)', + 'LDLIBS' => '-lm', + 'LDLIBS_CXX' => '$(LDLIBS)', ++'PICFLAG' => '-fPIC', + 'CPPFLAGS' => '', + +-'DEF_PREFIX' => '/usr/local', ++'DEF_PREFIX' => '/usr', + + 'PREFIX' => '$(DEF_PREFIX)', + 'LIBDIR' => '$(PREFIX)/lib', + 'INCLUDEDIR' => '$(PREFIX)/include', + 'DOCDIR' => '$(PREFIX)/share/doc', ++'SHMAKE' => 'non-gld', + + 'GMP_PREFIX' => '$(DEF_PREFIX)', + 'GMP_INCDIR' => '$(GMP_PREFIX)/include', +@@ -87,11 +89,6 @@ + + foreach $arg (@ARGV) { + +- if ($arg =~ '-h|help|-help|--help') { +- system("more ../doc/config.txt"); +- exit; +- } +- + if (($name, $val) = ($arg =~ /(.*?)=(.*)/)) { + + if (exists($MakeFlag{$name}) && ($val =~ 'on|off')) { + + + +--- src/mfile.orig 2009-05-05 07:46:39.000000000 +0100 ++++ src/mfile 2009-08-10 20:31:36.000000000 +0100 +@@ -77,6 +77,11 @@ + # where to install NTL + + ############################################################### ++# choose the appropriate shared object makefile ++############################################################### ++SHMAKE=@{SHMAKE} ++ ++############################################################### + # + # Second, if you want to use GMP (the GNU Multi-Precision library), + # define the variables GMP_OPT_INCDIR, GMP_OPT_LIBDIR, GMP_OPT_LIB below. +@@ -141,6 +146,16 @@ + WIZARD=@{WIZARD} + # Set to off if you want to bypass the wizard; otherwise, set to on. + ++############################################################### ++# ++# New addition for shared library building. With gcc you need to ++# choose the Position Indepent Code flag. You have a choice of ++# -fpic better code but in rare case not available (ppc) ++# -fPIC slightly slower code but guaranted to work anywhere. ++# ++############################################################### ++ ++PICFLAG=@{PICFLAG} + + ################################################################# + # +@@ -173,6 +188,27 @@ + + OBJ=$(O19) + ++SHOBJ=FFT.lo FacVec.lo GF2.lo GF2E.lo GF2EX.lo GF2EXFactoring.lo GF2X.lo GF2X1.lo \ ++ GF2XFactoring.lo GF2XVec.lo GetTime.lo HNF.lo ctools.lo LLL.lo LLL_FP.lo \ ++ LLL_QP.lo LLL_RR.lo LLL_XD.lo RR.lo WordVector.lo ZZ.lo ZZVec.lo \ ++ ZZX.lo ZZX1.lo ZZXCharPoly.lo ZZXFactoring.lo ZZ_p.lo ZZ_pE.lo ZZ_pEX.lo \ ++ ZZ_pEXFactoring.lo ZZ_pX.lo ZZ_pX1.lo ZZ_pXCharPoly.lo ZZ_pXFactoring.lo \ ++ fileio.lo lip.lo lzz_p.lo lzz_pE.lo lzz_pEX.lo lzz_pEXFactoring.lo \ ++ lzz_pX.lo lzz_pX1.lo lzz_pXCharPoly.lo lzz_pXFactoring.lo \ ++ mat_GF2.lo mat_GF2E.lo mat_RR.lo mat_ZZ.lo mat_ZZ_p.lo \ ++ mat_ZZ_pE.lo mat_lzz_p.lo mat_lzz_pE.lo mat_poly_ZZ.lo \ ++ mat_poly_ZZ_p.lo mat_poly_lzz_p.lo pair_GF2EX_long.lo \ ++ pair_GF2X_long.lo pair_ZZX_long.lo pair_ZZ_pEX_long.lo \ ++ pair_ZZ_pX_long.lo pair_lzz_pEX_long.lo pair_lzz_pX_long.lo \ ++ quad_float.lo tools.lo vec_GF2.lo vec_GF2E.lo vec_GF2XVec.lo \ ++ vec_RR.lo vec_ZZ.lo vec_ZZVec.lo vec_ZZ_p.lo vec_ZZ_pE.lo \ ++ vec_double.lo vec_long.lo vec_lzz_p.lo vec_lzz_pE.lo vec_quad_float.lo \ ++ vec_vec_GF2.lo vec_vec_GF2E.lo vec_vec_RR.lo vec_vec_ZZ.lo \ ++ vec_vec_ZZ_p.lo vec_vec_ZZ_pE.lo vec_vec_long.lo vec_vec_lzz_p.lo \ ++ vec_vec_lzz_pE.lo vec_xdouble.lo xdouble.lo \ ++ G_LLL_FP.lo G_LLL_QP.lo G_LLL_XD.lo G_LLL_RR.lo vec_ulong.lo vec_vec_ulong.lo ++ ++ + # library source files + + +@@ -320,7 +356,7 @@ + LINK = $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + LINK_CXX = $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS_CXX) + +- ++.SUFFIXES: .lo + + # 'make all' does a complete make, including all setup. + # It also creates the file 'all', which means you should +@@ -328,11 +364,11 @@ + # again. + + all: +- make setup1 +- make setup2 +- make setup3 +- make setup4 +- make ntl.a ++ $(MAKE) setup1 ++ $(MAKE) setup2 ++ $(MAKE) setup3 ++ $(MAKE) setup4 ++ $(MAKE) ntl.a + touch all + + +@@ -378,18 +414,31 @@ + lip.o: lip.c g_lip_impl.h c_lip_impl.h lip_gmp_aux_impl.h + $(LCOMP) $(COMPILE) $(GMP_OPT_INCDIR) lip.c + ++lip.lo: lip.c g_lip_impl.h c_lip_impl.h lip_gmp_aux_impl.h ++ $(LCOMP) $(COMPILE) $(PICFLAG) $(GMP_INCDIR) lip.c -o lip.lo ++ ++ ++ + ctools.o: ctools.c + $(LCOMP) $(COMPILE) ctools.c + ++ctools.lo: ctools.c ++ $(LCOMP) $(COMPILE) $(PICFLAG) ctools.c -o ctools.lo ++ + + GetTime.o: GetTime.c + $(LCOMP) $(COMPILE) GetTime.c + +- ++GetTime.lo: GetTime.c ++ $(LCOMP) $(COMPILE) $(PICFLAG) GetTime.c -o GetTime.lo + + .c.o: + $(LCOMP) $(COMPILE_CXX) $(GF2X_OPT_INCDIR) $< + ++.c.lo: ++ $(LCOMP) $(COMPILE_CXX) $(PICFLAG) $(GF2X_OPT_INCDIR) -o $@ $< ++ ++ + .c: + @{LSTAT} $(LINK_CXX) -o $@ $< ntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) $(LDLIBS_CXX) #LSTAT + @{LSHAR} $(LIBTOOL) --mode=link $(LINK_CXX) -o $@ $< libntl.la #LSHAR +@@ -403,7 +452,7 @@ + + check: + sh RemoveProg $(PROGS) +- make QuickTest ++ $(MAKE) QuickTest + ./QuickTest + sh RemoveProg QuickTest + sh TestScript +@@ -460,19 +509,18 @@ + # + ################################################################# + +-clobber: ++clobber: clean + rm -f ntl.a mach_desc.h ../include/NTL/mach_desc.h GetTime.c + rm -f lip_gmp_aux_impl.h ../include/NTL/gmp_aux.h +- sh RemoveProg $(PROGS) MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux +- rm -f *.o +- rm -rf small ++ sh RemoveProg $(PROGS) ++ rm -f libntl*.so* + rm -f cfileout mfileout + rm -rf .libs *.lo libntl.la + rm -f all + + clean: + sh RemoveProg MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux +- rm -f *.o ++ rm -f *.o *.lo + rm -rf small + @{LSHAR} - $(LIBTOOL) --mode=clean rm -f libntl.la *.lo #LSHAR + +@@ -549,3 +597,4 @@ + + + ++sinclude $(SHMAKE).mk diff --git a/dev-libs/ntl/files/ntl-5.5.1-singular.patch b/dev-libs/ntl/files/ntl-5.5.1-singular.patch new file mode 100644 index 000000000000..9f0d13140cee --- /dev/null +++ b/dev-libs/ntl/files/ntl-5.5.1-singular.patch @@ -0,0 +1,12 @@ +--- include/NTL/new.h.orig 2008-05-06 21:56:16.000000000 +1200 ++++ include/NTL/new.h 2008-05-06 21:56:33.000000000 +1200 +@@ -12,7 +12,8 @@ + + #include <new> + +-#define NTL_NEW_OP new (std::nothrow) ++// uncommenting std::nothrow makes this ntl work properly with Singular ++#define NTL_NEW_OP new //(std::nothrow) + + + #else diff --git a/dev-libs/ntl/metadata.xml b/dev-libs/ntl/metadata.xml index 8434377a6047..261aa0426845 100644 --- a/dev-libs/ntl/metadata.xml +++ b/dev-libs/ntl/metadata.xml @@ -2,4 +2,13 @@ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <herd>cpp</herd> +<longdescription lang="en"> + NTL is a high-performance, portable C++ library providing data + structures and algorithms for manipulating signed, arbitrary length + integers, and for vectors, matrices, and polynomials over the + integers and over finite fields. +</longdescription> +<use> + <flag name='gf2x'>Use high performance polynomial arithmetic with <pkg>dev-libs/gf2x</pkg></flag> +</use> </pkgmetadata> diff --git a/dev-libs/ntl/ntl-5.5.1.ebuild b/dev-libs/ntl/ntl-5.5.1.ebuild new file mode 100644 index 000000000000..4f9bf1772ccf --- /dev/null +++ b/dev-libs/ntl/ntl-5.5.1.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/ntl/ntl-5.5.1.ebuild,v 1.1 2009/08/10 23:22:39 bicatali Exp $ + +EAPI=2 +inherit toolchain-funcs eutils + +DESCRIPTION="High-performance and portable Number Theory C++ library" +HOMEPAGE="http://shoup.net/ntl/" +SRC_URI="http://www.shoup.net/ntl/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc +gf2x +gmp" + +RDEPEND="gmp? ( >=dev-libs/gmp-4.3 ) + gf2x? ( >=dev-libs/gf2x-0.9 )" +DEPEND="${RDEPEND} + dev-lang/perl" + +S="${WORKDIR}/${P}/src" + +src_prepare() { + cd .. + # enable compatibility with singular + epatch "$FILESDIR/${P}-singular.patch" + # implement a call back framework ( submitted upstream) + epatch "$FILESDIR/${P}-sage-tools.patch" + # sanitize the makefile and allow the building of shared library + epatch "$FILESDIR/${P}-shared.patch" + cp "${FILESDIR}/linux.mk" src/ +} + +src_configure() { + local myconf + use gmp && myconf="${myconf} NTL_GMP_LIP=on" + use gf2x && myconf="${myconf} NTL_GF2X_LIB=on" + perl DoConfig \ + PREFIX=/usr \ + ${myconf} \ + CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" \ + CC="$(tc-getCC)" CXX="$(tc-getCXX)" \ + AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \ + NTL_STD_CXX=on SHMAKE=linux \ + || die "DoConfig failed" +} + +src_compile() { + # scripts convoluted in makefile make it hard to parallel make + emake -j1 || die "emake failed" + emake shared || die "emake shared failed" +} + +src_install() { + newlib.a ntl.a libntl.a || die "installation of static library failed" + dolib.so lib*.so || die "installation of shared library failed" + + cd .. + insinto /usr/include + doins -r include/NTL || die "installation of the headers failed" + + dodoc README + if use doc ; then + dodoc doc/*.txt + dohtml doc/* + fi +} |