summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sci-mathematics/singular
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sci-mathematics/singular')
-rw-r--r--sci-mathematics/singular/Manifest4
-rw-r--r--sci-mathematics/singular/files/60singular-gentoo.el10
-rw-r--r--sci-mathematics/singular/files/singular-3.0.4.4-nostrip.patch12
-rw-r--r--sci-mathematics/singular/files/singular-3.1.0-emacs-22.patch13
-rw-r--r--sci-mathematics/singular/files/singular-3.1.0-gentoo.patch81
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.2-python.patch45
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3-Minor.h.patch10
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3-install_name.patch23
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3-os_x_ppc.patch14
-rw-r--r--sci-mathematics/singular/files/singular-3.1.3.3.make_parallel.2.patch45
-rw-r--r--sci-mathematics/singular/files/singular-3.1.6-factory_template_instantiation.patch26
-rw-r--r--sci-mathematics/singular/files/singular-3.1.6-ntl6compat.patch44
-rw-r--r--sci-mathematics/singular/files/singular-4.0.0-fix-omalloc-ar-detection.patch12
-rw-r--r--sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch38
-rw-r--r--sci-mathematics/singular/metadata.xml12
-rw-r--r--sci-mathematics/singular/singular-3.1.6.ebuild176
-rw-r--r--sci-mathematics/singular/singular-4.0.2.ebuild145
17 files changed, 710 insertions, 0 deletions
diff --git a/sci-mathematics/singular/Manifest b/sci-mathematics/singular/Manifest
new file mode 100644
index 000000000000..6d7beb859000
--- /dev/null
+++ b/sci-mathematics/singular/Manifest
@@ -0,0 +1,4 @@
+DIST Singular-3-1-6-share.tar.gz 10620177 SHA256 c74a97b7eb8ed53417682637fe11c2480aeb1a6cbf4a8db27a1b16a162e83c4d SHA512 54bff29c5d64609583ec8b1c43005a1ff453c8f2cedfe9a26ac840888e9d306e3104e14aea5a3cc923fac916215c4285ecfe5ae7e1242aee0308b5e4c6e2d48d WHIRLPOOL a1edc8fa9cad189af413870b0e63316e135e8456075f13b3d8036afafd6c25f4bcc854432cdcb8c2ec690c63b43f616367aa9f1027c096e95f22aa0508943f67
+DIST Singular-3-1-6.tar.gz 25535111 SHA256 7956a17a0b5d428fea25bc0bc6c19c753748fb98bb2926c49b9fbcbec94172ff SHA512 103a10dd474d93cceb678bcef1a4aae5ec693cb9e68c9d63a7536929b738a0127501ee145a79cc3b9ddfa4bd1ca0f05e640eeb3b0fbdb60de4f56aa5beacc213 WHIRLPOOL 71ef6d505f7c8b2eeacd46666640d7b3c79f75d6c2c858b135553b1fb3a9dd7d88df74924009468c32aa4aa748b88ccb7762010ab4d36eec420a07fd36e8dd22
+DIST singular-4.0.2-share.tar.gz 8789162 SHA256 fe81cb100f3b73b159eb4a8122a29bc0f7705ef6f62ad55b68b5582c1ec0642d SHA512 068827df04a5d1b4407dbaab1296d0120071dc109b749037b02263d51906852a5c2c1ef321733953a181c2d3d0fe799c197ef0af3b9341810ecf31a5324e0a25 WHIRLPOOL 615487e95e32d9f07552e92ebcd46e3071d110dd31e7d980b01340d22a5205ba2d771532fad1bf44863a38820428157284a171e0b901861fda6e51482d546adc
+DIST singular-4.0.2.tar.gz 8635172 SHA256 c105a2c8ace0b3c9189b782ed63660ce235407d0160907c2cafc2128d36d8cb7 SHA512 4543a45839ce8adc45e3b2edd84a6e398b7ba157da1eda050dbce2a8b20333eb0c63433e3e7eaf59d76bf6bcb65c1b1611bfc08c25fd493c88e2f06624898e3d WHIRLPOOL fe30bc87c6b403b2e30bd1c016aeeb015c2a64a63d87b81536dc53a2555ac068f3e0c6d8763775d8be5e5e1a935aadab1c86b603cbb698234a19cc9cfffac282
diff --git a/sci-mathematics/singular/files/60singular-gentoo.el b/sci-mathematics/singular/files/60singular-gentoo.el
new file mode 100644
index 000000000000..7be8c08ef7e9
--- /dev/null
+++ b/sci-mathematics/singular/files/60singular-gentoo.el
@@ -0,0 +1,10 @@
+
+;; site-file for sci-mathematics/singular
+
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'singular "singular"
+ "Start Singular using default values." t)
+(autoload 'singular-other "singular"
+ "Ask for arguments and start Singular." t)
+
+(add-to-list 'auto-mode-alist '("\\.sing\\'" . c++-mode))
diff --git a/sci-mathematics/singular/files/singular-3.0.4.4-nostrip.patch b/sci-mathematics/singular/files/singular-3.0.4.4-nostrip.patch
new file mode 100644
index 000000000000..5884b6cd2d60
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.0.4.4-nostrip.patch
@@ -0,0 +1,12 @@
+diff -Naur Singular-3-0-4/IntegerProgramming/Makefile.in Singular-3-0-4.new/IntegerProgramming/Makefile.in
+--- Singular-3-0-4/IntegerProgramming/Makefile.in 2008-07-09 07:55:13.000000000 -0400
++++ Singular-3-0-4.new/IntegerProgramming/Makefile.in 2008-10-19 22:40:41.000000000 -0400
+@@ -21,7 +21,7 @@
+ endif
+
+ INSTALL = @INSTALL@
+-INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ MKINSTALLDIRS = ../mkinstalldirs
+
+ ##
diff --git a/sci-mathematics/singular/files/singular-3.1.0-emacs-22.patch b/sci-mathematics/singular/files/singular-3.1.0-emacs-22.patch
new file mode 100644
index 000000000000..3f4f3c76203c
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.0-emacs-22.patch
@@ -0,0 +1,13 @@
+diff -Naur Singular-3-1-0/emacs/singular.el Singular-3-1-0.new/emacs/singular.el
+--- Singular-3-1-0/emacs/singular.el 2008-11-03 09:16:38.000000000 -0500
++++ Singular-3-1-0.new/emacs/singular.el 2009-08-20 22:16:57.000000000 -0400
+@@ -865,7 +865,8 @@
+ (add-hook 'singular-post-output-filter-functions 'singular-prompt-remove-filter nil t)
+
+ ;; some relict from Comint mode
+- (setq comint-prompt-regexp singular-comint-prompt-regexp))
++ (setq comint-prompt-regexp singular-comint-prompt-regexp)
++ (setq comint-use-prompt-regexp-instead-of-fields 1))
+ ;; required to use prompt-regexp
+ (setq comint-use-prompt-regexp t)
+ ;;}}}
diff --git a/sci-mathematics/singular/files/singular-3.1.0-gentoo.patch b/sci-mathematics/singular/files/singular-3.1.0-gentoo.patch
new file mode 100644
index 000000000000..ebb402289386
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.0-gentoo.patch
@@ -0,0 +1,81 @@
+--- kernel/feResource.cc.orig 2010-04-30 10:20:14.000000000 +0000
++++ kernel/feResource.cc 2010-10-11 09:19:01.431179334 +0000
+@@ -41,7 +41,7 @@
+ #define SINGULAR_DEFAULT_DIR "/usr/local/Singular/"S_VERSION1
+ #endif
+ #else // ! defined(MAKE_DISTRIBUTION)
+-#define SINGULAR_DEFAULT_DIR S_ROOT_DIR
++#define SINGULAR_DEFAULT_DIR "@GENTOO_PORTAGE_EPREFIX@/usr"
+ #endif // defined(MAKE_DISTRIBUTION)
+
+ /*****************************************************************
+@@ -73,33 +73,31 @@
+ {
+ {"SearchPath", 's', feResPath, NULL,
+ "$SINGULARPATH;"
+- "%b/LIB;"
+- "%b/MOD;"
++ "%r/share/singular/MOD;"
+ "%r/LIB;"
+- "%r/../LIB;"
++ "%r/share/singular/LIB;"
+ "%d/LIB;"
+- "%d/../LIB"
+ ""},
+- {"Singular", 'S', feResBinary,"SINGULAR_EXECUTABLE", "%d/"S_UNAME"/Singular",(char *)""},
+- {"BinDir", 'b', feResDir, "SINGULAR_BIN_DIR", "%d/"S_UNAME, (char *)""},
+- {"RootDir", 'r', feResDir, "SINGULAR_ROOT_DIR", "%b/..", (char *)""},
++ {"Singular", 'S', feResBinary,"SINGULAR_EXECUTABLE", "%d/bin/Singular",(char *)""},
++ {"BinDir", 'b', feResDir, "SINGULAR_BIN_DIR", "%d/bin", (char *)""},
++ {"RootDir", 'r', feResDir, "SINGULAR_ROOT_DIR", "%d", (char *)""},
+ {"DefaultDir",'d', feResDir, "SINGULAR_DEFAULT_DIR", SINGULAR_DEFAULT_DIR, (char *)""},
+- {"InfoFile", 'i', feResFile, "SINGULAR_INFO_FILE", "%r/info/singular.hlp", (char *)""},
+- {"IdxFile", 'x', feResFile, "SINGULAR_IDX_FILE", "%r/doc/singular.idx", (char *)""},
+- {"HtmlDir", 'h', feResDir, "SINGULAR_HTML_DIR", "%r/html", (char *)""},
++ {"InfoFile", 'i', feResFile, "SINGULAR_INFO_FILE", "%r/share/info/singular.info.bz2", (char *)""},
++ {"IdxFile", 'x', feResFile, "SINGULAR_IDX_FILE", "%r/share/singular/singular.idx", (char *)""},
++ {"HtmlDir", 'h', feResDir, "SINGULAR_HTML_DIR", "%r/share/doc/PFSUBST/html", (char *)""},
+ #ifdef ix86_Win
+ {"HtmlHelpFile",'C', feResFile, "SINGULAR_CHM_FILE", "%r/doc/Manual.chm", (char *)""},
+ #endif
+ {"ManualUrl", 'u', feResUrl, "SINGULAR_URL", "http://www.singular.uni-kl.de/Manual/"S_VERSION1, (char *)""},
+- {"ExDir", 'm', feResDir, "SINGULAR_EXAMPLES_DIR","%r/examples", (char *)""},
++ {"ExDir", 'm', feResDir, "SINGULAR_EXAMPLES_DIR","%r/share/doc/PFSUBST/examples", (char *)""},
+ {"Path", 'p', feResPath, NULL, "%b;$PATH", (char *)""},
+
+ #ifdef ESINGULAR
+ {"emacs", 'E', feResBinary,"ESINGULAR_EMACS", "%b/emacs", (char *)""},
+ {"xemacs", 'A', feResBinary,"ESINGULAR_EMACS", "%b/xemacs", (char *)""},
+ {"SingularEmacs",'M', feResBinary,"ESINGULAR_SINGULAR", "%b/Singular", (char *)""},
+- {"EmacsLoad", 'l', feResFile, "ESINGULAR_EMACS_LOAD", "%e/.emacs-singular", (char *)""},
+- {"EmacsDir", 'e', feResDir, "ESINGULAR_EMACS_DIR", "%r/emacs", (char *)""},
++ {"EmacsLoad", 'l', feResFile, "ESINGULAR_EMACS_LOAD", "%r/share/emacs/site-lisp/singular/.emacs-singular", (char *)""},
++ {"EmacsDir", 'e', feResDir, "ESINGULAR_EMACS_DIR", "%r/share/emacs/site-lisp/singular", (char *)""},
+ #elif defined(TSINGULAR)
+ {"SingularXterm",'M', feResBinary,"TSINGULAR_SINGULAR", "%b/Singular", (char *)""},
+ #ifdef ix86_Win
+@@ -108,7 +106,7 @@
+ {"xterm", 'X', feResBinary,"XTERM", "%b/xterm", (char *)""},
+ #endif
+ #else
+- {"EmacsDir", 'e', feResDir, "SINGULAR_EMACS_DIR", "%r/emacs", (char *)""},
++ {"EmacsDir", 'e', feResDir, "SINGULAR_EMACS_DIR", "%r/share/emacs/site-lisp/singular", (char *)""},
+ #endif
+ {NULL, 0, feResUndef, NULL, NULL, NULL}, // must be the last record
+ };
+--- kernel/mod_raw.cc.orig 2009-11-02 10:12:22.000000000 +0000
++++ kernel/mod_raw.cc 2010-10-11 09:19:01.432179264 +0000
+@@ -109,11 +109,11 @@
+ void* dynl_open_binary_warn(const char* binary_name, const char* msg)
+ {
+ void* handle = NULL;
+- const char* bin_dir = feGetResource('b');
++ const char* bin_dir = feGetResource('r');
+ if (bin_dir != NULL)
+ {
+ char path_name[MAXPATHLEN];
+- sprintf(path_name, "%s%s%s.%s", bin_dir, DIR_SEPP, binary_name,
++ sprintf(path_name, "%s%s%s%s.%s", bin_dir,"/lib/singular", DIR_SEPP, binary_name,
+ DL_TAIL);
+ handle = dynl_open(path_name);
+ if (handle == NULL && ! warn_handle)
diff --git a/sci-mathematics/singular/files/singular-3.1.3.2-python.patch b/sci-mathematics/singular/files/singular-3.1.3.2-python.patch
new file mode 100644
index 000000000000..2cc29c9a553b
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.3.2-python.patch
@@ -0,0 +1,45 @@
+--- Singular/pyobject.cc.orig 2011-01-31 15:03:16.000000000 +0100
++++ Singular/pyobject.cc 2011-08-24 17:22:57.000000000 +0200
+@@ -14,7 +14,7 @@
+
+
+
+-
++#include <Python.h>
+
+ #include <Singular/mod2.h>
+
+@@ -27,7 +27,7 @@
+
+ #include <Singular/lists.h>
+
+-#include <Python.h>
++
+ #include <iterator> // std::distance
+ #include <stdio.h>
+
+@@ -592,11 +592,12 @@
+ long len = newElts.size();
+ for (long idx = 0; idx < len; ++idx)
+ {
+- char* name = newElts[idx][0].str();
++ PythonObject current (newElts[idx]);
++ char* name = current.operator[](0).str();
+ if (name && (*name != '\0') && (*name != '_'))
+ {
+ Py_XDECREF(get_current_definition(name));
+- newElts[idx][1].import_as(name);
++ newElts[idx].operator[](1).import_as(name);
+ }
+
+ }
+--- Singular/pyobject_setup.cc.orig 2011-02-10 19:15:30.000000000 +0100
++++ Singular/pyobject_setup.cc 2011-08-24 17:23:55.000000000 +0200
+@@ -12,6 +12,7 @@
+ **/
+ //*****************************************************************************
+
++#include <Python.h>
+ #include <Singular/mod2.h>
+ #include <kernel/febase.h>
+ #include "static.h"
diff --git a/sci-mathematics/singular/files/singular-3.1.3.3-Minor.h.patch b/sci-mathematics/singular/files/singular-3.1.3.3-Minor.h.patch
new file mode 100644
index 000000000000..1d03e61ae308
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.3.3-Minor.h.patch
@@ -0,0 +1,10 @@
+--- src/Singular/Minor.h 2010-02-02 08:22:24.000000000 -0500
++++ patches/Minor.h 2011-06-28 13:26:01.000000000 -0400
+@@ -2,6 +2,7 @@
+ #define MINOR_H
+
+ #include <assert.h>
++#include <time.h>
+ #include <iostream>
+ #include <string>
+
diff --git a/sci-mathematics/singular/files/singular-3.1.3.3-install_name.patch b/sci-mathematics/singular/files/singular-3.1.3.3-install_name.patch
new file mode 100644
index 000000000000..6a7826c390f6
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.3.3-install_name.patch
@@ -0,0 +1,23 @@
+--- kernel/Makefile.in.orig 2011-10-13 23:36:54.000000000 +0200
++++ kernel/Makefile.in 2011-10-13 23:37:46.000000000 +0200
+@@ -267,7 +267,7 @@
+ -rm -f p_Procs_Dynamic p_Procs_Dynamic.exe
+
+ p_Procs_%.so: p_Procs_Lib_%.dl_o
+- $(LD) ${SLDFLAGS} -o $@ $^
++ $(LD) ${SLDFLAGS} -install_name @GENTOO_PORTAGE_EPREFIX@/usr/lib/singular/$@ -o $@ $^
+
+ ##
+ ## install targets
+
+--- Singular/Makefile.in.orig 2011-10-14 23:59:07.000000000 +0200
++++ Singular/Makefile.in 2011-10-14 23:58:34.000000000 +0200
+@@ -492,7 +492,7 @@
+ $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS} ${GLIBC_DYN_FIX}
+
+ dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
+- $(LD) ${SLDFLAGS} -o $@ $^ ${GLIBC_DYN_FIX}
++ $(LD) ${SLDFLAGS} -install_name @GENTOO_PORTAGE_EPREFIX@/usr/lib/singular/$@ -o $@ $^ ${GLIBC_DYN_FIX}
+
+ # dynamic module for python bject support
+ pyobject.${MODULE_SUFFIX}: pyobject.dl_o
diff --git a/sci-mathematics/singular/files/singular-3.1.3.3-os_x_ppc.patch b/sci-mathematics/singular/files/singular-3.1.3.3-os_x_ppc.patch
new file mode 100644
index 000000000000..e0c54f465548
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.3.3-os_x_ppc.patch
@@ -0,0 +1,14 @@
+diff -r -u src/kernel/mod_raw.cc src.osx/kernel/mod_raw.cc
+--- src/kernel/mod_raw.cc 2011-04-25 08:25:05.000000000 +0200
++++ src.osx/kernel/mod_raw.cc 2011-10-10 10:47:17.000000000 +0200
+@@ -172,6 +172,10 @@
+ #define HAVE_ELF_SYSTEM
+ #endif
+
++#if defined(ppcMac_darwin)
++#define HAVE_ELF_SYSTEM
++#endif
++
+ #if defined(ix86Mac_darwin)
+ #define HAVE_ELF_SYSTEM
+ #endif
diff --git a/sci-mathematics/singular/files/singular-3.1.3.3.make_parallel.2.patch b/sci-mathematics/singular/files/singular-3.1.3.3.make_parallel.2.patch
new file mode 100644
index 000000000000..8eeaed88d9fb
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.3.3.make_parallel.2.patch
@@ -0,0 +1,45 @@
+diff -ru src/Makefile.in src.parallel/Makefile.in
+--- src/Makefile.in 2011-08-10 19:47:17.000000000 +0200
++++ src.parallel/Makefile.in 2011-12-10 13:40:18.000000000 +0100
+@@ -146,14 +146,14 @@
+ rm -rf configure
+
+ clean mostlyclean: local-clean
+- $(recurse)
++ +$(recurse)
+
+ distclean: local-distclean
+- $(recurse)
++ +$(recurse)
+ rm -rf build
+
+ maintainer-clean: uninstall local-maintainer-clean
+- $(recurse)
++ +$(recurse)
+
+ ##############################################################
+ # some extra targets for the specific packages
+diff -ru src/Singular/Makefile.in src.parallel/Singular/Makefile.in
+--- src/Singular/Makefile.in 2011-09-30 12:10:15.000000000 +0200
++++ src.parallel/Singular/Makefile.in 2011-12-10 13:39:41.000000000 +0100
+@@ -413,7 +413,7 @@
+
+ cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc version.h
+
+-misc_ip.o emacs.o tesths.o: version.h
++misc_ip.o emacs.o tesths.o: feOpt.inc version.h
+
+ claptmpl.o: claptmpl.cc mod2.h
+ ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -c $<
+diff -ru src/kernel/Makefile.in src.parallel/kernel/Makefile.in
+--- src/kernel/Makefile.in 2011-05-18 09:37:59.000000000 +0200
++++ src.parallel/kernel/Makefile.in 2011-12-10 13:39:41.000000000 +0100
+@@ -243,7 +243,7 @@
+
+ # Hmm compiling with -fomit-frame-pointer resulted in access violation
+ # under cygwin
+-prCopy.o: prCopy.inc
++prCopy.o prCopy.og prCopy.op: prCopy.inc
+
+ prCopy.inc : prCopyMacros.h prCopyTemplate.cc prCopy.pl
+ $(PERL) prCopy.pl > prCopy.xx && mv prCopy.xx prCopy.inc
diff --git a/sci-mathematics/singular/files/singular-3.1.6-factory_template_instantiation.patch b/sci-mathematics/singular/files/singular-3.1.6-factory_template_instantiation.patch
new file mode 100644
index 000000000000..edf764a758eb
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.6-factory_template_instantiation.patch
@@ -0,0 +1,26 @@
+diff --git a/libfac/factor/tmpl_inst.cc b/libfac/factor/tmpl_inst.cc
+index bda287a..2f5ba49 100644
+Index: libfac/factor/tmpl_inst.cc
+===================================================================
+--- a/libfac/factor/tmpl_inst.cc
++++ b/libfac/factor/tmpl_inst.cc
+@@ -3,7 +3,7 @@
+ ////////////////////////////////////////////////////////////
+
+
+-//#include <templates/ftmpl_array.cc>
++#include <factory/templates/ftmpl_array.cc>
+ //#include <templates/ftmpl_factor.cc>
+ #include <templates/ftmpl_list.h>
+ #include <factory/templates/ftmpl_list.cc>
+@@ -75,8 +75,8 @@ template OSTREAM & operator << ( OSTREAM &, const List<Variable> & );
+ template OSTREAM & operator << ( OSTREAM &, const Array<int> & );
+ #endif
+
+-template class Array<int>;
+-template class Array<Variable>;
++//template class Array<int>;
++//template class Array<Variable>;
+ //template class Array<REvaluation>;
+
+ // for database
diff --git a/sci-mathematics/singular/files/singular-3.1.6-ntl6compat.patch b/sci-mathematics/singular/files/singular-3.1.6-ntl6compat.patch
new file mode 100644
index 000000000000..b0330ccdfc86
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-3.1.6-ntl6compat.patch
@@ -0,0 +1,44 @@
+diff --git a/Singular/claptmpl.cc b/Singular/claptmpl.cc
+index 0fa6109..553afa5 100644
+Index: Singular/claptmpl.cc
+===================================================================
+--- a/Singular/claptmpl.cc
++++ b/Singular/claptmpl.cc
+@@ -123,3 +123,37 @@ template class std::list<PolyMinorValue>;
+ template class Cache<MinorKey, IntMinorValue>;
+ template class Cache<MinorKey, PolyMinorValue>;
+
++#ifdef HAVE_NTL
++#include<NTL/version.h>
++#if NTL_MAJOR_VERSION == 6
++
++#include<NTL/tools.h>
++#include<NTL/lzz_pE.h>
++#include<NTL/lzz_pEX.h>
++#include<NTL/lzz_p.h>
++#include<NTL/vector.h>
++#include<NTL/pair.h>
++#include<NTL/GF2X.h>
++#include<NTL/GF2EX.h>
++#include<NTL/ZZ.h>
++#include<NTL/ZZX.h>
++#include<NTL/ZZ_pX.h>
++#ifdef NTL_CLIENT // in <NTL/tools.h>: using of name space NTL
++NTL_CLIENT
++#endif
++template class Vec<zz_p>;
++template class Vec<zz_pE>;
++template class Mat<zz_p>;
++template class Mat<zz_pE>;
++template class Mat<ZZ>;
++template class Vec<Pair<zz_pEX, long> >;
++template class Vec<Pair<GF2EX, long> >;
++template class Vec<Pair<ZZX, long> >;
++template class Vec<Pair<ZZ_pX, long> >;
++template class Vec<Pair<GF2X, long> >;
++template void swap<zz_pE>(Vec<zz_pE>&, Vec<zz_pE>&);
++template long operator==<zz_p>(Vec<zz_p> const&, Vec<zz_p> const&);
++template Vec<Pair<zz_pX, long> >& Vec<Pair<zz_pX, long> >::operator=(const Vec<Pair<zz_pX, long> >&);
++#endif
++
++#endif
diff --git a/sci-mathematics/singular/files/singular-4.0.0-fix-omalloc-ar-detection.patch b/sci-mathematics/singular/files/singular-4.0.0-fix-omalloc-ar-detection.patch
new file mode 100644
index 000000000000..87b44234af5f
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-4.0.0-fix-omalloc-ar-detection.patch
@@ -0,0 +1,12 @@
+diff -U 3 -dHrN singular-4.0.0.orig/omalloc/configure.ac singular-4.0.0/omalloc/configure.ac
+--- singular-4.0.0.orig/omalloc/configure.ac 2014-03-06 18:07:49.000000000 +0100
++++ singular-4.0.0/omalloc/configure.ac 2014-05-09 15:41:19.755097185 +0200
+@@ -117,7 +117,7 @@
+ dnl check for programs
+ dnl
+ AC_CHECK_PROG(AR, ar, ar, :)
+-if test "$ac_cv_prog_AR" != ar; then
++if test "$ac_cv_prog_AR" = no; then
+ AC_MSG_ERROR(*** ar program not found)
+ fi
+ AC_CHECK_PROGS(PERL, perl, "no")
diff --git a/sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch b/sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch
new file mode 100644
index 000000000000..d3e6b77a28e9
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch
@@ -0,0 +1,38 @@
+diff --git a/factory/NTLconvert.cc b/factory/NTLconvert.cc
+index 41ce9b2..e32093d 100644
+--- a/factory/NTLconvert.cc
++++ b/factory/NTLconvert.cc
+@@ -30,6 +30,7 @@
+ #include <NTL/GF2EXFactoring.h>
+ #include <NTL/tools.h>
+ #include <NTL/mat_ZZ.h>
++#include <NTL/version.h>
+ #include "int_int.h"
+ #include <limits.h>
+ #include "NTLconvert.h"
+@@ -500,8 +501,14 @@ convertZZ2CF (const ZZ & a)
+ return CanonicalForm(coeff_long);
+ }
+ else
+- {
+- long sizeofrep= ((long *) a.rep) [1];
++ {
++ const long * rep =
++#if NTL_MAJOR_VERSION <= 6
++ static_cast<long *>( a.rep );
++#else
++ static_cast<long *>( a.rep.rep ); // what about NTL7?
++#endif
++ long sizeofrep= rep[1];
+ bool lessZero= false;
+ if (sizeofrep < 0)
+ {
+@@ -519,7 +526,7 @@ convertZZ2CF (const ZZ & a)
+ cf_stringtemp_l= sizeofrep*sizeof(mp_limb_t)*2;
+ cf_stringtemp= (unsigned char*) Alloc (cf_stringtemp_l);
+ }
+- int cc= mpn_get_str (cf_stringtemp, 16, (mp_limb_t *) (((long *) (a.rep)) + 2), sizeofrep);
++ int cc= mpn_get_str (cf_stringtemp, 16, (mp_limb_t *) ((rep) + 2), sizeofrep);
+
+ char* cf_stringtemp2;
+ if (lessZero)
diff --git a/sci-mathematics/singular/metadata.xml b/sci-mathematics/singular/metadata.xml
new file mode 100644
index 000000000000..2a047b6737c1
--- /dev/null
+++ b/sci-mathematics/singular/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tomka@gentoo.org</email>
+ <name>Thomas Kahle</name>
+ </maintainer>
+ <herd>sci-mathematics</herd>
+ <use>
+ <flag name="boost">Compile against external boost headers (<pkg>dev-libs/boost</pkg>)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/singular/singular-3.1.6.ebuild b/sci-mathematics/singular/singular-3.1.6.ebuild
new file mode 100644
index 000000000000..20e3c262c94f
--- /dev/null
+++ b/sci-mathematics/singular/singular-3.1.6.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils elisp-common flag-o-matic multilib prefix python-single-r1 versionator
+
+MY_PN=Singular
+MY_PV=$(replace_all_version_separators -)
+MY_DIR=$(get_version_component_range 1-3 ${MY_PV})
+# Note: Upstream's share tarball may not get updated on every release
+MY_SHARE_DIR="3-1-6"
+MY_PV_SHARE="${MY_PV}"
+
+DESCRIPTION="Computer algebra system for polynomial computations"
+HOMEPAGE="http://www.singular.uni-kl.de/"
+
+SRC_COM="http://www.mathematik.uni-kl.de/ftp/pub/Math/${MY_PN}/SOURCES/"
+SRC_URI="${SRC_COM}${MY_DIR}/${MY_PN}-${MY_PV}.tar.gz
+ ${SRC_COM}${MY_SHARE_DIR}/${MY_PN}-${MY_PV_SHARE}-share.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="boost doc emacs examples python readline test"
+
+RDEPEND="
+ dev-libs/gmp:0=
+ dev-libs/ntl:0=
+ emacs? ( >=virtual/emacs-22 )
+ readline? ( sys-libs/readline:0= )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ boost? ( dev-libs/boost:0= )"
+
+# Upstream does not care about tests
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${MY_DIR}"
+
+pkg_setup() {
+ append-flags -fPIC
+ append-ldflags -fPIC
+ tc-export CC CPP CXX
+ use emacs && elisp-need-emacs 22
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare () {
+ epatch \
+ "${FILESDIR}"/${PN}-3.1.0-gentoo.patch \
+ "${FILESDIR}"/${PN}-3.1.0-emacs-22.patch \
+ "${FILESDIR}"/${PN}-3.0.4.4-nostrip.patch \
+ "${FILESDIR}"/${PN}-3.1.3.3-Minor.h.patch \
+ "${FILESDIR}"/${PN}-3.1.6-ntl6compat.patch \
+ "${FILESDIR}"/${PN}-3.1.6-factory_template_instantiation.patch
+ use python && epatch "${FILESDIR}"/${PN}-3.1.3.2-python.patch
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ epatch "${FILESDIR}"/${PN}-3.1.3.3-install_name.patch
+ eprefixify kernel/Makefile.in
+ eprefixify Singular/Makefile.in
+ fi
+
+ eprefixify kernel/feResource.cc
+
+ # The SLDFLAGS mangling prevents passing raw LDLAGS to gcc (see e.g. bug 414709)
+ sed -i \
+ -e "/CXXFLAGS/ s/--no-exceptions//g" \
+ -e "s/SLDFLAGS=-shared/SLDFLAGS=\"$(raw-ldflags) -shared\"\n\t \tSLDFLAGS2=\"${LDFLAGS} -shared\"/" \
+ -e "s/ SLDFLAGS=/ SLDFLAGS=\n SLDFLAGS2=/" \
+ -e "s/AC_SUBST(SLDFLAGS)/AC_SUBST(SLDFLAGS)\nAC_SUBST(SLDFLAGS2)/" \
+ "${S}"/Singular/configure.in || die
+
+ sed -i \
+ -e "s/@SLDFLAGS@/@SLDFLAGS@\nSLDFLAGS2\t= @SLDFLAGS2@/" \
+ -e "/\$(CXX).*SLDFLAGS/s/SLDFLAGS/SLDFLAGS2/" \
+ "${S}"/Singular/Makefile.in || die
+
+ # remove ntl sources for safety.
+ rm -r ntl || die
+
+ cd "${S}"/Singular || die "failed to cd into Singular/"
+
+ eautoconf
+}
+
+src_configure() {
+ econf \
+ --prefix="${S}"/build \
+ --exec-prefix="${S}"/build \
+ --bindir="${S}"/build/bin \
+ --libdir="${S}"/build/lib \
+ --libexecdir="${S}"/build/lib \
+ --includedir="${S}"/build/include \
+ --with-apint=gmp \
+ --with-NTL \
+ --disable-doc \
+ --without-MP \
+ --without-flint \
+ --enable-factory \
+ --enable-libfac \
+ --enable-IntegerProgramming \
+ --enable-Singular \
+ --with-malloc=system \
+ $(use_with python python embed) \
+ $(use_with boost Boost) \
+ $(use_enable emacs) \
+ $(use_with readline)
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ cd "${WORKDIR}"/${MY_PN}/${MY_SHARE_DIR}/emacs/
+ elisp-compile *.el
+ fi
+}
+
+src_test() {
+ # Tests fail to link -lsingular, upstream ticket #243
+ emake test
+}
+
+src_install () {
+ dodoc README
+ # execs and libraries
+ cd "${S}"/build/bin
+ dobin ${MY_PN}* gen_test change_cost solve_IP toric_ideal LLL
+ insinto /usr/$(get_libdir)/${PN}
+ doins *.so
+
+ dosym ${MY_PN}-${MY_DIR} /usr/bin/${MY_PN}
+ dosym ${MY_PN}-${MY_DIR} /usr/bin/${PN}
+
+ # stuff from the share tar ball
+ cd "${WORKDIR}"/${MY_PN}/${MY_SHARE_DIR}
+ insinto /usr/share/${PN}
+ doins -r LIB
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ fi
+ if use doc; then
+ dohtml -r html/*
+ insinto /usr/share/${PN}
+ doins doc/singular.idx
+ cp info/${PN}.hlp info/${PN}.info &&
+ doinfo info/${PN}.info
+ fi
+ if use emacs; then
+ elisp-install ${PN} emacs/*.el emacs/*.elc emacs/.emacs*
+ elisp-site-file-install "${FILESDIR}"/60${PN}-gentoo.el
+ fi
+}
+
+pkg_postinst() {
+ einfo "The authors ask you to register as a SINGULAR user."
+ einfo "Please check the license file for details."
+ if use emacs; then
+ echo
+ ewarn "Please note that the ESingular emacs wrapper has been"
+ ewarn "removed in favor of full fledged singular support within"
+ ewarn "Gentoo's emacs infrastructure; i.e. just fire up emacs"
+ ewarn "and you should be good to go! See bug #193411 for more info."
+ echo
+ fi
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sci-mathematics/singular/singular-4.0.2.ebuild b/sci-mathematics/singular/singular-4.0.2.ebuild
new file mode 100644
index 000000000000..1f60ff3b9e07
--- /dev/null
+++ b/sci-mathematics/singular/singular-4.0.2.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils elisp-common flag-o-matic multilib prefix versionator
+
+MY_PN=Singular
+MY_PV=$(replace_all_version_separators '.')
+# Consistency is different...
+MY_DIR2=$(get_version_component_range 1-3 ${PV})
+MY_DIR=$(replace_all_version_separators '-' ${MY_DIR2})
+# This is where the share tarball unpacks to
+MY_SHARE_DIR="${WORKDIR}"/share/
+
+DESCRIPTION="Computer algebra system for polynomial computations"
+HOMEPAGE="http://www.singular.uni-kl.de/"
+SRC_URI="http://www.mathematik.uni-kl.de/ftp/pub/Math/${MY_PN}/SOURCES/${MY_DIR}/${PN}-${MY_PV}.tar.gz
+ http://www.mathematik.uni-kl.de/ftp/pub/Math/${MY_PN}/SOURCES/${MY_DIR}/${PN}-${MY_PV}-share.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~x86-linux ~x86-macos"
+IUSE="boost doc emacs examples python +readline"
+
+RDEPEND="dev-libs/gmp:0
+ >=dev-libs/ntl-5.5.1
+ emacs? ( >=virtual/emacs-22 )
+ sci-mathematics/flint
+ sci-mathematics/4ti2
+ sci-libs/cddlib"
+
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ boost? ( dev-libs/boost )
+ readline? ( sys-libs/readline )"
+
+SITEFILE=60${PN}-gentoo.el
+
+S="${WORKDIR}/${PN}-${MY_DIR2}"
+
+pkg_setup() {
+ append-flags "-fPIC"
+ append-ldflags "-fPIC"
+ tc-export AR CC CPP CXX
+
+ # Ensure that >=emacs-22 is selected
+ if use emacs; then
+ elisp-need-emacs 22 || die "Emacs version too low"
+ fi
+}
+
+src_prepare () {
+ # Need to do something about resources later...
+ # epatch "${FILESDIR}"/${PN}-4.0.0-gentoo.patch
+
+ # omalloc's old configure will fail if ar is not exactly 'ar'.
+ epatch "${FILESDIR}"/${PN}-4.0.0-fix-omalloc-ar-detection.patch
+
+ epatch "${FILESDIR}"/${PN}-4.0.2-ntl8-compat.patch
+
+ # autoreconf everything since otherwise it assumes autmake-1.13 is installed
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-gmp \
+ --with-ntl \
+ --with-flint \
+ --enable-gfanlib \
+ --disable-debug \
+ --disable-doc \
+ --enable-factory \
+ --enable-libfac \
+ --enable-IntegerProgramming \
+ $(use_with python python embed) \
+ $(use_with boost Boost) \
+ $(use_enable emacs) \
+ $(use_with readline) || die "configure failed"
+}
+
+src_compile() {
+ emake || die "emake failed"
+
+ if use emacs; then
+ cd "${MY_SHARE_DIR}"singular/emacs/
+ elisp-compile *.el || die "elisp-compile failed"
+ fi
+}
+
+# src_install () {
+# dodoc README
+# # execs and libraries
+# cd "${S}"/build/bin
+# dobin ${MY_PN}* gen_test change_cost solve_IP toric_ideal LLL \
+# || die "failed to install binaries"
+# insinto /usr/$(get_libdir)/${PN}
+# doins *.so || die "failed to install libraries"
+#
+# dosym ${MY_PN}-${MY_DIR} /usr/bin/${MY_PN} \
+# || die "failed to create symbolic link"
+#
+# # stuff from the share tar ball
+# cd "${WORKDIR}"/${MY_PN}/${MY_SHARE_DIR}
+# insinto /usr/share/${PN}
+# doins -r LIB || die "failed to install lib files"
+# if use examples; then
+# insinto /usr/share/doc/${PF}
+# doins -r examples || die "failed to install examples"
+# fi
+# if use doc; then
+# dohtml -r html/* || die "failed to install html docs"
+# insinto /usr/share/${PN}
+# doins doc/singular.idx || die "failed to install idx file"
+# cp info/${PN}.hlp info/${PN}.info &&
+# doinfo info/${PN}.info \
+# || die "failed to install info files"
+# fi
+# if use emacs; then
+# elisp-install ${PN} emacs/*.el emacs/*.elc emacs/.emacs* \
+# || die "elisp-install failed"
+# elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+# fi
+# }
+
+pkg_postinst() {
+ einfo "The authors ask you to register as a SINGULAR user."
+ einfo "Please check the license file for details."
+
+ if use emacs; then
+ echo
+ ewarn "Please note that the ESingular emacs wrapper has been"
+ ewarn "removed in favor of full fledged singular support within"
+ ewarn "Gentoo's emacs infrastructure; i.e. just fire up emacs"
+ ewarn "and you should be good to go! See bug #193411 for more info."
+ echo
+ fi
+
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}