summaryrefslogtreecommitdiff
path: root/sci-mathematics/singular
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-mathematics/singular
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-mathematics/singular')
-rw-r--r--sci-mathematics/singular/Manifest25
-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.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/files/singular-4.0.3-fix-destdir.patch26
-rw-r--r--sci-mathematics/singular/files/singular-4.0.3-fix-resources-name.patch307
-rw-r--r--sci-mathematics/singular/metadata.xml11
-rw-r--r--sci-mathematics/singular/singular-3.1.6.ebuild177
-rw-r--r--sci-mathematics/singular/singular-4.0.2.ebuild144
-rw-r--r--sci-mathematics/singular/singular-4.0.3.ebuild103
18 files changed, 1107 insertions, 0 deletions
diff --git a/sci-mathematics/singular/Manifest b/sci-mathematics/singular/Manifest
new file mode 100644
index 000000000000..e7cbee4e6c7e
--- /dev/null
+++ b/sci-mathematics/singular/Manifest
@@ -0,0 +1,25 @@
+AUX 60singular-gentoo.el 298 SHA256 b05a83af5a80fc1240e77d1cd036f4c9ca00907d11fb90d7f0ffb0c92ff7d235 SHA512 4c17a25d91c085e12f26441fcde858e61bf191bd7d9dcf63ff5b5a1dce1d63e3f7c4f78ce8afa4f2359ad4ba6eb51f3e224ae6c502b18f5f7a76738534337431 WHIRLPOOL 371c5fe968afea07fa8ca4bd51392859a18565b6f34e43d698ef433e28db0587eaa64f2b83cc71979104d1ef121c690f8113ed6efa424a00397e0256b58d55d7
+AUX singular-3.0.4.4-nostrip.patch 453 SHA256 70d6972d7bddd1d8d601f715465a46c92eba1edf2c5608bbd01ae65c6fd64553 SHA512 2fd31198c7c4e752976539a7ddc3b03bb4030efc52e66e5a2d34ce438af558d9d8b45aa088da6cf4eb1edf7f7239994f6eea040d0a8eb0c2c854b6275e7dde5f WHIRLPOOL 4cc614b3c1e62e3ad68725e8f0cf85522ee1190fa4d8f8af1344eaead28d9837c60ac468f5b3206ba03dc9db2656257108d029e73f0ab9666f220568f049825d
+AUX singular-3.1.0-emacs-22.patch 637 SHA256 2ae842d9636bd132271a23aa03c6810e6bdfaf0bf31b4376d8488402a41dd5a3 SHA512 19ef6b9252c42f468099b15911251c4b162ca552d86bcb1c90bb86a591b79e1c1d21463e21b14944820761df32d952e03276804a9125580179218b78226bbbdc WHIRLPOOL 99fc3aff600a43208f242a34ca3aa532a1aaee9d10eab3af8f478e9c230eb9dbff69b9b9aed080c5958e894262cf6225caa84e9ecc5b2b32317115c9d97ac30a
+AUX singular-3.1.0-gentoo.patch 4563 SHA256 31cf4c45ad9319431efda173a8bc24a9eac609b9fd2afadbe66156bec43f9146 SHA512 f503ccc1a2501e7a990715e2403989dbc4ec33fd6e4f043379db4b4eb22d18df27acc750271c556dacff2b74a7b5154feb92f3fab2c66de6e464635ff86e86ff WHIRLPOOL 6524e17f8e950ddeb5db0df09b180e48e23bfac8602e4a42416b9a0c726bc613e2a2f497ae37d92da9db02de97f69ac48603a3a2397fb07b4601c8e46c160225
+AUX singular-3.1.3.2-python.patch 1136 SHA256 3fc61301eed3d51ffaf12265e1c302be23ee10cb4d3e9a86769d79bf817c43d3 SHA512 76398bb6f679cba84b71fe7a5ecef6815cf314c87e15286726e4fa079dbefa65cfffd6934695ffe2cc18b6cefea75d960962908a24bfbf9cacbc3e3f74395370 WHIRLPOOL ed3e06a5fb50855a922778ae556adcc7de259a542c0dd570947fcae1c87144987c1d70fc0e5bc1f07d2da888a78ebd10fc5daef8bdd249813c98d5af89380b3a
+AUX singular-3.1.3.3-Minor.h.patch 234 SHA256 87419ec7ec7c51672c77dee048e1ca4dfaa325a37762e282a257cfb3d02da92a SHA512 8748e8c76cb6b33f3d43b604c3dc713e033c7636367d9f3086beaf52428cc3e2cd1244d831d2e94cf29530ad0118c9148ffc1e5364df8680d069d0e3d00592d7 WHIRLPOOL 9a5714376ac7bd6528bb29ba539a9b0ae6a1754d920ad44e9e62ff1dcadf1f524a2824f0115f9ff26af9e54e2692d5075d7459396e89e7649a92ea85785a8fd7
+AUX singular-3.1.3.3-install_name.patch 862 SHA256 2e3d0ca4e072d66feb2a5e2e3db0314f134510a734a78526ba1546d3f00548b8 SHA512 9f641503a62f8de151e9774003b9b52634f27ad8b4355bb72b49239acf4086fc066a7688f1ba2df7a42b05aaf8c89c9fff6100706d7bf71043d931a049804497 WHIRLPOOL 661725f3e8d81bd70cc0b9735dc67d5a71daa2d622f7e43e86c31a8ab68822d2026868030a131d4d7b1fd0ee08a28cc8d403f8048771fface1869d250823b31c
+AUX singular-3.1.6-factory_template_instantiation.patch 900 SHA256 03c64c0f4946a4de9b57f4ae644bb364283763b56075e712c617972de4636c37 SHA512 0a0d7a271fddf543de6d8d987322e4062997a6283ccbb90f55c8d70ed39a2e58a0d68e881c0d260ad9f4ceaf60352bcd78a48b6f707a7719369c0b4cbe47542f WHIRLPOOL 8b0a5903c6d13cb94e68791fa1ab7e6846909059ebf4d9d5eda5a04693fc09eed93c1c95ad03af018068c044846b9da6d98cc11da03a8277d29ce4860671946c
+AUX singular-3.1.6-ntl6compat.patch 1401 SHA256 4fbc4bd0817e585345a7dd3fa8df8c19e8ed241fb78d911c2e7161b1e12e9c1c SHA512 5d6c4ec73b81cebcd8d24dc75efedb2f3da656fc5103701f25f7bba40355e995f116acddb7bb711b8832a89ec55a1b7fbbc7dd9215822f786e7a6012905b66be WHIRLPOOL c0ee7ee9486eda07f00df2ab4604b88813d19dd47662d25e16eb9c83ede3f85589f7c1d6d675791d0198c53ceff9a2fe47c4fdcc185e08d172fa4798bcd6bf76
+AUX singular-4.0.0-fix-omalloc-ar-detection.patch 484 SHA256 510bcac07d297b39579e99caf101cd9132a607453ff2566f8e7024a2cb23ccf6 SHA512 4f74b1d436c17efa3872a6b24e56c691220813a3cc2debeb19caa5dd6bf0e3c39af32e43e3d7afb5af40f985ec56377128185b9138dfcf77a04618ba444ea619 WHIRLPOOL 9485b6c7adce21c208da12acc62babeadeba20bd9fee15c3f10833246f2ed225887cdf8d9e8d35b29ca5753acf7e8dca8a7a802d67a99d6ce066dc027ebbb512
+AUX singular-4.0.2-ntl8-compat.patch 1149 SHA256 fa84f01f4c11b930850327da69ad7a16d7ecb941a4e9fe774b1dcfa77700c442 SHA512 178f0130cd6a606d6c93f5cc42dfe92782a16cc6b3d0e2695ce16d2115f70e502f702e8e72fd5d3b61b1bb5b3f4038a4fbf6277418b3f0bf89cae7939d5ed606 WHIRLPOOL 0d7bf9024410db80379b9d6694bea1c279b9d2ad4c89440206f9c701205241140a31c37a0fa6157be55247d2c6ceca1740a12ef6b723154c682842b9d9c7ce3b
+AUX singular-4.0.3-fix-destdir.patch 992 SHA256 8625dfeb0a1d9a98d5a583592ff0b5deb7129c3dc4c25b9a0c9d0064b7eaabc0 SHA512 6b0496d1901c51da66d75fde1b980333df8b1e03572f49ecd56f3f3c67d3af1b08527c7b764aa3b62b0296b97aaaa861d257a97a4370b3600b2cd7ffb9580936 WHIRLPOOL af0def2b7d222faa40cf3a3266454861d9207cc7b4caf6e618ab7bd5a28f9ed818cf07cf3c19c718a77c2203e89c16dcdd52cde07f6eeb85b904886cc52a6236
+AUX singular-4.0.3-fix-resources-name.patch 10175 SHA256 a34124c55b8a5ad537a3011f4fcf68498f1b53daa56e0e60d68f20cf16e7b5d5 SHA512 29c43d97598c647ac2754ed897411638f0141b60de590a53fc3f476cd1d627b270ecab29e16923b00757d8218d680c6b837070fa6899e4c770243bf71e86a09f WHIRLPOOL 5b3aada3c52bbe63e81eacace1c34e8d4bb59b5da79b71aaf0f2e261901b494aed8c856fcad30afb40b03543e24e607d2825fa22b971c962ddd8966d439ea6ae
+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
+DIST singular-4.0.3-share.tar.gz 6633256 SHA256 391cb9cd7626ee745f269a025530b5b3a33794e7862cf1afd7ca9d109321827a SHA512 5f8ae4ecd22a3470e5f00393e03079936d7ed334f44ae056ed1eb1719054afc4371b03e920b598033605600c843dc39cb6b01308505323e2c084dfe1f7a1b94a WHIRLPOOL b00694bc2d93c9ef6d299d18e9e65133656dbb427aa50de730d78e5c0501332c5a4b3797edf09750179ef4efd980401f46bb5f1beee37bf7474dc6323b9467bd
+DIST singular-4.0.3.tar.gz 12615042 SHA256 4ccf70a9efcf087f436bfea9c09d61a554eb8e7638697093a55998ef846f316e SHA512 781227997c510829b02c969259d627572c0b62aa152c9ef623ff27de5b2df0c8e024f086740b89ca8f96b6e3f7def04f8d62ca79adb199d6249ade9b8cbb06ab WHIRLPOOL 587ff208fb7b03edb3398e0a4b8cf54cfa9ddee6a8a350c5273a4f6074a6e0a3f06e35ad96b8ddb58ef5dd9036b45c81552a925681ecb4df72d895afc010eb0d
+EBUILD singular-3.1.6.ebuild 4724 SHA256 1f04612ae46647188a9e92632029223c9654a8de280f2e8ad36ed4ee2dd1eaa3 SHA512 eb18e7a69b110d71b02a7f1d239c9b9b281f535463105c28687eae1e49d303843e0e71f573bbdfbe051f3efb675f7128f0c9e253f1a43dd3fc9d6c9b91acae6e WHIRLPOOL 512915f56146bb090a9ac03e1529e9c67476e6dbab226d1f1c5f4fc73338de39f5e37251ccebcdbb60f381d78dfe808fdc58c36dd6f2fef81287148d41170430
+EBUILD singular-4.0.2.ebuild 3979 SHA256 3b69ce71551dbe1d964d167cb23cde31dfb0c227d81a0927050582430dc47c64 SHA512 41450e6f7da47c2505c9e889487c52b35701cba8394ad2dfa0cbfbbe55dbeb9d72685ee1d0a584488c3022b75e34f9c5b0ed6d26612a8d31499f02abec1176fd WHIRLPOOL 2168b867d9f4c1045a53459fc3eb9c98da1de332db9b97c54625f2a7fa5e6d6c5f138e7c666f2c1d86ee98550eae33117b0c5227c3ca79a40b4a526d49b791f0
+EBUILD singular-4.0.3.ebuild 2625 SHA256 b71804b949753b9c6c45f5e92a175b540704584e732b5a9e5b33754bea3cee21 SHA512 077b88bbbd4b72247979196cbe32410f9c8012591f12a3df689838da4ac9515664e3fd45c66f31a4444c637ecd7eda829a722027966a2271edc057edf8dc83bd WHIRLPOOL 27d9193d2d69fb3ac047c09554945270313f8ab24c478ae04d6959e4043784029e7c8e0a940c209328a52108113a12c7c9ed12823d7345571dd119f3cb2c952c
+MISC ChangeLog 3736 SHA256 27c9b47835cf9e94b0c1dc5aee2c37a2b943c3e46beb673ac2f07805a5b9bcbf SHA512 0aea5ec92f4eb72d6fb2deeca9172210c0649bd848a4b026451fec2597b2cab2b6cad360ee30ad140b97e69c5b00876fcde42426e7d88ce1ee7faf8fefc842d0 WHIRLPOOL d006dc278b81b55a72230d9b4357d4aef678fd137bc2210fa67fe1dd3c7a3a6c367571fd79a04fcaea516d9a2d696c767fae5337a481b28f854d205354fd2aa2
+MISC ChangeLog-2015 14247 SHA256 9e63d52432acadd40673d66dd10a41dbf5f1faa017e1e6f8fae5c6a5186f76b7 SHA512 a3a2799e4056a788b0587679252d079a1e0abd9be6a21932842479f01b59a1156db972628e94de8c547babe8873a62e678b66ed14c431046ac754287a77e2363 WHIRLPOOL 5f9c1f41c00b5315a2feddcf8e718e77e54fa6f2bbe218096c33c6a9fdfc480c471411b283cc44a34415dc28b29d1d25ebbfc44e41c899edb71c82cec50f1a91
+MISC metadata.xml 389 SHA256 3f927654e2f7ea890a416e0d4d7af859bb522e7fbc90594c4b329f5ff9cc773d SHA512 3c5aea925276639c81a03a2a8d05ecaa48edac510f144d92e173402721dbc253638341ac8afdfbc17098ac35d2f4f47b41e5d56427c8ecaa788dc28fbb0977ae WHIRLPOOL 4cc8f5367efca5c8a5f83069a1be7975baaa6cb2bf730ff673deb2508409576977a122f30dec4f0ea7b1721b6dc92ad5c207a196022eb219037e4a4eb128db64
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.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/files/singular-4.0.3-fix-destdir.patch b/sci-mathematics/singular/files/singular-4.0.3-fix-destdir.patch
new file mode 100644
index 000000000000..caeed33f1fc3
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-4.0.3-fix-destdir.patch
@@ -0,0 +1,26 @@
+From 7eac42b467723a83a951218be53785411be3dbc4 Mon Sep 17 00:00:00 2001
+From: jgmbenoit <quatermaster@rezozer.net>
+Date: Thu, 28 Apr 2016 05:47:53 +0000
+Subject: [PATCH] automake: install-data-local: missing DESTDIR prefix
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 32778f7..24dd251 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -17,9 +17,9 @@ dist-hook:
+ $(srcdir)/git-version-gen $(srcdir)/.tarball-git-version > $(distdir)/.tarball-git-version
+
+ install-data-local:
+- -cat ${top_srcdir}/doc/doc.tbz2| (cd $(datadir)/singular;tar jxf -)
+- -mkdir $(datadir)/info
+- -mv $(datadir)/singular/singular.hlp $(datadir)/info/.
++ -cat ${top_srcdir}/doc/doc.tbz2| (cd $(DESTDIR)$(datadir)/singular; tar jxf -)
++ -mkdir $(DESTDIR)$(datadir)/info
++ -mv $(DESTDIR)$(datadir)/singular/singular.hlp $(DESTDIR)$(datadir)/info/.
+
+ configheaderdir = ${includedir}/singular
+ nodist_configheader_HEADERS = singularconfig.h
diff --git a/sci-mathematics/singular/files/singular-4.0.3-fix-resources-name.patch b/sci-mathematics/singular/files/singular-4.0.3-fix-resources-name.patch
new file mode 100644
index 000000000000..bcda4ced6472
--- /dev/null
+++ b/sci-mathematics/singular/files/singular-4.0.3-fix-resources-name.patch
@@ -0,0 +1,307 @@
+From a3a6a07858b7e91c4c8a3c8d07e53957a8547af2 Mon Sep 17 00:00:00 2001
+From: Hans Schoenemann <hannes@mathematik.uni-kl.de>
+Date: Thu, 1 Sep 2016 10:48:08 +0200
+Subject: [PATCH] change library name: libresources -> libsingular_resources
+
+---
+ Singular/Makefile.am | 4 ++--
+ autogen.sh | 1 +
+ factory/configure.ac | 8 ++++----
+ gfanlib/configure.ac | 2 +-
+ libpolys/configure.ac | 8 ++++----
+ m4/options.m4 | 10 +++++-----
+ resources/Makefile.am | 18 +++++++++---------
+ resources/configure.ac | 6 +++---
+ resources/feFopen.cc | 2 +-
+ resources/feResource.cc | 2 +-
+ resources/omFindExec.c | 2 +-
+ resources/resources.pc.in | 17 -----------------
+ resources/singular_resources.pc.in | 17 +++++++++++++++++
+ 13 files changed, 49 insertions(+), 48 deletions(-)
+ delete mode 100644 resources/resources.pc.in
+ create mode 100644 resources/singular_resources.pc.in
+
+diff --git a/Singular/Makefile.am b/Singular/Makefile.am
+index e2bcc23..be84a08 100644
+--- a/Singular/Makefile.am
++++ b/Singular/Makefile.am
+@@ -176,7 +176,7 @@ ESingular_CPPFLAGS = ${AM_CPPFLAGS} -DESINGULAR -DPROTO
+ # ESingular_LDFLAGS = -static ${AM_LDFLAGS}
+ ESingular_LDADD = ${top_builddir}/libpolys/reporter/libreporter.la \
+ ${top_builddir}/libpolys/misc/libmisc.la ${top_builddir}/omalloc/libomalloc.la \
+-${top_builddir}/resources/libresources.la
++${top_builddir}/resources/libsingular_resources.la
+
+
+ ESingular_SOURCES = emacs.cc fegetopt.c fegetopt.h feOptES.inc feOpt.cc
+@@ -186,7 +186,7 @@ TSingular_CPPFLAGS = ${AM_CPPFLAGS} -DTSINGULAR -DPROTO
+ # TSingular_LDFLAGS = -static ${AM_LDFLAGS}
+ TSingular_LDADD = ${top_builddir}/libpolys/reporter/libreporter.la \
+ ${top_builddir}/libpolys/misc/libmisc.la ${top_builddir}/omalloc/libomalloc.la \
+-${top_builddir}/resources/libresources.la
++${top_builddir}/resources/libsingular_resources.la
+
+ TSingular_SOURCES = emacs.cc fegetopt.c fegetopt.h feOptTS.inc feOpt.cc
+ # utils.cc utils.h
+diff --git a/autogen.sh b/autogen.sh
+index d027997..0d09c08 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -4,6 +4,7 @@ cd `dirname "$0"`
+
+ # -d --warnings=all
+ autoreconf -v -f -i
++find . -name configure -exec sed -i "s/-g -O2/-g/g" {} \; -print
+
+ cd -
+
+diff --git a/factory/configure.ac b/factory/configure.ac
+index 7ea255b..a9caf73 100644
+--- a/factory/configure.ac
++++ b/factory/configure.ac
+@@ -120,10 +120,10 @@ AM_CONDITIONAL(
+ [WITH_PARSER_FOR_CANONICAL_FORM],
+ [test "x$enable_streamio" = xyes])
+
+-AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libresources] )
+-AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libresources] )
++AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libsingular_resources] )
++AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libsingular_resources] )
+
+-AC_MSG_CHECKING(whether libresources should be used)
++AC_MSG_CHECKING(whether libsingular_resources should be used)
+ if test "x$with_Singular" = xyes;
+ then
+ AC_MSG_RESULT(yes)
+@@ -134,7 +134,7 @@ then
+ AC_MSG_CHECKING([ RESOURCES_LIBS?..])
+ AC_MSG_RESULT(${RESOURCES_LIBS:-unset})
+
+- PKG_REQUIRE="$PKG_REQUIRE resources"
++ PKG_REQUIRE="$PKG_REQUIRE singular_resources"
+ AC_SUBST(PKG_REQUIRE)
+ else
+ AC_MSG_RESULT(no)
+diff --git a/gfanlib/configure.ac b/gfanlib/configure.ac
+index 015134c..d3d2cd7 100644
+--- a/gfanlib/configure.ac
++++ b/gfanlib/configure.ac
+@@ -2,7 +2,7 @@
+ # Process this file with autoconf to produce a configure script.
+
+ AC_PREREQ([2.63])
+-AC_INIT([libgfan], [0.1], [ren@mathematik.uni-kl.de])
++AC_INIT([libgfan], [0.6], [ren@mathematik.uni-kl.de])
+ AC_CONFIG_MACRO_DIR([../m4])
+ AC_CONFIG_AUX_DIR([../build-aux])
+ AC_CONFIG_SRCDIR([gfanlib.h])
+diff --git a/libpolys/configure.ac b/libpolys/configure.ac
+index 049e44d..4b2f1ae 100644
+--- a/libpolys/configure.ac
++++ b/libpolys/configure.ac
+@@ -90,10 +90,10 @@ SING_CHECK_OMALLOC()
+
+ ENABLE_RESOURCES="yes"
+
+-AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libresources] )
+-AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libresources] )
++AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libsingular_resources] )
++AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libsingular_resources] )
+
+-AC_MSG_CHECKING(whether libresources should be used)
++AC_MSG_CHECKING(whether libsingular_resources should be used)
+
+ if test "x$ENABLE_RESOURCES" = xyes;
+ then
+@@ -105,7 +105,7 @@ then
+ AC_MSG_CHECKING([ RESOURCES_LIBS?..])
+ AC_MSG_RESULT(${RESOURCES_LIBS:-unset})
+
+- PKG_REQUIRE="$PKG_REQUIRE resources"
++ PKG_REQUIRE="$PKG_REQUIRE singular_resources"
+ AC_SUBST(PKG_REQUIRE)
+ else
+ AC_MSG_RESULT(no)
+diff --git a/m4/options.m4 b/m4/options.m4
+index 31b86e4..066dc4d 100644
+--- a/m4/options.m4
++++ b/m4/options.m4
+@@ -150,19 +150,19 @@ AC_DEFUN([SING_USE_OMALLOC],
+
+ AC_DEFUN([SING_USE_RESOURCES],
+ [
+- AC_ARG_ENABLE(resources,
+- [AS_HELP_STRING([--disable-resources], [do NOT use libresources within the factory])],
++ AC_ARG_ENABLE(singular_resources,
++ [AS_HELP_STRING([--disable-singular_resources], [do NOT use libsingular_resources within the factory])],
+ [if test "x$enableval" = "xyes"; then
+ ENABLE_RESOURCES=yes
+ fi],
+ ENABLE_RESOURCES=yes)
+
+- AC_MSG_CHECKING(whether to use libresources in factory and co.)
++ AC_MSG_CHECKING(whether to use libsingular_resources in factory and co.)
+ if test "x$ENABLE_RESOURCES" = xyes; then
+ AC_MSG_RESULT(yes)
+ RESOURCES_INCLUDES="-I$ac_abs_top_srcdir "
+
+- RESOURCES_LIBS="$ac_abs_top_builddir/resources/libresources.la"
++ RESOURCES_LIBS="$ac_abs_top_builddir/resources/libsingular_resources.la"
+
+ AC_SUBST(RESOURCES_INCLUDES)
+ AC_SUBST(RESOURCES_LIBS)
+@@ -171,7 +171,7 @@ AC_DEFUN([SING_USE_RESOURCES],
+
+ ac_configure_args="$ac_configure_args $ENABLE_ARG"
+
+- PKG_REQUIRE="$PKG_REQUIRE resources"
++ PKG_REQUIRE="$PKG_REQUIRE singular_resources"
+ AC_SUBST(PKG_REQUIRE)
+ else
+ AC_MSG_RESULT(no)
+diff --git a/resources/Makefile.am b/resources/Makefile.am
+index fa69ccc..934175b 100644
+--- a/resources/Makefile.am
++++ b/resources/Makefile.am
+@@ -1,24 +1,24 @@
+ ACLOCAL_AMFLAGS = -I ../m4
+
+-libresources_LTLIBRARIES = libresources.la
++libsingular_resources_LTLIBRARIES = libsingular_resources.la
+
+-libresourcesdir = $(libdir)
++libsingular_resourcesdir = $(libdir)
+
+
+ AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir}
+
+
+ SOURCES = omFindExec.c feResource.cc feFopen.cc
+-libresources_la_SOURCES = $(SOURCES)
++libsingular_resources_la_SOURCES = $(SOURCES)
+
+-libresources_la_LDFLAGS = -release ${PACKAGE_VERSION}
++libsingular_resources_la_LDFLAGS = -release ${PACKAGE_VERSION}
+
+-libresources_includedir =$(includedir)/resources
++libsingular_resources_includedir =$(includedir)/resources
+
+-libresources_include_HEADERS = omFindExec.h feResource.h feFopen.h
++libsingular_resources_include_HEADERS = omFindExec.h feResource.h feFopen.h
+
+-nodist_libresources_include_HEADERS = resourcesconfig.h
+-DISTCLEANFILES = $(nodist_libresources_include_HEADERS)
++nodist_libsingular_resources_include_HEADERS = singular_resourcesconfig.h
++DISTCLEANFILES = $(nodist_libsingular_resources_include_HEADERS)
+
+ pkgconfigdir = $(libdir)/pkgconfig
+-pkgconfig_DATA = resources.pc
++pkgconfig_DATA = singular_resources.pc
+diff --git a/resources/configure.ac b/resources/configure.ac
+index bc5f294..212a1d5 100644
+--- a/resources/configure.ac
++++ b/resources/configure.ac
+@@ -1,4 +1,4 @@
+-AC_INIT([resources], [4.0.3])
++AC_INIT([singular_resources], [4.0.3])
+
+ AC_CONFIG_MACRO_DIR([../m4])
+ AC_CONFIG_AUX_DIR([../build-aux])
+@@ -14,7 +14,7 @@ dnl Check if build env is sane
+ AM_SANITY_CHECK
+
+ # Add pre'prefixed config
+-AX_PREFIX_CONFIG_H([resourcesconfig.h],[],[_config.h])
++AX_PREFIX_CONFIG_H([singular_resourcesconfig.h],[],[_config.h])
+
+ SING_RESET_FLAGS()
+ SING_CHECK_SET_ARGS()
+@@ -70,5 +70,5 @@ AX_RECURSIVE_EVAL([[$]datadir], [config_datadir])
+ AX_NORMALIZE_PATH([config_datadir],['/'])
+ AC_DEFINE_UNQUOTED([DATA_DIR],"$config_datadir",[datadir])
+
+-AC_CONFIG_FILES([resources.pc Makefile])
++AC_CONFIG_FILES([singular_resources.pc Makefile])
+ AC_OUTPUT
+diff --git a/resources/feFopen.cc b/resources/feFopen.cc
+index 98cfd44..10800a0 100644
+--- a/resources/feFopen.cc
++++ b/resources/feFopen.cc
+@@ -1,4 +1,4 @@
+-#include "resourcesconfig.h"
++#include "singular_resourcesconfig.h"
+ #include "feResource.h"
+ #include "feFopen.h"
+
+diff --git a/resources/feResource.cc b/resources/feResource.cc
+index 49a6855..a3accf9 100644
+--- a/resources/feResource.cc
++++ b/resources/feResource.cc
+@@ -5,7 +5,7 @@
+ * ABSTRACT: management of resources
+ */
+
+-#include "resourcesconfig.h"
++#include "singular_resourcesconfig.h"
+ #include "feResource.h"
+ #include "omFindExec.h"
+
+diff --git a/resources/omFindExec.c b/resources/omFindExec.c
+index e79f2c8..1d5852a 100644
+--- a/resources/omFindExec.c
++++ b/resources/omFindExec.c
+@@ -6,7 +6,7 @@
+ *******************************************************************/
+
+
+-#include "resourcesconfig.h"
++#include "singular_resourcesconfig.h"
+
+
+ #if defined(HAVE_UNISTD_H) && defined(STDC_HEADERS)
+diff --git a/resources/resources.pc.in b/resources/resources.pc.in
+deleted file mode 100644
+index d040056..0000000
+--- a/resources/resources.pc.in
++++ /dev/null
+@@ -1,17 +0,0 @@
+-prefix=@prefix@
+-exec_prefix=@exec_prefix@
+-libdir=@libdir@
+-includedir=@includedir@
+-
+-Name: @PACKAGE@
+-Description: The Singular resources manager
+-Version: @PACKAGE_VERSION@
+-URL: https://github.com/Singular/Sources/tree/spielwiese/@PACKAGE@
+-
+-# Requires:
+-# Conflicts:
+-
+-Cflags: -I${includedir} @SINGULAR_CFLAGS@
+-Libs: -L${libdir} -l@PACKAGE@
+-# Libs.private:
+-
+diff --git a/resources/singular_resources.pc.in b/resources/singular_resources.pc.in
+new file mode 100644
+index 0000000..d040056
+--- /dev/null
++++ b/resources/singular_resources.pc.in
+@@ -0,0 +1,17 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: @PACKAGE@
++Description: The Singular resources manager
++Version: @PACKAGE_VERSION@
++URL: https://github.com/Singular/Sources/tree/spielwiese/@PACKAGE@
++
++# Requires:
++# Conflicts:
++
++Cflags: -I${includedir} @SINGULAR_CFLAGS@
++Libs: -L${libdir} -l@PACKAGE@
++# Libs.private:
++
diff --git a/sci-mathematics/singular/metadata.xml b/sci-mathematics/singular/metadata.xml
new file mode 100644
index 000000000000..faab92efd936
--- /dev/null
+++ b/sci-mathematics/singular/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-mathematics@gentoo.org</email>
+ <name>Gentoo Mathematics Project</name>
+ </maintainer>
+ <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..1aaa72907608
--- /dev/null
+++ b/sci-mathematics/singular/singular-3.1.6.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ dev-libs/gmp:0=
+ dev-libs/ntl:0=
+ emacs? ( >=virtual/emacs-22 )
+ python? ( ${PYTHON_DEPS} )
+ 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..fd44a959ad62
--- /dev/null
+++ b/sci-mathematics/singular/singular-4.0.2.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 ppc 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
+}
diff --git a/sci-mathematics/singular/singular-4.0.3.ebuild b/sci-mathematics/singular/singular-4.0.3.ebuild
new file mode 100644
index 000000000000..819a33a186cc
--- /dev/null
+++ b/sci-mathematics/singular/singular-4.0.3.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools 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
+
+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 ~ppc ~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 () {
+ eapply "${FILESDIR}"/"${P}"-fix-resources-name.patch
+ eapply "${FILESDIR}"/"${P}"-fix-destdir.patch
+ eapply_user
+ # 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 "${S}"/emacs/
+ elisp-compile *.el || die "elisp-compile failed"
+ 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
+}