summaryrefslogtreecommitdiff
path: root/sci-mathematics/pari
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/pari
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-mathematics/pari')
-rw-r--r--sci-mathematics/pari/Manifest44
-rw-r--r--sci-mathematics/pari/files/50pari-gentoo.el10
-rw-r--r--sci-mathematics/pari/files/pari-2.3.2-ppc-powerpc-arch-fix.patch11
-rw-r--r--sci-mathematics/pari/files/pari-2.3.2-strip.patch11
-rw-r--r--sci-mathematics/pari/files/pari-2.3.5-doc-make.patch46
-rw-r--r--sci-mathematics/pari/files/pari-2.3.5-no-dot-inc.patch61
-rw-r--r--sci-mathematics/pari/files/pari-2.5.0-doc-make.patch82
-rw-r--r--sci-mathematics/pari/files/pari-2.5.0-macos.patch21
-rw-r--r--sci-mathematics/pari/files/pari-2.5.0-mp.c.patch23
-rw-r--r--sci-mathematics/pari/files/pari-2.5.0-no-dot-inc.patch61
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-1302.patch33
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-1304.patch39
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-gcc47.patch18
-rw-r--r--sci-mathematics/pari/files/pari-2.5.1-no-automagic.patch100
-rw-r--r--sci-mathematics/pari/files/pari-2.5.4-polred.patch754
-rw-r--r--sci-mathematics/pari/files/pari-2.5.4-slow_determinant.patch100
-rw-r--r--sci-mathematics/pari/files/pari-2.7.0-doc-make.patch89
-rw-r--r--sci-mathematics/pari/files/pari-2.7.0-no-automagic.patch100
-rw-r--r--sci-mathematics/pari/files/pari-2.7.0-no-dot-inc.patch64
-rw-r--r--sci-mathematics/pari/files/pari-2.7.0-slow-discriminant.patch54
-rw-r--r--sci-mathematics/pari/files/pari-2.7.1-perl-5.22-doc.patch12
-rw-r--r--sci-mathematics/pari/metadata.xml28
-rw-r--r--sci-mathematics/pari/pari-2.3.5.ebuild138
-rw-r--r--sci-mathematics/pari/pari-2.5.0-r3.ebuild136
-rw-r--r--sci-mathematics/pari/pari-2.5.1-r1.ebuild138
-rw-r--r--sci-mathematics/pari/pari-2.5.1.ebuild138
-rw-r--r--sci-mathematics/pari/pari-2.5.2.ebuild134
-rw-r--r--sci-mathematics/pari/pari-2.5.3.ebuild134
-rw-r--r--sci-mathematics/pari/pari-2.5.4.ebuild142
-rw-r--r--sci-mathematics/pari/pari-2.7.0.ebuild134
-rw-r--r--sci-mathematics/pari/pari-2.7.1.ebuild136
31 files changed, 2991 insertions, 0 deletions
diff --git a/sci-mathematics/pari/Manifest b/sci-mathematics/pari/Manifest
new file mode 100644
index 000000000000..7681a7870ab4
--- /dev/null
+++ b/sci-mathematics/pari/Manifest
@@ -0,0 +1,44 @@
+AUX 50pari-gentoo.el 271 SHA256 787e2c797c42645de8429cd449040b81563e07681c557bc9433cc4ef287ffe12 SHA512 2b466ebe72aa17e9b65c8a85b5ba9ba5b393a6983079738a5cc68e4dac1e360aa74e153a672d41f85addae70c9cb30e0d7079acbbf0d39077cba6871ae2f852d WHIRLPOOL fa499717ae5bcd331357a42f1029fc6a46482c32b033b957df80f89dbd455dc7a2074022a50177958cba5f9de5615f4cac0445b6fc4325be23e11cb2279d1261
+AUX pari-2.3.2-ppc-powerpc-arch-fix.patch 453 SHA256 3796b8e994f6dda107dd3733ec0769dbe020debc8f24db89f4f740cd3939f64f SHA512 053f3684d9cdf57d1306fc78856bb82cdd03fc1ba784c2d8c40938823f5202b36add61e59c51bea0e08957e02488641da895af7bbcb0c03aa64feedd2c4d807a WHIRLPOOL e063d3c687bdbfef6270a7c398d659e04b07f7d2602a2b6e5a7e036d3f330d707ca8b459b71582acf02169f187bb9d47a2491c81f0fdc80910bbe9a94e64fee2
+AUX pari-2.3.2-strip.patch 293 SHA256 e4a63e53734295dbbdcf9ade59c12d49a36317be3b25a223c684221086fce21b SHA512 2197f4cd98ef33d5d77827271badc05af99a0d189cf68e5c5f8f895c5fd9bca7e68e6e7fa8086911845eafce6a80c268c793fbca57ecad7cea3ef5d14ee0a168 WHIRLPOOL 4e1ef876471106bd26796d7755298d0776912c2c770726a35b7f0395f5bf28162d211efc54d5f877b5374136fef90ef75fbd1e47ed02d7b6382dcfde2b28ea26
+AUX pari-2.3.5-doc-make.patch 1358 SHA256 9a68848f4b2818f2bbdfc49063af94eb6b54049563ca0d5137d6bfce2450b35b SHA512 74a683a54693bcd6e4155d22f82f173b154c367f381e17387f58f4d5c7ce5d157e1d27869a988c96ea4451dd02ccdb443d6d051a112b80fcaffbbfa785570f77 WHIRLPOOL 4afdd53034793586c05bfb95ce542516c122126903c6eec471d956d81949c20a916bf8757be689dc0bc6da567003ceba9e51cbad5e909a0aa6ebd5351c0d7f98
+AUX pari-2.3.5-no-dot-inc.patch 1594 SHA256 1d1ba8e9a577c31046485c797135eec6b6a804f2a6b22b78becc02d57147cc6b SHA512 4f3e7757c5fa564ea05b843e74118086fb22d8602bf29964aa3be886263941434bc1b7121805c5efafb64c208c2fe181da4831c6d662bda8d1a04cd5d9704605 WHIRLPOOL 1dd30c1a91d9108c0d16560d79cec39dcc909c00b8673739504ac9800edd24338b5365eeb867b5ccd23e7b236a31b031400a09ef7be480f4d7b4bcede00b498d
+AUX pari-2.5.0-doc-make.patch 2280 SHA256 e28a0c8db09f02c30499f606fafa9ebaa5e09bbc25dd87f1ff9ba6cf316b5338 SHA512 8c0d13b2bdc39407b56e1ccf73a01a864575197ce33c58d6507ebf207bb31c8dc1f09e5266dc73f62631af5356f6e78609ba8851ffffffcdced127afcc70f5ab WHIRLPOOL ed570b9a5160251f34ed0fa73f897ccd8e77ba0bb78e1ef9a1099f4dc566ede04fa95997ee17833a38a2eb14e83cc8879354d8eabe481591093f907bcbf54a30
+AUX pari-2.5.0-macos.patch 827 SHA256 0ababf5c7c182b8f8fb46d35f2064a517d5487811e77743b7f64d12c075ed6ac SHA512 bc183e6bd37a1f1abd1f9c5915acbb1d04fa2c5b9aaf60dab9f38afb868c0c061aec0aff6e4e42f930e348ac6c3d406e8dd55166e670b34707ac6577c8b88fc1 WHIRLPOOL 55b059a8eab84c719f956499bd1101a543bc861efa60978badb320913849a2e593a1387d573d20e69df6ae17851e60b495b57ab51c9f2bcbf3273c802eeb0a79
+AUX pari-2.5.0-mp.c.patch 673 SHA256 78db2dcf22cd8f6231926402b69e6b29683fed46c06468d661e6d94d39e07fa8 SHA512 b17b5190883b69037a00a227fbb005ef15d22a08ce0720c2a9886d10ed11199a51a4eba6d7c4aba50f441286b123a1000b47927b40eec5219b6b045db2cd2f66 WHIRLPOOL 541c5f6b785bc1e575aaaa5a2974cba0f0aa41ca1a9f9fada3bcec7afafcb45f6951bd121ded71e3cb8f4cc2aaca8a76cf6ccaee6156fde81f72a7fb680c7e67
+AUX pari-2.5.0-no-dot-inc.patch 1612 SHA256 e685a4f0814aa8742861629d88513bb073b454335318b28adc1fe94f8caa552d SHA512 db318bd6bdc065669a3b9f1c5ca8bed8831c14cf8e2179cb10cb88308c8f28282cb9e6cf9aa50b95d1ac9e4b1ee6219fd85677276e918a2cef50e809f8d12e82 WHIRLPOOL 9287f5d260addb958bd550b452684deb707ee1729a9aad567076661899c907d759b03d72a2e12a1b815b89e19f257c8b33b3ff3f0ea644731b7e85785a46bdf9
+AUX pari-2.5.1-1302.patch 868 SHA256 e5b4a0b31ee598d0bf49ce25d00503691c080d3b4b53051e6982b8d9d9f00a08 SHA512 894c7d8f181c1e472db6d378c9df91465b8f72ec4b00f0451af565c7eef6c378d5886cc14c2973a87950276d4ec62266be8df3d8debadd572bb43b4b5c067b3c WHIRLPOOL 5c733a5224f8d7ddb4b46131b978a89242e3b1124e35724908fe0ab88dda2982c29a107a1607939f623dc4058de36c4f1c58a20ecd6663752c348595dfd158d4
+AUX pari-2.5.1-1304.patch 968 SHA256 2252728ee1f4bf3aef627266704e8ec7c46ede2c48c66748388874689435d86c SHA512 a1c21fab25801e20ba278bbd7cd58cc6b185db6ed0971d125df1f2fde94779ee2562046e53e3550f2ff4d06c89b203216930ee33fea9d37ac74929773c8cc293 WHIRLPOOL 1f33bc6a6a36336376d8d24734bd3f0080fca89b9a5a5aa9d5149d4b12d55561c43d9a71c538792fe8987f794dfd6f63d5a9efde04c906c03095fc664d72cf20
+AUX pari-2.5.1-gcc47.patch 609 SHA256 f450cf7a7642f08abdb59a9c2ec206371cd29b4da771563c323dd756de300294 SHA512 55be2ad6d8b727e057d4bafa1bb771a5d3946d5a26d1a44062c0f476af0e69bb0bfaa63c8f4d8fc8db0183772e77096f704dbc0699ab6865457a5bc39b4326f8 WHIRLPOOL 957cf6d832303fd80ef8b07772a643690078e33dbfc6e6fd165be193446f2adcb21c1b44f42735f4f077648f74a5acf722f54ab499d514b099c2169e91fbaf0b
+AUX pari-2.5.1-no-automagic.patch 3769 SHA256 e0f1e8ef64b0203add85ac9d6adad59d3ea268dd073249c7742bd64507e8395e SHA512 5ea4a477ee2f5c744c3900d47e3c770c366a1a311fb639b7b928861cf79924f73c6ceb1e0d7a07a2cb343cccf2f822fa2b65f67f0a55516e3075a85b9c22614a WHIRLPOOL 4cb4a29a946480f7f04dded34606a1649a759f99da2372f51bd9bc7c6ea44cb08c70ff8d1ed204cd8f5a3f237970fe90d1b8d90578806a73fbdc637395718e7d
+AUX pari-2.5.4-polred.patch 23409 SHA256 8d0a750f07f7ac04f733e5f44127ec90440d60b946bb84a6c9ae0fc8c0bcaf62 SHA512 8251a3246abe90291c82b1e05174e939a92235c1b5fb183d06ef9597bebc6d03cc3905866814e7db2037500b9471bc4def9743027007670ef2f273abd65767dc WHIRLPOOL be587881cfe8678fa8424ec3cc92f3a2d9aca923e85cf2341efead155f03f9904628426d3956989a5ba0886876b633f7ac2d12bc838ff2af5220ad8e1decdec7
+AUX pari-2.5.4-slow_determinant.patch 2626 SHA256 d3fd5e472a7a261b2d68750143145326ef4cba08be2674d8aa04cba3360041a1 SHA512 9c9d1abe6e547f142ed807212c4719fc10ddfa5286e7fbdb3d745ab5d1be30bb0369c956521aef5a258cdb248f5f207b037e8277711fd3a927e941bcceb50063 WHIRLPOOL 47060dff91e8c82693473772f0edd9bad0b3c7dac02bf0a52dd027f6993a8426625232712819f3594794ff9f555db7b8e5c157340ffa48f4a26cfe165b504bfb
+AUX pari-2.7.0-doc-make.patch 2789 SHA256 24002f7c012799b91db21c10ec3f3c7604ea5da6178dce837cbe12e816edcaf9 SHA512 e595b787750e374916cf4f7f6d2f779f961d4f84c0dbdd9a2b30dee2b9c8df2d34ecb332365d8bccd0f2606241d7bbd0fa51710a7951481c68d8feeb719e13dc WHIRLPOOL 45c8e5a70ee256b39e0b4c558c393d5bb3914f85154fad35661326e09c6efaddb9ca5064e22938d3f88f6d4fad59f79fc583724325143521b150ae7abff3ceb3
+AUX pari-2.7.0-no-automagic.patch 3881 SHA256 2ac0b2a810f4f1ccb3eb137a47d3b35d5779471c26391f049c9e9ccbae90b7d9 SHA512 3e55d5c1c3a97be236480c8c602f9bcebb639b1fc6bdf450f26dc99e56d2f6b7dc9bdf8f4863a8780a41ce5d05c4716c40927f96bf649e29aed090e106982184 WHIRLPOOL 80285c88f6b1fb44fefa479bcf9fb1e9f268addccc284f4475c0a0f69b4d871262d474d08f78acc7b249a5ae0ee942fd7f13934365b4e6ca3ef6666df7e4004f
+AUX pari-2.7.0-no-dot-inc.patch 1646 SHA256 793f17ed7dd223ba4d53c592e02852be9cfaf1e367044ddc4ae89d9f47cef5f7 SHA512 7908992b3a38162d805b2c2190587a114248cb7db1424ab6519f6dcb839c4570c4b07b12f54f7f03bc61c08a009cdb0a840747f1436fe287b2f6962edb78d733 WHIRLPOOL 39d75236b17479850b949619347e6f4901445b4998bf1ec478e919696dbf4f6fdeeb41114c356c4d557ba6ea0475b2e35bfa88a065081bbd3de623e88d1e0b75
+AUX pari-2.7.0-slow-discriminant.patch 2030 SHA256 5b233d4f8b4df3aa526ccba93c544aefd8b8cc8d95e14041fbedfa03238cecf9 SHA512 4f4bbb33968450ebf32a90905c80dbb304047620ca3949543c43a87943f3fef9efb16544ca03791fcc41aba65bc93ae5f37e5e64ab1eab0569622572c95234ff WHIRLPOOL 176f30eaa9a5af7cbd97b28669cda00d738e865fb6921e4e0999c4bb37b755b752186988465919dd92cf4d27f45c4571bfe1b5686930b0d1c7153ab5d02caa71
+AUX pari-2.7.1-perl-5.22-doc.patch 507 SHA256 0d6bbf6c49da39a50fb3f23b0a1118697e0af3a8faddea25cb261dfecc1e8e7c SHA512 b3617a54be7525a87b0277eca04eb3124ad027589b34064d830f5a8011ff827d9f43129244d256259227f2e350cac83813283a7bd80a8e6bbb324394c25e74b5 WHIRLPOOL 0e32b5634836c58844cce87d2ebf187e885445352ad9f64d625f8e0b25b82a0a4521d70d6bfbcd0aeecf73918691b60e1f3992da110ead31dd70ee49eb39c43d
+DIST elldata.tgz 14185595 SHA256 4102c23fdbeadc89b47ba31d05fc58cd3c3e0cca216b11ec5c3be1330d4a5218 SHA512 dc13d1cacb98a6c2774936997452bd34ae198da9206fea69bc7cdd28240d0cdd07bb0ec1f14b8e97bea4321a60a6a6144464ab3b629be2e37dd76a73efaf43ef WHIRLPOOL d77dd852997c15b2fbf56bb8c0403de49daae735e8d464c34ec3f44d38913285ea47122af8ddfd38fe6bbbc3187c1060a50c04ca14afae2d5b1532d815210435
+DIST galdata.tgz 53229 SHA256 b7c1650099b24a20bdade47a85a928351c586287f0d4c73933313873e63290dd SHA512 bc89c8a42416e8ca25c356b7ad6d80ffcfff127e561fc338df87147a9e370ec71f7ae2eb6bef73d634cc7a8f18c794d7fd5ebfd0a042d3d356526a2eee28125a WHIRLPOOL 9332243fc120adde8bf511898c89c275b2db7e16f34b66e77ecd8789d0e14cc26a42d10bd7fb2cc849e9ed2b6494912e0baf4c6e8a12a6c9726f54e754a56e39
+DIST nftables.tgz 8393731 SHA256 8dd3393ce6b3cfcf599f094f7b22bdffe17c3ba25deb912513d54676bd7cfe92 SHA512 cccc62fb0f6d8c578a4e165a1f2daf3b87acbbc38377044ddd98e2901a8e0554a46c8714bad0f4f4e09107b0c0c8f43069b4ddf4fba9c7832bad65ce3c901183 WHIRLPOOL 77f6dccd9c08722b5283670167975a17fdd732ddd234979b82c413b6ac529d068ff64de9bbc77fea45eb8663fa72b168143463642e9d8abcdb3739aa4845258c
+DIST pari-2.3.5.tar.gz 2018097 SHA256 47ddae1af73b4476660d2a89338483949067a97ffb8758c82e8189dfa4c89d88 SHA512 0e49e6310b4c76ef3370786a13aa8cbc5bb0b7dc84ec1665866d623e6284f45db8584eea759e8b5954dc9b5c8a3e866e77a377d18073ed33f11708a7e88a4cca WHIRLPOOL 1d7f3fcfb5c4b44479ea7494536bcb7c971df721a23bca9f7bdee878cc91c5beec5353920d352142534e89bb0158bfd8ad9a431a22c90fc577676e3f8ceb8b9b
+DIST pari-2.5.0.tar.gz 2714449 SHA256 5dc923b001ca0f8664facfafcd91946be63faf8f0e1df4b11bfac80f89ec37a2 SHA512 701abdf4d65bcaeac9bdd314b1fc24a59de9ee1874b9abba5761cb88bb871c18d108a99cf1cbf9a357ac192196c043592e0e5d1645689d5a6f85afbfa7a9096f WHIRLPOOL 7a37d1a8b1a07a80a2a568335d4677fc981f242768c44f9bcf0926d9019861483c72ebb861927da4bfcc4b075155b0a893f9029176126c26f08adbc8244b94f8
+DIST pari-2.5.1.tar.gz 2718726 SHA256 72c1828af50878acf5f09b553e45ac04b24400e095d16e6948a06947538a8f4f SHA512 dd304bd02402602c1f114a7f4d1e54af0fce8707b196fd9da617c028ba3426418813aeaf818fecaa9f76572b1d36847463a3aa7f60848cdec607ec70131dc263 WHIRLPOOL acb4e2ce3b6680e6df1adc3d36d23b80b16e9efeb681ea726b74a3d83139152ca5e97ae95101cc79a69b9b34df34805efa09bec6663f30ea658d9cb07c587e45
+DIST pari-2.5.2.tar.gz 2719367 SHA256 6f04da2719b09fc7c4c713377df6541d641bbdd9ffc60aad280ba7951561ed98 SHA512 2d0332e5604a6bd41c8328c4cffc42302dd85db077a950e19769a0cc7b8c3e17b7c4c5c1514ecb2f75757015baa7e7df76f6174e997fbaa90874c5e6cf5e7fce WHIRLPOOL 27acb1350a1b4b06b97590f2e0c83d4cf03d6b321ca734c30c42efd50a370a3a1dabe346ed4bb8da63ee2f9f07a7353fc7358d71dd35c7e0eaab9a440ef19d08
+DIST pari-2.5.3.tar.gz 2720543 SHA256 f421530fe396f14be882e822f972b0514e30ca169c8ff984e413806d2d63527f SHA512 8606f1f1b59a8e9e8b5bdbaacd03f980da99616568c180eb37f6f530efad396343e3146f6c7adfc5dac6e43a1d35c898531ecf61dd6d62c26cafcd2554f8c43b WHIRLPOOL 01ed6c9133b2f16a21b3d9eda84a0ffbaff90fac2ed1ade055850e51524f9d1ba8bc39a9686c72e0705876a63cfd8dd31cd7364c825353b1781a22d305658d2e
+DIST pari-2.5.4.tar.gz 2721861 SHA256 9f37e14aca6c38cc9b7c18edec3319a30dcdb42e217981eda1fe85866c91fa3e SHA512 de2f0593682d638288908636d848489acf115f4858b91c574168db26c4ab7443465a21d1e6c43be19ecc57dcedcd883e5af72b65467a59a2c8811e4eec64e0b9 WHIRLPOOL 522c0451568f37dcbc89a2c47582051579fa7f3bd1eb4a0ad20f0023b1af0f0d5df14ef956bda170ed6539b0d2caa193c1b0807565abcdde9abfd03af0112be6
+DIST pari-2.7.0.tar.gz 3142306 SHA256 ffe9940194b4a1274d8aa690d985e11539be36fcdd2215b74c39b30470a567c2 SHA512 312ed6032e5b1b431d04cccb593e5ca6ca323361736669be0ed345cbb6cf22114c670984ae74120aacb4ac1af822a1fdf76aed7ba59a1cd4f94e26150562ad84 WHIRLPOOL 10473cfe8e873a4f3e15d70b5574502eac0fc7004af0842748436ee01d1470cdd3226864fb207bc31cef5387f41dc3d8503b7726de489469949a3ed0af98d05d
+DIST pari-2.7.1.tar.gz 3140893 SHA256 cc637918f3c0b20dc9bbea99e639e7a288b89ea4d0e4e3f9b7110a115bcb41be SHA512 ff32c181e6810af8a38f0dfe45b9f15d930923da5759c3e88595f56bf3c65ec0a79fdb9fb5f0e4ce0adb1ebc56a84e6b1606085057762073a85c0d1946857d5f WHIRLPOOL abd1f34de0d54f1b9d555927156baf8bdc54bf29c486ee41e943d414dadc3a68ada5e1af0e48acdfebb386273936a4925428a8fda1f69d250e66b15d857e236e
+DIST seadata.tgz 19214199 SHA256 c9282a525ea3f92c1f9c6c69e37ac5a87b48fb9ccd943cfd7c881a3851195833 SHA512 393f2fae45964ad0921fcf417113e10b296cb4c3a0e0eec138c896827f43a5464c4b42a07313e0f3a4383e8df97912e2e359a4cd5225d014d7575e80c7dd996a WHIRLPOOL 0f1c94e8bf5be7ed923a8ff9012fa8df9cf851e1316b09ed28fff707e39abc034cb33ae84bdb80a302211c16ccfbd98ccdbad74254fbc5e3cd80ce28910516d9
+EBUILD pari-2.3.5.ebuild 3839 SHA256 fde037e87412df9c5eb3931546b0833736b03068873c2f74364e030b76bddad2 SHA512 344ed7118f3d9b63d153683515d093d83b961904f4383fd14decf0f9402c4f570ddc2a5f2b4ed2f561d6f91313768eebdac6da3887f591cbe8f6b7024c9ae357 WHIRLPOOL 7c2aa9a4443461a0af2591d2acabe04e88069b726ae82e0a53a35221e1e502ba743aabf2f2d3c151cc99f161620f0d24107f483ea393151c49eca94ced8202c0
+EBUILD pari-2.5.0-r3.ebuild 3824 SHA256 7e80328d157ed8c188e9356ae64dac55e5eb3356d70150f0d8b22f5ec31a0efb SHA512 bae7337fcf806328c2f461f1139dfcddd2215dec04bf98996fc2c6d1806a139362c2eff651f5d5f79cba223a95f6ca4bfcfe64ed9b90866c69f1bbfd6ef73f1c WHIRLPOOL 88e506305f34672977df42fa4bf14dbd3059bcd78b218a52b1dffe60a33eab800a9875e48bbc9fab9723d91d61eeb18141621c32fb5d207ade80e696878907cf
+EBUILD pari-2.5.1-r1.ebuild 4056 SHA256 a6dcd2b03ec69369bda59558c1891c9c0d34bead8b2b6af31eb553a82404be0f SHA512 c4e1176cd5559be694c88ea40fe4a91ffa01393a56605c92511ddf2f043ab5b797e1825b208613a116517fe6172efdce9428372d3547fd8bdc5f478fbcf67da6 WHIRLPOOL a2fe80fb210b549fb54fcb9e417c0c844baf52376cca8c237f81ae14b4aad1886cf7774fd6074b2f0f46faa860ff8ba76083fad927b425a34b9f7f7cfee80614
+EBUILD pari-2.5.1.ebuild 3903 SHA256 58727eb2aadd5b67cd36bca3b5b4a1ac311c995f35d0c3d442d5691f69f6ab3a SHA512 70ed0f66a8e53fba0d7cb956c52adbb452cf02e1f296748f8836eaaa0234b836aa0ab0633880c95cceebdd37fc2f6fa05889eabd13b7adc083d30f06ec4cbbb1 WHIRLPOOL f13003ddf9cae75c51dafdf2fc9b7f1b3d5269dd9fb152d38120bde7cf55b1c8ff004d9ad8901b0d39cd1b87c3610c999f9097f050bb58982a55a30141311158
+EBUILD pari-2.5.2.ebuild 3903 SHA256 9ff6c4177e46c433341e466673a6069516d3e315acebbb4f62f92416f127b3e2 SHA512 20b02b652acfea6f777a5cf4946940d034727cacaf84ddb627799387bbe9c39db47825869a46acd3794b2048733d2b6713d8e5e4d68e383af93077263e2ca98a WHIRLPOOL a8388a7e8a2f7d371572d0a404598099b14e7083ec679a3f5af384a23c3ea9423cfe896f35fcd3c8c8628ffcdb054fd99535679f444f8818663574b62f929783
+EBUILD pari-2.5.3.ebuild 3903 SHA256 e912304e239c677d0ca9831e16fe43e64f4956af5ac21b78ca3c6ef7f246483f SHA512 6bd96c6124a35ee53efa2345e70e9a2931d836a16f1f2e08e285c4a6ec616404ba056f344769ddfb69d0bab1f82ed7c2082ce66fae3b440474a5fc66f1b094e2 WHIRLPOOL 0ed41da2b2bdf9c9d6e67c4ae6e99c4cd7776e308e54273e536175c1f9f4618c3a904ac6bf97147c1fe45fb0a2ca0e3cb2da4d5cf8388e59e20b3d1ce399d404
+EBUILD pari-2.5.4.ebuild 4254 SHA256 15687dda9826e4ea32acd85f696ed4430affdf621cd5c4a315bfbbd8e6f89780 SHA512 b7deb8b4f2d6ec18f7990decf6f35d40fdc8d44b5a823c11feaefdf751e06cfd8f226d1928d534260325071adb675fc5f98cc7c7aed9ce636c8e3429e5926aa1 WHIRLPOOL 228d5582eaa855eecc48cd8749cc5dc39bcae86439be3a1389c12978d054730c6457d40f9a988b8cca756cf0805ebf720686a8905245f1e740131e0fc5b29a36
+EBUILD pari-2.7.0.ebuild 3921 SHA256 5cff116a52cf2ca9f4913d668c8693af10bb40ad7c9e06d7b0ca1fb6c2f1542c SHA512 554b7d5fbb6a45c7a65da9ba7ab63e99ec5af7d4c0e82e4a72d68e7a7d533cc2502db29fff59e617e07794d60f2c5c16bb33da9519d5231c1a8f7b317ff9e204 WHIRLPOOL 99820a61c724d0b4f743909666c81cd10cc036e18a39ca8b8ad49ea736ba949fdf1f67d1bf213a1a0823059c26ed5d50f76a1ee1949f7f8f66d4b13356cbd762
+EBUILD pari-2.7.1.ebuild 4016 SHA256 e5c48ff8e8f3e463f58d136630960b7d06f452cc32f196809475f16bdddebaa2 SHA512 36a9583bc68a3d5703142f74c066b3326d3edfdf5ce92e08372df1f5d0bf11f1b33477e7272d85281ee799a218fc53c1110b43e82ca802cb8ad6a5219945ef12 WHIRLPOOL 356f1e2749e7dd649b91e428615dbd72d7f5853ead261b4a50f22b233c848b2a9c9b56be76960ca237cafdd0ae1441ee63d9a5631dcf0be11515c011dccc3f4e
+MISC ChangeLog 3907 SHA256 9d36f4f698c7b0b00c91d9c61df52ff849929712d805fce8e9eb8da423968c6f SHA512 8c32f37d7d5906c8f743011f75ec48e8028c43e36c91cba53ec1b4d1827efa15ee75922e5317635001871ab568f24dba4c06a1234534a1dcb43dbeae2bc8d0a5 WHIRLPOOL b3a76755e81a798ea0762a6c1819ea7ac275d6f6ee4d58ba06a680f1d4bd22958194646200603c535567c49edda5c2902777c7c15f9b3e7809efad4e32f58e71
+MISC ChangeLog-2015 19569 SHA256 bb053a3edd0a31f38fd9c731177193dbfd1fc5b7f7948518fc7026fdb850f3ff SHA512 404fd8c85bad7a04fa6ce2b11836db7a2510be44ea443b07f263bbdbb6230d24d131a360f5847c2c16642df6d961afb843c69daf56c24478ac00b64277af058a WHIRLPOOL bac82f0597751a287cc0b18ecc382f754facbecb808c81a8ded4920f0926482f133cbe90c383e78e59c6808e6e12aa7dd251c32487516561579c723c6ae14d40
+MISC metadata.xml 1223 SHA256 50e1f5434d3d2597612afd5df9105e4814548c10faefdda7f791e0f3f82318df SHA512 3bb69fc9e0757e6fd1ed9f9394565a34269cd9ccc8dc2ce88283e2f2da8b4ef586b20fb914be28a4b3617ff074319f5925e0fc7a1e264b655303e943a63d6bfe WHIRLPOOL f595ada487113e98061b982215bfff843b200860e437cb34af0bed8be1b53a3b220df479247dcd0c0233885869c38404f56d225f3b8a1a4537c3c77e34a75f7a
diff --git a/sci-mathematics/pari/files/50pari-gentoo.el b/sci-mathematics/pari/files/50pari-gentoo.el
new file mode 100644
index 000000000000..2f5b4da9084e
--- /dev/null
+++ b/sci-mathematics/pari/files/50pari-gentoo.el
@@ -0,0 +1,10 @@
+
+;; site-init for sci-mathematics/pari
+
+(add-to-list 'load-path "@SITELISP@")
+
+(autoload 'gp-mode "pari" nil t)
+(autoload 'gp-script-mode "pari" nil t)
+(autoload 'gp "pari" nil t)
+(autoload 'gpman "pari" nil t)
+(add-to-list 'auto-mode-alist '("\\.gp$" . gp-script-mode))
diff --git a/sci-mathematics/pari/files/pari-2.3.2-ppc-powerpc-arch-fix.patch b/sci-mathematics/pari/files/pari-2.3.2-ppc-powerpc-arch-fix.patch
new file mode 100644
index 000000000000..e3581c9de349
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.3.2-ppc-powerpc-arch-fix.patch
@@ -0,0 +1,11 @@
+diff -Naur pari-2.3.2/config/arch-osname pari-2.3.2.new/config/arch-osname
+--- pari-2.3.2/config/arch-osname 2006-02-15 05:12:59.000000000 -0500
++++ pari-2.3.2.new/config/arch-osname 2007-11-26 00:17:17.000000000 -0500
+@@ -30,6 +30,7 @@
+ osf1) case "$5" in alpha) arch=alpha;; esac;;
+ linux) arch=`uname -m`
+ case $arch in
++ ppc) arch=powerpc;;
+ sparc64) arch=sparcv9;;
+ parisc*) arch=hppa;;
+ sparc) case "`cat /proc/cpuinfo`" in
diff --git a/sci-mathematics/pari/files/pari-2.3.2-strip.patch b/sci-mathematics/pari/files/pari-2.3.2-strip.patch
new file mode 100644
index 000000000000..0fee947fd556
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.3.2-strip.patch
@@ -0,0 +1,11 @@
+--- config/Makefile.SH. 2007-10-01 23:45:45.000000000 +0200
++++ config/Makefile.SH 2007-10-01 23:55:10.000000000 +0200
+@@ -208,7 +208,7 @@
+ MV = mv -f
+ LN = $ln_s
+ CP_F = cp -f
+-STRIP = strip
++STRIP = true
+ STRIPFLAGS =
+
+ # Change these installation directories to suit your needs.
diff --git a/sci-mathematics/pari/files/pari-2.3.5-doc-make.patch b/sci-mathematics/pari/files/pari-2.3.5-doc-make.patch
new file mode 100644
index 000000000000..67edc8c70f11
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.3.5-doc-make.patch
@@ -0,0 +1,46 @@
+--- config/DOC_Make.SH.orig 2010-09-21 21:24:56.655520480 +1200
++++ config/DOC_Make.SH 2010-09-21 21:26:24.683520242 +1200
+@@ -30,23 +30,23 @@
+ -rm -f libpari.std
+ pdftex libpari
+ pdftex libpari
+- make libpari.std; pdftex libpari; rm -f libpari.std
++ \$(MAKE) libpari.std; pdftex libpari; rm -f libpari.std
+ libpari.dvi: \$(PARI_TEX) \$(MACROS)
+ -rm -f libpari.std
+ tex libpari
+ tex libpari
+- make libpari.std; tex libpari; rm -f libpari.std
++ \$(MAKE) libpari.std; tex libpari; rm -f libpari.std
+
+ develop.pdf: develop.tex \$(MACROS)
+ -rm -f develop.std
+ pdftex develop
+ pdftex develop
+- make develop.std; pdftex develop; rm -f develop.std
++ \$(MAKE) develop.std; pdftex develop; rm -f develop.std
+ develop.dvi: develop.tex \$(MACROS)
+ -rm -f develop.std
+ tex develop
+ tex develop
+- make develop.std; tex develop; rm -f develop.std
++ \$(MAKE) develop.std; tex develop; rm -f develop.std
+
+ tutorial.pdf: tutorial.tex \$(MACROS)
+ -rm -f tutorial.std
+@@ -74,13 +74,13 @@
+ -rm -f users.std
+ tex users
+ tex users
+- make users.std; tex users; rm -f users.std
++ \$(MAKE) users.std; tex users; rm -f users.std
+
+ users.pdf: \$(USERS_TEX)
+ -rm -f users.std
+ pdftex users
+ pdftex users
+- make users.std; pdftex users; rm -f users.std
++ \$(MAKE) users.std; pdftex users; rm -f users.std
+
+ gpman: gp.1
+ nroff -man gp.1 | unix2dos -ascii > gp.man
diff --git a/sci-mathematics/pari/files/pari-2.3.5-no-dot-inc.patch b/sci-mathematics/pari/files/pari-2.3.5-no-dot-inc.patch
new file mode 100644
index 000000000000..cd34851a30fb
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.3.5-no-dot-inc.patch
@@ -0,0 +1,61 @@
+From 4f1e00df5ea1e51042146f6277bb1af02f249cc3 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentfredric@gmail.com>
+Date: Sun, 11 Jun 2017 10:31:03 +1200
+Subject: [PATCH] Fix for 5.26 removal of '.' in @INC
+
+Previous scripts assumed CWD was in @INC and that "PARI::822" was in
+wherever CWD was.
+
+This fixes both of those, and the latter, because its not obvious
+from the build system where one should assume CWD to be.
+
+Instead, the absolute path of the directory of these scripts is
+inserted into @INC
+---
+ src/desc/gen_member | 4 ++++
+ src/desc/gen_proto | 4 ++++
+ src/desc/merge_822 | 4 ++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/desc/gen_member b/src/desc/gen_member
+index 2f3cf52..66dea2b 100755
+--- a/src/desc/gen_member
++++ b/src/desc/gen_member
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ $class='member_functions';
+diff --git a/src/desc/gen_proto b/src/desc/gen_proto
+index 1b507fa..2fb4d3f 100755
+--- a/src/desc/gen_proto
++++ b/src/desc/gen_proto
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ $class=$ARGV[0];
+diff --git a/src/desc/merge_822 b/src/desc/merge_822
+index a02d612..9ca8252 100755
+--- a/src/desc/merge_822
++++ b/src/desc/merge_822
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ PARI::822::read(\%funcs,$_,1)
+--
+2.13.1
+
diff --git a/sci-mathematics/pari/files/pari-2.5.0-doc-make.patch b/sci-mathematics/pari/files/pari-2.5.0-doc-make.patch
new file mode 100644
index 000000000000..0882da03e6a4
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.0-doc-make.patch
@@ -0,0 +1,82 @@
+--- config/DOC_Make.SH.orig 2011-07-28 14:11:34.430896929 +1200
++++ config/DOC_Make.SH 2011-07-28 14:11:39.832738158 +1200
+@@ -21,7 +21,8 @@
+
+ doc all: develop.dvi libpari.dvi users.dvi refcard.ps tutorial.dvi
+ docps: develop.ps libpari.ps refcard.ps tutorial.ps users.ps INSTALL.ps
+-docpdf: develop.pdf libpari.pdf users.pdf tutorial.pdf refcard.pdf INSTALL.pdf
++#docpdf: develop.pdf libpari.pdf users.pdf tutorial.pdf refcard.pdf INSTALL.pdf
++docpdf: \$(PARI_TEX) \$(MACROS) pass1 pass2 indexing refcard.pdf INSTALL.pdf
+
+ .SUFFIXES: .tex .ipf .pod .inf .dumbpod .3 .html
+
+@@ -37,27 +38,49 @@
+ %.dvi: %.tex \$(MACROS)
+ tex \$<
+
++pass1: \$(PARI_TEX) \$(USERS_TEX) develop.tex tutorial.tex \$(MACROS)
++ -rm -f *.std
++ pdftex libpari
++ pdftex develop
++ pdftex tutorial
++ pdftex users
++
++pass2: pass1
++ pdftex libpari
++ pdftex develop
++ pdftex tutorial
++ pdftex users
++
++indexing: pass2
++ \$(MAKE) libpari.std
++ \$(MAKE) develop.std
++ \$(MAKE) users.std
++ pdftex libpari
++ pdftex develop
++ pdftex users
++ -rm -f *.std
++
+ libpari.pdf: \$(PARI_TEX) \$(MACROS)
+ -rm -f libpari.std
+ pdftex libpari
+ pdftex libpari
+- make libpari.std; pdftex libpari; rm -f libpari.std
++ \$(MAKE) libpari.std; pdftex libpari; rm -f libpari.std
+ libpari.dvi: \$(PARI_TEX) \$(MACROS)
+ -rm -f libpari.std
+ tex libpari
+ tex libpari
+- make libpari.std; tex libpari; rm -f libpari.std
++ \$(MAKE) libpari.std; tex libpari; rm -f libpari.std
+
+ develop.pdf: develop.tex \$(MACROS)
+ -rm -f develop.std
+ pdftex develop
+ pdftex develop
+- make develop.std; pdftex develop; rm -f develop.std
++ \$(MAKE)make develop.std; pdftex develop; rm -f develop.std
+ develop.dvi: develop.tex \$(MACROS)
+ -rm -f develop.std
+ tex develop
+ tex develop
+- make develop.std; tex develop; rm -f develop.std
++ \$(MAKE) develop.std; tex develop; rm -f develop.std
+
+ tutorial.pdf: tutorial.tex \$(MACROS)
+ -rm -f tutorial.std
+@@ -85,13 +108,13 @@
+ -rm -f users.std
+ tex users
+ tex users
+- make users.std; tex users; rm -f users.std
++ \$(MAKE) users.std; tex users; rm -f users.std
+
+ users.pdf: \$(USERS_TEX)
+ -rm -f users.std
+ pdftex users
+ pdftex users
+- make users.std; pdftex users; rm -f users.std
++ \$(MAKE) users.std; pdftex users; rm -f users.std
+
+ gpman: gp.1
+ nroff -man gp.1 | unix2dos -ascii > gp.man
diff --git a/sci-mathematics/pari/files/pari-2.5.0-macos.patch b/sci-mathematics/pari/files/pari-2.5.0-macos.patch
new file mode 100644
index 000000000000..1b4076009379
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.0-macos.patch
@@ -0,0 +1,21 @@
+--- config/get_dlld.orig 2011-07-28 14:27:13.341072367 +1200
++++ config/get_dlld 2011-07-28 14:27:46.225178023 +1200
+@@ -94,7 +94,7 @@
+ *) extra=;;
+ esac
+ case "$osname" in
+- darwin) shared=-dynamiclib;;
++ darwin) shared="-dynamiclib -install_name \$(PURELIBDIR)/\$(LIBPARI_DYN)";;
+ *) shared=-shared;;
+ esac
+ DLLDFLAGS="$shared $extra \$(CFLAGS) \$(DLCFLAGS) $DLLDFLAGS"
+--- config/Makefile.SH.orig 2011-07-28 14:29:06.753681364 +1200
++++ config/Makefile.SH 2011-07-28 14:29:10.589276933 +1200
+@@ -234,6 +234,7 @@
+ # DESTDIR is used to install to a false hierachy (to build a Debian package)
+ INCLUDEDIR= "\$(DESTDIR)$includedir"
+ LIBDIR = "\$(DESTDIR)$libdir"
++PURELIBDIR= $libdir
+ BINDIR = "\$(DESTDIR)$bindir"
+ MANDIR = "\$(DESTDIR)$mandir"
+ DATADIR = "\$(DESTDIR)$datadir"
diff --git a/sci-mathematics/pari/files/pari-2.5.0-mp.c.patch b/sci-mathematics/pari/files/pari-2.5.0-mp.c.patch
new file mode 100644
index 000000000000..0bcfffc08176
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.0-mp.c.patch
@@ -0,0 +1,23 @@
+Index: src/kernel/gmp/mp.c
+===================================================================
+--- src/kernel/gmp/mp.c (revision 13151)
++++ src/kernel/gmp/mp.c (working copy)
+@@ -45,18 +45,8 @@
+ /*We need PARI invmod renamed to invmod_pari*/
+ #define INVMOD_PARI
+
+-static void *gmp_realloc(void *ptr, size_t old_size, size_t new_size) {
+- (void)old_size; return (void *) pari_realloc(ptr,new_size);
+-}
+-
+-static void gmp_free(void *ptr, size_t old_size){
+- (void)old_size; pari_free(ptr);
+-}
+-
+ int pari_kernel_init(void)
+ {
+- /* Use pari_malloc instead of malloc */
+- mp_set_memory_functions((void *(*)(size_t)) pari_malloc, gmp_realloc, gmp_free);
+ return 0;
+ }
+
diff --git a/sci-mathematics/pari/files/pari-2.5.0-no-dot-inc.patch b/sci-mathematics/pari/files/pari-2.5.0-no-dot-inc.patch
new file mode 100644
index 000000000000..e34fa6b352ab
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.0-no-dot-inc.patch
@@ -0,0 +1,61 @@
+From 03df0cdd7228a412d2adfe9ee9c746b3ec69dd6b Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentfredric@gmail.com>
+Date: Sun, 11 Jun 2017 10:31:03 +1200
+Subject: [PATCH] Fix for 5.26 removal of '.' in @INC
+
+Previous scripts assumed CWD was in @INC and that "PARI::822" was in
+wherever CWD was.
+
+This fixes both of those, and the latter, because its not obvious
+from the build system where one should assume CWD to be.
+
+Instead, the absolute path of the directory of these scripts is
+inserted into @INC
+---
+ src/desc/doc_make | 4 ++++
+ src/desc/gen_proto | 4 ++++
+ src/desc/merge_822 | 4 ++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/desc/doc_make b/src/desc/doc_make
+index 02dc90d..55296ed 100755
+--- a/src/desc/doc_make
++++ b/src/desc/doc_make
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ PARI::822::read(\%funcs, "pari.desc");
+diff --git a/src/desc/gen_proto b/src/desc/gen_proto
+index 38c2daf..ffb4276 100755
+--- a/src/desc/gen_proto
++++ b/src/desc/gen_proto
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ $class=$ARGV[0];
+diff --git a/src/desc/merge_822 b/src/desc/merge_822
+index 4c9217b..32b3cc9 100755
+--- a/src/desc/merge_822
++++ b/src/desc/merge_822
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ open(IN, $ARGV[0]) || die "cannot find $ARGV[0]";
+--
+2.13.1
+
diff --git a/sci-mathematics/pari/files/pari-2.5.1-1302.patch b/sci-mathematics/pari/files/pari-2.5.1-1302.patch
new file mode 100644
index 000000000000..245e587d275c
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.1-1302.patch
@@ -0,0 +1,33 @@
+commit 917b505c86a70dda2191d380861af05becc03858
+Author: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>
+Date: Mon Mar 12 23:54:11 2012 +0100
+
+ ispower(x < 0,, &n): n could have the wrong sign [#1302]
+
+diff --git a/src/basemath/arith1.c b/src/basemath/arith1.c
+index ded946b..5502ba5 100644
+--- a/src/basemath/arith1.c
++++ b/src/basemath/arith1.c
+@@ -1109,6 +1109,7 @@ Z_isanypower(GEN x, GEN *pty)
+ *pty = gerepileuptoint(av, y);
+ return k;
+ }
++ if (pty) togglesign_safe(pty);
+ }
+ if (pty) *pty = gerepilecopy(av, *pty); else avma = av;
+ return k;
+diff --git a/src/test/32/ispower b/src/test/32/ispower
+index bf4b6f0..84d8de7 100644
+--- a/src/test/32/ispower
++++ b/src/test/32/ispower
+@@ -1118,7 +1118,7 @@
+ [2, 999]
+ [6, 10]
+ [3, -4]
+-[3, 2]
+-[3, 21218]
++[3, -2]
++[3, -21218]
+ [3, -1/4]
+-Total time spent: 3236
++Total time spent: 3012
diff --git a/sci-mathematics/pari/files/pari-2.5.1-1304.patch b/sci-mathematics/pari/files/pari-2.5.1-1304.patch
new file mode 100644
index 000000000000..3da2e8558dac
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.1-1304.patch
@@ -0,0 +1,39 @@
+commit ff707a3f2ba2d5c555434ba50547453833a7570f
+Author: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>
+Date: Sun Mar 18 23:54:02 2012 +0100
+
+ 71- issquarefree(0) => error [#1304]
+
+diff --git a/src/basemath/ifactor1.c b/src/basemath/ifactor1.c
+index 046491f..8f9fbaa 100644
+--- a/src/basemath/ifactor1.c
++++ b/src/basemath/ifactor1.c
+@@ -3493,7 +3493,11 @@ moebius(GEN n)
+ GEN
+ gissquarefree(GEN x) { return map_proto_lG(issquarefree,x); }
+ long
+-Z_issquarefree(GEN n) { return moebius(n)? 1: 0; }
++Z_issquarefree(GEN n)
++{
++ if (!signe(n)) return 0;
++ return moebius(n)? 1: 0;
++}
+ long
+ issquarefree(GEN x)
+ {
+diff --git a/src/test/32/arith b/src/test/32/arith
+new file mode 100644
+index 0000000..3c5981a
+--- /dev/null
++++ b/src/test/32/arith
+@@ -0,0 +1,2 @@
++0
++Total time spent: 8
+diff --git a/src/test/in/arith b/src/test/in/arith
+new file mode 100644
+index 0000000..fb92bed
+--- /dev/null
++++ b/src/test/in/arith
+@@ -0,0 +1,2 @@
++\\#1304
++issquarefree(0)
diff --git a/sci-mathematics/pari/files/pari-2.5.1-gcc47.patch b/sci-mathematics/pari/files/pari-2.5.1-gcc47.patch
new file mode 100644
index 000000000000..e7b27159fa06
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.1-gcc47.patch
@@ -0,0 +1,18 @@
+Index: pari-2.5.1/src/basemath/bibli2.c
+===================================================================
+--- pari-2.5.1.orig/src/basemath/bibli2.c 2012-01-26 17:26:13.000000000 +0100
++++ pari-2.5.1/src/basemath/bibli2.c 2012-06-04 10:08:41.000000000 +0200
+@@ -1394,12 +1394,12 @@
+ int (*CMP)(void*,GEN,GEN);
+ int (*cmp)(GEN,GEN) = (flag & cmp_LEX)? &lexcmp: &gcmp;
+ void *E;
++ struct veccmp_s v;
+
+ if (flag < 0 || flag > (cmp_REV|cmp_LEX|cmp_IND|cmp_UNIQ))
+ pari_err(flagerr,"vecsort");
+ if (k) {
+ long i, j, l, lk, tx, lx;
+- struct veccmp_s v;
+ GEN y;
+
+ /* cf init_sort */
diff --git a/sci-mathematics/pari/files/pari-2.5.1-no-automagic.patch b/sci-mathematics/pari/files/pari-2.5.1-no-automagic.patch
new file mode 100644
index 000000000000..8fee1f7eaf70
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.1-no-automagic.patch
@@ -0,0 +1,100 @@
+diff -Nur pari-2.5.1.orig/config/get_config_options pari-2.5.1/config/get_config_options
+--- pari-2.5.1.orig/config/get_config_options 2012-08-01 18:32:03.000000000 +0100
++++ pari-2.5.1/config/get_config_options 2012-08-01 20:57:09.000000000 +0100
+@@ -83,10 +83,12 @@
+ --with-ncurses-lib=*|--with-ncurses=*)
+ with_ncurses_lib=`echo "$1" | sed -e 's/[-a-z]*=//'` ;;
+
++ --without-qt|--with-qt=no) without_qt=yes ;;
+ --with-qt) with_qt=yes ;;
+ --with-qt=*)
+ with_qt=`echo "$1" | sed -e 's/[-a-z]*=//'` ;;
+
++ --without-fltk|--with-fltk=no) without_fltk=yes ;;
+ --with-fltk) with_fltk=yes ;;
+ --with-fltk=*)
+ with_fltk=`echo "$1" | sed -e 's/[-a-z]*=//'` ;;
+@@ -158,7 +160,9 @@
+ --with-gmp-lib=DIR specify location of gmp libs
+
+ --with-qt[=DIR] use the Qt graphical library [prefix for Qt dir.]
++ --without-qt do not try to use the Qt lib
+ --with-fltk[=DIR] use the FLTK graphical library [prefix for FLTK dir.]
++ --without-fltk do not try to use the FLTK lib
+
+ EOT
+ exit 1
+diff -Nur pari-2.5.1.orig/config/get_fltk pari-2.5.1/config/get_fltk
+--- pari-2.5.1.orig/config/get_fltk 2012-08-01 18:32:03.000000000 +0100
++++ pari-2.5.1/config/get_fltk 2012-08-01 22:28:23.000000000 +0100
+@@ -2,6 +2,9 @@
+ with_fltk=yes
+ fi
+ FLTKDIR=
++if test -z "$without_fltk; then
++ FLTKDIR="`fltk-config --prefix 2>/dev/null`"
++fi
+ case "$with_fltk" in
+ yes)
+ pth=$libpth; lib=fltk; . ./locatelib
+diff -Nur pari-2.5.1.orig/config/get_graphic_lib pari-2.5.1/config/get_graphic_lib
+--- pari-2.5.1.orig/config/get_graphic_lib 2012-08-01 18:32:03.000000000 +0100
++++ pari-2.5.1/config/get_graphic_lib 2012-08-01 22:16:57.000000000 +0100
+@@ -11,6 +11,7 @@
+ else
+ if test -n "$with_fltk"; then which_graphic_lib=fltk; fi
+ if test -n "$with_qt"; then which_graphic_lib=Qt; fi
++ if test -n "$without_fltk" -a -n "$without_qt"; then which_graphic_lib=none; fi
+ if test "$which_graphic_lib" != none; then
+ case $osname in
+ mingw) case $which_graphic_lib in
+@@ -41,7 +42,7 @@
+ case $which_graphic_lib in
+ auto|fltk)
+ . ./get_fltk # FLTKDIR, FLTK_LIBS
+- if test -z "$FLTKDIR"; then
++ if test -z "`fltk-config --ldflags 2> /dev/null`"; then
+ case $which_graphic_lib in fltk) which_graphic_lib=none;; esac
+ else
+ which_graphic_lib=fltk
+diff -Nur pari-2.5.1.orig/config/get_Qt pari-2.5.1/config/get_Qt
+--- pari-2.5.1.orig/config/get_Qt 2012-08-01 18:32:03.000000000 +0100
++++ pari-2.5.1/config/get_Qt 2012-08-01 20:39:28.000000000 +0100
+@@ -5,7 +5,7 @@
+ case "$with_qt" in
+ yes)
+ pth="/usr/local/lib /usr/local/share /usr/lib /usr/share"
+- QTDIR=`locatedir qt4/bin $pth`
++ QTDIR=`locatedir qt4 $pth`
+ QTLIB="-lQtCore -lQtGui"
+ which_graphic_lib=Qt4
+ if test -z "$QTDIR"; then
+diff -Nur pari-2.5.1.orig/config/Makefile.SH pari-2.5.1/config/Makefile.SH
+--- pari-2.5.1.orig/config/Makefile.SH 2012-08-01 18:32:03.000000000 +0100
++++ pari-2.5.1/config/Makefile.SH 2012-08-01 21:08:20.000000000 +0100
+@@ -65,12 +65,12 @@
+ PLOTLIBS="-L\$(QTDIR)/lib $QTLIB"
+ graph=plotQt;;
+ Qt4)
+- PLOTCFLAGS='-D__FANCY_WIN__ -I$(QTDIR)/include'
+- PLOTLIBS="-L\$(QTDIR)/lib $QTLIB"
++ PLOTCFLAGS='-D__FANCY_WIN__ `pkg-config --cflags QtGui`'
++ PLOTLIBS="`pkg-config --libs QtGui`"
+ graph=plotQt4;;
+ fltk)
+- PLOTCFLAGS="-I\$(FLTKDIR)/include $X11_INC"
+- PLOTLIBS="-L\$(FLTKDIR)/lib -lfltk $FLTK_LIBS"
++ PLOTCFLAGS="`fltk-config --cxxflags` $X11_INC"
++ PLOTLIBS="`fltk-config --ldflags`"
+ postconfig='-fltk-config --post '
+ graph=plotfltk;;
+ win32)
+@@ -254,7 +254,7 @@
+ GMPINCLUDE = $GMPINCLUDE
+ # Graphic library.
+ QTDIR = "$QTDIR"
+-MOC = \$(QTDIR)/bin/moc
++MOC = "`which moc`"
+ PLOTCFLAGS = $PLOTCFLAGS
+ PLOTLIBS = $PLOTLIBS
+ CPLUSPLUS = g++
diff --git a/sci-mathematics/pari/files/pari-2.5.4-polred.patch b/sci-mathematics/pari/files/pari-2.5.4-polred.patch
new file mode 100644
index 000000000000..4287c9d35d66
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.4-polred.patch
@@ -0,0 +1,754 @@
+diff -ru src/src/basemath/base1.c b/src/basemath/base1.c
+--- src/src/basemath/base1.c 2013-05-06 16:01:56.000000000 +0200
++++ b/src/basemath/base1.c 2013-05-06 16:49:09.042406927 +0200
+@@ -1675,40 +1675,42 @@
+ ZX_is_better(GEN y, GEN x, GEN *dx)
+ {
+ GEN d = ZX_disc(y);
+- long cmp = absi_cmp(d, *dx);
++ int cmp;
++ if (!*dx) *dx = ZX_disc(x);
++ cmp = absi_cmp(d, *dx);
+ if (cmp < 0) { *dx = d; return 1; }
+ if (cmp == 0) return cmp_abs_ZX(y, x) < 0;
+ return 0;
+ }
+
+-static GEN polred_aux(nfbasic_t *T, GEN *pro, long flag);
++static void polredbest_aux(nfbasic_t *T, GEN *pro, GEN *px, GEN *pdx, GEN *pa);
+ /* Seek a simpler, polynomial pol defining the same number field as
+ * x (assumed to be monic at this point) */
+ static GEN
+ nfpolred(nfbasic_t *T, GEN *pro)
+ {
+- GEN x = T->x, dx = T->dx, a, z, rev, pow, dpow;
++ GEN x = T->x, dx, b, rev, pow, dpow;
+ long i, n = degpol(x), v = varn(x);
+
+ if (n == 1) {
+ T->x = deg1pol_shallow(gen_1, gen_m1, v);
+ *pro = NULL; return pol_1(v);
+ }
+- z = polred_aux(T, pro, nf_ORIG | nf_RED);
+- if (typ(z) != t_VEC || !ZX_is_better(gel(z,1),x,&dx))
+- return NULL; /* no improvement */
+-
+- rev = QXQ_reverse(gel(z,2), x);
+- x = gel(z,1); if (DEBUGLEVEL>1) err_printf("xbest = %Ps\n",x);
++ polredbest_aux(T, pro, &x, &dx, &b);
++ if (x == T->x) return NULL; /* no improvement */
++ if (DEBUGLEVEL>1) err_printf("xbest = %Ps\n",x);
+
+ /* update T */
++ rev = QXQ_reverse(b, T->x);
+ pow = QXQ_powers(rev, n-1, x);
+ pow = Q_remove_denom(pow, &dpow);
+- a = T->bas;
+- for (i=2; i<=n; i++) gel(a,i) = QX_ZXQV_eval(gel(a,i), pow, dpow);
++ for (i=2; i<=n; i++) gel(T->bas,i) = QX_ZXQV_eval(gel(T->bas,i), pow, dpow);
+ (void)Z_issquareall(diviiexact(dx,T->dK), &(T->index));
+- T->basden = get_bas_den(a);
+- T->dx = dx; T->x = x; *pro = NULL; return rev;
++ T->basden = get_bas_den(T->bas);
++ T->dx = dx;
++ T->x = x;
++ *pro = NULL; /* reset */
++ return rev;
+ }
+
+ /* let bas a t_VEC of QX giving a Z-basis of O_K. Return the index of the
+@@ -1776,7 +1778,7 @@
+ x = Q_primpart(x);
+ RgX_check_ZX(x, "nfinit");
+ if (!ZX_is_irred(x)) pari_err(redpoler, "nfinit");
+- if (flag & nf_RED || !gequal1(gel(x,lg(x)-1)))
++ if (flag & nf_RED || !equali1(gel(x,lg(x)-1)))
+ x = ZX_Q_normalize(x, &(T->lead));
+ nfmaxord(&S, x, flag, fa);
+ index = S.index;
+@@ -1822,26 +1824,32 @@
+ nfinitall(GEN x, long flag, long prec)
+ {
+ const pari_sp av = avma;
+- GEN nf;
++ GEN nf, lead;
+ nfbasic_t T;
+
+ nfbasic_init(x, flag, NULL, &T);
+ nfbasic_add_disc(&T); /* more expensive after set_LLL_basis */
+- if (T.lead != gen_1 && !(flag & nf_RED))
++ lead = T.lead;
++ if (lead != gen_1 && !(flag & nf_RED))
+ {
+ pari_warn(warner,"non-monic polynomial. Result of the form [nf,c]");
+ flag |= nf_RED | nf_ORIG;
+ }
+ if (flag & nf_RED)
+ {
+- GEN ro, rev = nfpolred(&T, &ro);
++ GEN ro, rev;
++ /* lie to polred: more efficient to update *after* modreverse, than to
++ * unscale in the polred subsystem */
++ T.lead = gen_1;
++ rev = nfpolred(&T, &ro);
+ nf = nfbasic_to_nf(&T, ro, prec);
+ if (flag & nf_ORIG)
+ {
+ if (!rev) rev = pol_x(varn(T.x)); /* no improvement */
+- if (T.lead != gen_1) rev = RgX_Rg_div(rev, T.lead);
++ if (lead != gen_1) rev = RgX_Rg_div(rev, lead);
+ nf = mkvec2(nf, mkpolmod(rev, T.x));
+ }
++ T.lead = lead; /* restore */
+ } else {
+ GEN ro; set_LLL_basis(&T, &ro, 0.99);
+ nf = nfbasic_to_nf(&T, ro, prec);
+@@ -1948,7 +1956,7 @@
+ get_polchar(CG_data *d, GEN x)
+ { return get_pol(d, RgM_RgC_mul(d->ZKembed,x)); }
+
+-/* return a defining polynomial for Q(w_i) */
++/* return a defining polynomial for Q(w_k) */
+ static GEN
+ get_polmin_w(CG_data *d, long k)
+ {
+@@ -1956,6 +1964,22 @@
+ if (g) (void)ZX_gcd_all(g, ZX_deriv(g), &g);
+ return g;
+ }
++/* return a defining polynomial for Q(w_k+w_l) */
++static GEN
++get_polmin_add2(CG_data *d, long k, long l)
++{
++ GEN g = get_pol(d, RgV_add(gel(d->ZKembed,k), gel(d->ZKembed,l)));
++ if (g) (void)ZX_gcd_all(g, ZX_deriv(g), &g);
++ return g;
++}
++/* return a defining polynomial for Q(w_k-w_l) */
++static GEN
++get_polmin_sub2(CG_data *d, long k, long l)
++{
++ GEN g = get_pol(d, RgV_sub(gel(d->ZKembed,k), gel(d->ZKembed,l)));
++ if (g) (void)ZX_gcd_all(g, ZX_deriv(g), &g);
++ return g;
++}
+
+ /* does x generate the correct field ? */
+ static GEN
+@@ -2044,13 +2068,67 @@
+ d->v = varn(T->x);
+ d->r1= T->r1; return prec;
+ }
++static void
++update(GEN *pai, GEN *pch, nfbasic_t *T, long orig)
++{
++ GEN ch = *pch, ai = *pai;
++ if (!ch)
++ { /* accuracy too low, compute algebraically */
++ ch = ZXQ_charpoly(ai, T->x, varn(T->x));
++ (void)ZX_gcd_all(ch, ZX_deriv(ch), &ch);
++ }
++ if (ZX_canon_neg(ch) && orig) ai = RgX_neg(ai);
++ if (DEBUGLEVEL>3) err_printf("polred: generator %Ps\n", ch);
++ if (T->lead != gen_1 && orig) ai = RgX_unscale(ai, ginv(T->lead));
++ *pch = ch; *pai = ai;
++}
++static GEN
++findmindisc(GEN y, GEN *pa)
++{
++ GEN a = *pa, x = gel(y,1), b = gel(a,1), dx = NULL;
++ long i, l = lg(y);
++ for (i = 2; i < l; i++)
++ {
++ GEN yi = gel(y,i);
++ if (ZX_is_better(yi,x,&dx)) { x = yi; b = gel(a,i); }
++ }
++ *pa = b; return x;
++}
++/* filter [y,b] from polred_aux: keep a single polynomial of degree n in y
++ * [ the best wrt discriminant ordering ], but keep all non-primitive
++ * polynomials */
++static void
++filter(GEN y, GEN b, long n)
++{
++ GEN x, a, dx;
++ long i, k = 1, l = lg(y);
++ a = x = dx = NULL;
++ for (i = 1; i < l; i++)
++ {
++ GEN yi = gel(y,i), ai = gel(b,i);
++ if (degpol(yi) == n)
++ {
++ if (dx && !ZX_is_better(yi,x,&dx)) continue;
++ if (!dx) dx = ZX_disc(yi);
++ x = yi; a = ai; continue;
++ }
++ gel(y,k) = yi;
++ gel(b,k) = ai; k++;
++ }
++ if (dx)
++ {
++ gel(y,k) = x;
++ gel(b,k) = a; k++;
++ }
++ setlg(y, k);
++ setlg(b, k);
++}
++
+ static GEN
+-polred_aux(nfbasic_t *T, GEN *pro, long flag)
++polred_aux(nfbasic_t *T, GEN *pro, long orig)
+ {
+ GEN b, y, x = T->x;
+- long i, v = varn(x), l = lg(T->bas);
+- const long orig = flag & nf_ORIG;
+- const long nfred = flag & nf_RED;
++ long maxi, i, j, k, v = varn(x), n = lg(T->bas)-1;
+ nffp_t F;
+ CG_data d;
+
+@@ -2058,27 +2136,41 @@
+ *pro = F.ro;
+ d.ZKembed = F.M;
+
+- y = cgetg(l, t_VEC);
+- b = cgetg(l, t_COL);
++ /* n + 2 sum_{1 <= i <= n} n-i = n + n(n-1) = n*n */
++ y = cgetg(n*n + 1, t_VEC);
++ b = cgetg(n*n + 1, t_COL);
++ /* i = 1 */
+ gel(y,1) = deg1pol_shallow(gen_1, gen_m1, v);
+ gel(b,1) = gen_1;
+- for (i = 2; i < l; i++)
++ for (i = k = 2; i <= n; i++)
+ {
+- GEN ch, ai = gel(T->bas,i);
++ GEN ch, ai;
++ ai = gel(T->bas,i);
+ ch = get_polmin_w(&d, i);
+- /* if accuracy too low, compute algebraically */
+- if (!ch)
++ update(&ai, &ch, T, orig);
++ gel(y,k) = ch;
++ gel(b,k) = ai; k++;
++ }
++ k = i;
++ maxi = minss(n, 3);
++ for (i = 1; i <= maxi; i++)
++ for (j = i+1; j <= n; j++)
+ {
+- ch = ZXQ_charpoly(ai, x, v);
+- (void)ZX_gcd_all(ch, ZX_deriv(ch), &ch);
++ GEN ch, ai;
++ ai = gadd(gel(T->bas,i), gel(T->bas,j));
++ ch = get_polmin_add2(&d, i, j);
++ update(&ai, &ch, T, orig);
++ gel(y,k) = ch;
++ gel(b,k) = ai; k++;
++
++ ai = gsub(gel(T->bas,i), gel(T->bas,j));
++ ch = get_polmin_sub2(&d, i, j);
++ update(&ai, &ch, T, orig);
++ gel(y,k) = ch;
++ gel(b,k) = ai; k++;
+ }
+- if (ZX_canon_neg(ch) && orig) ai = RgX_neg(ai);
+- if (nfred && degpol(ch) == l-1) return mkvec2(ch, ai);
+- if (DEBUGLEVEL>3) err_printf("polred: generator %Ps\n", ch);
+- if (T->lead != gen_1 && orig) ai = RgX_unscale(ai, ginv(T->lead));
+- gel(y,i) = ch;
+- gel(b,i) = ai;
+- }
++ setlg(y, k);
++ setlg(b, k); filter(y, b, n);
+ if (!orig) return gen_sort_uniq(y, (void*)cmpii, &gen_cmp_RgX);
+ (void)sort_factor_pol(mkmat2(y, b), cmpii);
+ settyp(y, t_COL); return mkmat2(b, y);
+@@ -2089,10 +2181,58 @@
+ {
+ pari_sp av = avma;
+ GEN ro;
+- nfbasic_t T; nfbasic_init(x, flag & (nf_PARTIALFACT|nf_RED), fa, &T);
++ nfbasic_t T; nfbasic_init(x, flag & nf_PARTIALFACT, fa, &T);
+ return gerepilecopy(av, polred_aux(&T, &ro, flag & nf_ORIG));
+ }
+
++/* finds "best" polynomial in polred_aux list, defaulting to T->x if none of
++ * them is primitive. *px is the ZX, characteristic polynomial of *pb, *pdx
++ * its discriminant.
++ * Set *pro = polroots(T->x) [ NOT *px ], in case caller needs it. */
++static void
++polredbest_aux(nfbasic_t *T, GEN *pro, GEN *px, GEN *pdx, GEN *pb)
++{
++ GEN a, v, y, x = T->x, b = pol_x(varn(x)); /* default values */
++ long i, l, n = degpol(x);
++ v = polred_aux(T, pro, nf_ORIG);
++ *pdx = T->dx;
++ y = gel(v,2);
++ a = gel(v,1); l = lg(a);
++ for (i=1; i<l; i++)
++ {
++ GEN yi = gel(y,i);
++ pari_sp av = avma;
++ if (degpol(yi) == n && ZX_is_better(yi,x,pdx)) { x = yi; b = gel(a,i); }
++ else avma = av;
++ }
++ *px = x;
++ *pb = b;
++}
++GEN
++polredbest(GEN x, long flag)
++{
++ pari_sp av = avma;
++ GEN dx, ro, b;
++ long fl;
++ nfbasic_t T;
++ switch(flag)
++ {
++ default: pari_err(talker, "invalid flag in polredbest()");
++ case 0: fl = nf_PARTIALFACT; break;
++ case 1: fl = nf_PARTIALFACT|nf_ORIG; break;
++ }
++ nfbasic_init(x, fl, NULL, &T);
++ polredbest_aux(&T, &ro, &x, &dx, &b);
++ if (flag)
++ {
++ if (x == T.x)
++ b = pol_x(varn(x)); /* no improvement */
++ else
++ b = QXQ_reverse(b, T.x);
++ x = mkvec2(x, mkpolmod(b,x));
++ }
++ return gerepilecopy(av, x);
++}
+ /* FIXME: backward compatibility */
+ GEN
+ polred0(GEN x, long flag, GEN fa)
+@@ -2273,22 +2413,6 @@
+ return bound;
+ }
+
+-static GEN
+-findmindisc(GEN y, GEN *pa)
+-{
+- GEN a = *pa, x = gel(y,1), b = gel(a,1), dx;
+- long i, l = lg(y);
+-
+- if (l == 2) { *pa = b; return x; }
+- dx = ZX_disc(x);
+- for (i = 2; i < l; i++)
+- {
+- GEN yi = gel(y,i);
+- if (ZX_is_better(yi,x,&dx)) { x = yi; b = gel(a,i); }
+- }
+- *pa = b; return x;
+-}
+-
+ /* z "small" minimal polynomial of Mod(a,x), deg z = deg x */
+ static GEN
+ store(GEN x, GEN z, GEN a, nfbasic_t *T, long flag, GEN u)
+@@ -2355,7 +2479,7 @@
+ GEN y, a, u;
+ nfbasic_t T;
+
+- nfbasic_init(x, flag & (nf_PARTIALFACT|nf_RED), NULL, &T);
++ nfbasic_init(x, flag & nf_PARTIALFACT, NULL, &T);
+ x = T.x; vx = varn(x);
+
+ if (degpol(x) == 1)
+diff -ru src/src/functions/number_fields/polredabs b/src/functions/number_fields/polredabs
+--- src/src/functions/number_fields/polredabs 2013-05-06 16:01:57.000000000 +0200
++++ b/src/functions/number_fields/polredabs 2013-05-06 16:47:04.542393431 +0200
+@@ -17,8 +17,8 @@
+ \misctitle{Warning} This routine uses an exponential-time algorithm to
+ enumerate all potential generators, and may be exceedingly slow when the
+ number field has many subfields, hence a lot of elements of small $T_2$-norm.
+- E.g. do not try it on the compositum of many quadratic fields; in that case,
+- use \tet{polred} instead.
++ The function \tet{polredbest} is in general much faster (it runs in
++ polynomial time), and tends to return polynomials with smaller discriminants.
+
+ The binary digits of $\fl$ mean
+
+@@ -38,6 +38,15 @@
+ (has at most one large prime factor not in the \kbd{addprimes} table), the
+ result is the same.
+
++ \bprog
++ ? T = x^16 - 136*x^14 + 6476*x^12 - 141912*x^10 + 1513334*x^8 - 7453176*x^6 + 13950764*x^4 - 5596840*x^2 + 46225
++ ? T1 = polredabs(T); T2 = polredbest(T);
++ ? [ norml2(polroots(T1)), norml2(polroots(T2)) ]
++ %3 = [88.0000000, 120.000000]
++ ? [ sizedigit(poldisc(T1)), sizedigit(poldisc(T2)) ]
++ %4 = [75, 67]
++ @eprog
++
+ Variant: Instead of the above hardcoded numerical flags, one should use an
+ or-ed combination of
+
+diff -ruN src/src/functions/number_fields/polredbest b/src/functions/number_fields/polredbest
+--- src/src/functions/number_fields/polredbest 1970-01-01 01:00:00.000000000 +0100
++++ b/src/functions/number_fields/polredbest 2013-01-31 14:49:05.547513332 +0100
+@@ -0,0 +1,21 @@
++Function: polredbest
++Section: number_fields
++C-Name: polredbest
++Prototype: GD0,L,
++Help: polredbest(T,{flag=0}): reduction of the polynomial T (gives minimal
++ polynomials only). If flag=1, gives also elements.
++Doc: finds a polynomial with reasonably
++ small coefficients defining the same number field as $T$.
++ All $T$ accepted by \tet{nfinit} are also allowed here (e.g. non-monic
++ polynomials, \kbd{nf}, \kbd{bnf}, \kbd{[T,Z\_K\_basis]}). Contrary to
++ \tet{polredabs}, this routine runs in polynomial time, but it offers no
++ guarantee as to the minimality of its result.
++
++ If $\fl = 1$: outputs a two-component row vector $[P,a]$, where $P$ is the
++ default output and \kbd{Mod(a, P)} is a root of the original $T$.
++ \bprog
++ ? polredbest(x^4 + 8, 1)
++ %1 = [x^4 + 2, Mod(x^3, x^4 + 2)]
++ ? charpoly(%[2])
++ %2 = x^4 + 8
++ @eprog
+diff -ruN src/src/headers/paridecl.h b/src/headers/paridecl.h
+--- src/src/headers/paridecl.h 2012-09-25 23:10:47.000000000 +0200
++++ b/src/headers/paridecl.h 2013-01-31 14:49:05.557525771 +0100
+@@ -889,6 +889,7 @@
+ GEN polredabs0(GEN x, long flag);
+ GEN polredabs2(GEN x);
+ GEN polredabsall(GEN x, long flun);
++GEN polredbest(GEN x, long flag);
+ GEN smallpolred(GEN x);
+ GEN smallpolred2(GEN x);
+ GEN tschirnhaus(GEN x);
+diff -ru src/src/test/32/compat b/src/test/32/compat
+--- src/src/test/32/compat 2013-05-06 16:01:57.000000000 +0200
++++ b/src/test/32/compat 2013-05-06 16:47:04.542393431 +0200
+@@ -787,13 +787,9 @@
+ ? factoreddiscf(p,fa)
+ 136866601
+ ? factoredpolred(p,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? factoredpolred2(p,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? factornf(x^3+x^2-2*x-1,t^3+t^2-2*t-1)
+
+ [x + mod(-t, t^3 + t^2 - 2*t - 1) 1]
+@@ -904,7 +900,7 @@
+ ? gcd(12345678,87654321)
+ 9
+ ? getheap()
+-[208, 45748]
++[208, 45584]
+ ? getrand()
+ Vecsmall([1220248512, -582244995, 485580680, -1643185972, -2103930341, -9694
+ 07356, 336208700, 1439513079, -1910826353, -2042699820, 222745475, 183991374
+@@ -2014,7 +2010,7 @@
+ ? orderell(tcurve,[1,2])
+ 6
+ ? ordred(x^3-12*x+45*x-1)
+-[x - 1, x^3 - 363*x - 2663, x^3 + 33*x - 1]
++[x - 1, x^3 + 33*x - 1]
+ ? padicprec(padicno,127)
+ 5
+ ? pascal(8)
+@@ -2093,15 +2089,16 @@
+ ? polint([0,2,3],[0,4,9],5)
+ 25
+ ? polred(x^5-2*x^4-4*x^3-96*x^2-352*x-568)
+-[x - 1, x^5 - x^4 - 6*x^3 + 6*x^2 + 13*x - 5, x^5 - x^4 + 2*x^3 - 4*x^2 + x
+-- 1, x^5 - x^4 + 4*x^3 - 2*x^2 + x - 1, x^5 + 4*x^3 - 4*x^2 + 8*x - 8]
++[x - 1, x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1]
+ ? polred2(x^4-28*x^3-458*x^2+9156*x-25321)
+
+ [1 x - 1]
+
+-[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
++[1/115*x^2 - 14/115*x - 212/115 x^2 - 2*x - 9]
++
++[-1/115*x^2 + 14/115*x + 442/115 x^2 - 2*x - 9]
+
+-[2/897*x^3 - 14/299*x^2 - 1171/897*x + 9569/897 x^4 - 32*x^2 + 6]
++[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
+
+ [1/4485*x^3 - 7/1495*x^2 - 1034/4485*x + 7924/4485 x^4 - 8*x^2 + 6]
+
+@@ -2454,13 +2451,21 @@
+ ? smallinitell([0,0,0,-17,0])
+ [0, 0, 0, -17, 0, 0, -34, 0, -289, 816, 0, 314432, 1728]
+ ? smallpolred(x^4+576)
+-[x - 1, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
++[x - 1, x^2 - 3*x + 3, x^2 - 2*x + 2, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
+ ? smallpolred2(x^4+576)
+
+ [1 x - 1]
+
++[-1/192*x^3 - 1/8*x + 3/2 x^2 - 3*x + 3]
++
++[1/24*x^2 + 1 x^2 - 2*x + 2]
++
++[-1/24*x^2 + 1 x^2 - 2*x + 2]
++
+ [-1/192*x^3 - 1/8*x + 1/2 x^2 - x + 1]
+
++[1/192*x^3 + 1/8*x + 1/2 x^2 - x + 1]
++
+ [1/24*x^2 x^2 + 1]
+
+ [1/192*x^3 + 1/48*x^2 - 1/8*x x^4 - x^2 + 1]
+@@ -2650,6 +2655,6 @@
+ ? getstack()
+ 104
+ ? getheap()
+-[599, 110982]
++[599, 110954]
+ ? print("Total time spent: ",gettime);
+-Total time spent: 236
++Total time spent: 140
+diff -ru src/src/test/32/nfields b/src/test/32/nfields
+--- src/src/test/32/nfields 2013-05-06 16:01:57.000000000 +0200
++++ b/src/test/32/nfields 2013-05-06 16:47:04.542393431 +0200
+@@ -926,45 +926,50 @@
+ ? polgalois(x^6-3*x^2-1)
+ [12, 1, 1, "A_4(6) = [2^2]3"]
+ ? polred(x^5-2*x^4-4*x^3-96*x^2-352*x-568)
+-[x - 1, x^5 - x^4 - 6*x^3 + 6*x^2 + 13*x - 5, x^5 - x^4 + 2*x^3 - 4*x^2 + x
+-- 1, x^5 - x^4 + 4*x^3 - 2*x^2 + x - 1, x^5 + 4*x^3 - 4*x^2 + 8*x - 8]
++[x - 1, x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1]
+ ? polred(x^4-28*x^3-458*x^2+9156*x-25321,3)
+
+ [1 x - 1]
+
+-[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
++[1/115*x^2 - 14/115*x - 212/115 x^2 - 2*x - 9]
++
++[-1/115*x^2 + 14/115*x + 442/115 x^2 - 2*x - 9]
+
+-[2/897*x^3 - 14/299*x^2 - 1171/897*x + 9569/897 x^4 - 32*x^2 + 6]
++[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
+
+ [1/4485*x^3 - 7/1495*x^2 - 1034/4485*x + 7924/4485 x^4 - 8*x^2 + 6]
+
+ ? polred(x^4+576,1)
+-[x - 1, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
++[x - 1, x^2 - 3*x + 3, x^2 - 2*x + 2, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
+ ? polred(x^4+576,3)
+
+ [1 x - 1]
+
++[-1/192*x^3 - 1/8*x + 3/2 x^2 - 3*x + 3]
++
++[1/24*x^2 + 1 x^2 - 2*x + 2]
++
++[-1/24*x^2 + 1 x^2 - 2*x + 2]
++
+ [-1/192*x^3 - 1/8*x + 1/2 x^2 - x + 1]
+
++[1/192*x^3 + 1/8*x + 1/2 x^2 - x + 1]
++
+ [1/24*x^2 x^2 + 1]
+
+ [1/192*x^3 + 1/48*x^2 - 1/8*x x^4 - x^2 + 1]
+
+ ? polred(p2,0,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? polred(p2,1,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? polredabs(x^5-2*x^4-4*x^3-96*x^2-352*x-568)
+ x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1
+ ? polredabs(x^5-2*x^4-4*x^3-96*x^2-352*x-568,1)
+ [x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1, Mod(2*x^4 - x^3 + 3*x^2 - 3*x - 1, x^5 -
+ x^4 + 2*x^3 - 4*x^2 + x - 1)]
+ ? polredord(x^3-12*x+45*x-1)
+-[x - 1, x^3 - 363*x - 2663, x^3 + 33*x - 1]
++[x - 1, x^3 + 33*x - 1]
+ ? polsubcyclo(31,5)
+ x^5 + x^4 - 12*x^3 - 21*x^2 + x + 5
+ ? setrand(1);poltschirnhaus(x^5-x-1)
+@@ -1028,6 +1033,6 @@
+ ? sizebyte(%)
+ 152
+ ? getheap
+-[175, 113027]
++[175, 112999]
+ ? print("Total time spent: ",gettime);
+-Total time spent: 116
++Total time spent: 76
+diff -ru src/src/test/64/compat b/src/test/64/compat
+--- src/src/test/64/compat 2013-05-06 16:01:58.000000000 +0200
++++ b/src/test/64/compat 2013-05-06 16:47:04.542393431 +0200
+@@ -789,13 +789,9 @@
+ ? factoreddiscf(p,fa)
+ 136866601
+ ? factoredpolred(p,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? factoredpolred2(p,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? factornf(x^3+x^2-2*x-1,t^3+t^2-2*t-1)
+
+ [x + mod(-t, t^3 + t^2 - 2*t - 1) 1]
+@@ -906,7 +902,7 @@
+ ? gcd(12345678,87654321)
+ 9
+ ? getheap()
+-[208, 44472]
++[208, 44308]
+ ? getrand()
+ Vecsmall([-696235626332558091, -7363039021536514678, -3123062006620239999, -
+ 2510915082749224356, -5278885121447018503, 8033304491650294704, 333461878925
+@@ -2014,7 +2010,7 @@
+ ? orderell(tcurve,[1,2])
+ 6
+ ? ordred(x^3-12*x+45*x-1)
+-[x - 1, x^3 - 363*x - 2663, x^3 + 33*x - 1]
++[x - 1, x^3 + 33*x - 1]
+ ? padicprec(padicno,127)
+ 5
+ ? pascal(8)
+@@ -2093,15 +2089,16 @@
+ ? polint([0,2,3],[0,4,9],5)
+ 25
+ ? polred(x^5-2*x^4-4*x^3-96*x^2-352*x-568)
+-[x - 1, x^5 - x^4 - 6*x^3 + 6*x^2 + 13*x - 5, x^5 - x^4 + 2*x^3 - 4*x^2 + x
+-- 1, x^5 - x^4 + 4*x^3 - 2*x^2 + x - 1, x^5 + 4*x^3 - 4*x^2 + 8*x - 8]
++[x - 1, x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1]
+ ? polred2(x^4-28*x^3-458*x^2+9156*x-25321)
+
+ [1 x - 1]
+
+-[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
++[1/115*x^2 - 14/115*x - 212/115 x^2 - 2*x - 9]
++
++[-1/115*x^2 + 14/115*x + 442/115 x^2 - 2*x - 9]
+
+-[2/897*x^3 - 14/299*x^2 - 1171/897*x + 9569/897 x^4 - 32*x^2 + 6]
++[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
+
+ [1/4485*x^3 - 7/1495*x^2 - 1034/4485*x + 7924/4485 x^4 - 8*x^2 + 6]
+
+@@ -2454,13 +2451,21 @@
+ ? smallinitell([0,0,0,-17,0])
+ [0, 0, 0, -17, 0, 0, -34, 0, -289, 816, 0, 314432, 1728]
+ ? smallpolred(x^4+576)
+-[x - 1, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
++[x - 1, x^2 - 3*x + 3, x^2 - 2*x + 2, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
+ ? smallpolred2(x^4+576)
+
+ [1 x - 1]
+
++[-1/192*x^3 - 1/8*x + 3/2 x^2 - 3*x + 3]
++
++[1/24*x^2 + 1 x^2 - 2*x + 2]
++
++[-1/24*x^2 + 1 x^2 - 2*x + 2]
++
+ [-1/192*x^3 - 1/8*x + 1/2 x^2 - x + 1]
+
++[1/192*x^3 + 1/8*x + 1/2 x^2 - x + 1]
++
+ [1/24*x^2 x^2 + 1]
+
+ [1/192*x^3 + 1/48*x^2 - 1/8*x x^4 - x^2 + 1]
+@@ -2649,6 +2654,6 @@
+ ? getstack()
+ 200
+ ? getheap()
+-[599, 100048]
++[599, 100020]
+ ? print("Total time spent: ",gettime);
+-Total time spent: 152
++Total time spent: 180
+diff -ru src/src/test/64/nfields b/src/test/64/nfields
+--- src/src/test/64/nfields 2013-05-06 16:01:58.000000000 +0200
++++ b/src/test/64/nfields 2013-05-06 16:47:04.542393431 +0200
+@@ -928,45 +928,50 @@
+ ? polgalois(x^6-3*x^2-1)
+ [12, 1, 1, "A_4(6) = [2^2]3"]
+ ? polred(x^5-2*x^4-4*x^3-96*x^2-352*x-568)
+-[x - 1, x^5 - x^4 - 6*x^3 + 6*x^2 + 13*x - 5, x^5 - x^4 + 2*x^3 - 4*x^2 + x
+-- 1, x^5 - x^4 + 4*x^3 - 2*x^2 + x - 1, x^5 + 4*x^3 - 4*x^2 + 8*x - 8]
++[x - 1, x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1]
+ ? polred(x^4-28*x^3-458*x^2+9156*x-25321,3)
+
+ [1 x - 1]
+
+-[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
++[1/115*x^2 - 14/115*x - 212/115 x^2 - 2*x - 9]
++
++[-1/115*x^2 + 14/115*x + 442/115 x^2 - 2*x - 9]
+
+-[2/897*x^3 - 14/299*x^2 - 1171/897*x + 9569/897 x^4 - 32*x^2 + 6]
++[1/115*x^2 - 14/115*x - 327/115 x^2 - 10]
+
+ [1/4485*x^3 - 7/1495*x^2 - 1034/4485*x + 7924/4485 x^4 - 8*x^2 + 6]
+
+ ? polred(x^4+576,1)
+-[x - 1, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
++[x - 1, x^2 - 3*x + 3, x^2 - 2*x + 2, x^2 - x + 1, x^2 + 1, x^4 - x^2 + 1]
+ ? polred(x^4+576,3)
+
+ [1 x - 1]
+
++[-1/192*x^3 - 1/8*x + 3/2 x^2 - 3*x + 3]
++
++[1/24*x^2 + 1 x^2 - 2*x + 2]
++
++[-1/24*x^2 + 1 x^2 - 2*x + 2]
++
+ [-1/192*x^3 - 1/8*x + 1/2 x^2 - x + 1]
+
++[1/192*x^3 + 1/8*x + 1/2 x^2 - x + 1]
++
+ [1/24*x^2 x^2 + 1]
+
+ [1/192*x^3 + 1/48*x^2 - 1/8*x x^4 - x^2 + 1]
+
+ ? polred(p2,0,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? polred(p2,1,fa)
+-[x - 1, x^5 - 2*x^4 - 62*x^3 + 85*x^2 + 818*x + 1, x^5 - 2*x^4 - 53*x^3 - 46
+-*x^2 + 508*x + 913, x^5 - 2*x^4 - 13*x^3 + 37*x^2 - 21*x - 1, x^5 - x^4 - 52
+-*x^3 - 197*x^2 - 273*x - 127]
++[x - 1, x^5 - 80*x^3 - 223*x^2 + 800*x + 2671]
+ ? polredabs(x^5-2*x^4-4*x^3-96*x^2-352*x-568)
+ x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1
+ ? polredabs(x^5-2*x^4-4*x^3-96*x^2-352*x-568,1)
+ [x^5 - x^4 + 2*x^3 - 4*x^2 + x - 1, Mod(2*x^4 - x^3 + 3*x^2 - 3*x - 1, x^5 -
+ x^4 + 2*x^3 - 4*x^2 + x - 1)]
+ ? polredord(x^3-12*x+45*x-1)
+-[x - 1, x^3 - 363*x - 2663, x^3 + 33*x - 1]
++[x - 1, x^3 + 33*x - 1]
+ ? polsubcyclo(31,5)
+ x^5 + x^4 - 12*x^3 - 21*x^2 + x + 5
+ ? setrand(1);poltschirnhaus(x^5-x-1)
+@@ -1030,6 +1035,6 @@
+ ? sizebyte(%)
+ 288
+ ? getheap
+-[175, 102929]
++[175, 102901]
+ ? print("Total time spent: ",gettime);
+-Total time spent: 84
++Total time spent: 110
diff --git a/sci-mathematics/pari/files/pari-2.5.4-slow_determinant.patch b/sci-mathematics/pari/files/pari-2.5.4-slow_determinant.patch
new file mode 100644
index 000000000000..14833da62709
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.5.4-slow_determinant.patch
@@ -0,0 +1,100 @@
+diff -ru src/src/basemath/alglin1.c b/src/basemath/alglin1.c
+--- src/src/basemath/alglin1.c 2012-09-25 23:10:46.000000000 +0200
++++ b/src/basemath/alglin1.c 2013-01-03 13:56:55.487513420 +0100
+@@ -2969,6 +2969,21 @@
+ return NULL; /* not reached */
+ }
+
++/* A a 2x2 matrix
++ returns the determinant of A computed by the simple formula
++*/
++static GEN
++det2x2(GEN A)
++{
++ pari_sp av = avma;
++ GEN a = gcoeff(A, 1, 1),
++ b = gcoeff(A, 1, 2),
++ c = gcoeff(A, 2, 1),
++ d = gcoeff(A, 2, 2);
++ return gerepileupto(av, gsub(gmul(a, d), gmul(b, c)));
++}
++
++
+ static GEN
+ det_simple_gauss(GEN a, GEN data, pivot_fun pivot)
+ {
+@@ -3021,6 +3036,7 @@
+ if (typ(a)!=t_MAT) pari_err(mattype1,"det2");
+ if (!nbco) return gen_1;
+ if (nbco != lg(a[1])-1) pari_err(mattype1,"det2");
++ if (nbco == 2) return det2x2 (a);
+ pivot = get_pivot_fun(a, &data);
+ return det_simple_gauss(a, data, pivot);
+ }
+@@ -3158,11 +3174,7 @@
+ {
+ case 0: return gen_1;
+ case 1: return gcopy(gcoeff(M,1,1));
+- case 2: {
+- GEN a = gcoeff(M,1,1), b = gcoeff(M,1,2);
+- GEN c = gcoeff(M,2,1), d = gcoeff(M,2,2);
+- return gerepileupto(av, gsub(gmul(a,d), gmul(b,c)));
+- }
++ case 2: return det2x2(M);
+ }
+ if (max > ((n+2)>>1)) max = (n+2)>>1;
+ for (j = 1; j <= n; j++)
+@@ -3193,9 +3205,10 @@
+ }
+ if (best_row)
+ {
++ double d = lbest-1;
+ GEN s = NULL;
+ long k;
+- bound /= (lbest-1);
++ bound /= d*d*d;
+ for (k = 1; k < lbest; k++)
+ {
+ GEN c = coeff_det(M, best_row, best[k], max, bound);
+@@ -3205,9 +3218,10 @@
+ }
+ if (best_col)
+ {
++ double d = lbest-1;
+ GEN s = NULL;
+ long k;
+- bound /= (lbest-1);
++ bound /= d*d*d;
+ for (k = 1; k < lbest; k++)
+ {
+ GEN c = coeff_det(M, best[k], best_col, max, bound);
+@@ -3230,15 +3244,24 @@
+ if (!n) return gen_1;
+ if (n != lg(a[1])-1) pari_err(mattype1,"det");
+ if (n == 1) return gcopy(gcoeff(a,1,1));
+- if (RgM_is_FpM(a, &p) && p)
++ if (RgM_is_FpM(a, &p))
+ {
+- pari_sp av = avma;
+- return gerepilecopy(av, Fp_to_mod(FpM_det(RgM_to_FpM(a, p), p), p));
++ pari_sp av;
++ if (!p)
++ { /* ZM */
++ return det_simple_gauss(a, NULL, &gauss_get_pivot_NZ);
++ }
++ else
++ { /* FpM */
++ av = avma;
++ return gerepilecopy(av, Fp_to_mod(FpM_det(RgM_to_FpM(a, p), p), p));
++ }
+ }
++ if (n == 2) return det2x2 (a);
+ pivot = get_pivot_fun(a, &data);
+ if (pivot != gauss_get_pivot_NZ) return det_simple_gauss(a, data, pivot);
+- B = (double)n; B = B*B; B = B*B;
+- return det_develop(a, 7, B);
++ B = (double)n;
++ return det_develop(a, 7, B*B*B);
+ }
+
+
diff --git a/sci-mathematics/pari/files/pari-2.7.0-doc-make.patch b/sci-mathematics/pari/files/pari-2.7.0-doc-make.patch
new file mode 100644
index 000000000000..4292688d97af
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.7.0-doc-make.patch
@@ -0,0 +1,89 @@
+diff -Naur pari-2.7.0/config/DOC_Make.SH pari-2.7.0_a/config/DOC_Make.SH
+--- pari-2.7.0/config/DOC_Make.SH 2014-03-20 21:59:28.000000000 +1300
++++ pari-2.7.0_a/config/DOC_Make.SH 2014-05-05 13:20:09.119923587 +1200
+@@ -23,7 +23,8 @@
+
+ doc all: develop.dvi libpari.dvi parallel.dvi users.dvi refcard.ps tutorial.dvi
+ docps: develop.ps libpari.ps parallel.ps refcard.ps tutorial.ps users.ps INSTALL.ps
+-docpdf: develop.pdf libpari.pdf parallel.pdf users.pdf tutorial.pdf refcard.pdf INSTALL.pdf
++#docpdf: develop.pdf libpari.pdf parallel.pdf users.pdf tutorial.pdf refcard.pdf INSTALL.pdf
++docpdf: \$(PARI_TEX) \$(MACROS) pass1 pass2 indexing refcard.pdf INSTALL.pdf
+
+ .SUFFIXES: .tex .ipf .pod .inf .dumbpod .3 .html
+
+@@ -39,38 +40,60 @@
+ %.dvi: %.tex \$(MACROS)
+ \$(TEX) \$<
+
++pass1: \$(PARI_TEX) \$(USERS_TEX) develop.tex tutorial.tex \$(MACROS)
++ -rm -f *.std
++ pdftex libpari
++ pdftex develop
++ pdftex tutorial
++ pdftex users
++
++pass2: pass1
++ pdftex libpari
++ pdftex develop
++ pdftex tutorial
++ pdftex users
++
++indexing: pass2
++ \$(MAKE) libpari.std
++ \$(MAKE) develop.std
++ \$(MAKE) users.std
++ pdftex libpari
++ pdftex develop
++ pdftex users
++ -rm -f *.std
++
+ libpari.pdf: \$(PARI_TEX) \$(MACROS)
+ -rm -f libpari.std
+ \$(PDFTEX) libpari
+ \$(PDFTEX) libpari
+- make libpari.std; \$(PDFTEX) libpari; rm -f libpari.std
++ \$(MAKE) libpari.std; \$(PDFTEX) libpari; rm -f libpari.std
+ libpari.dvi: \$(PARI_TEX) \$(MACROS)
+ -rm -f libpari.std
+ \$(TEX) libpari
+ \$(TEX) libpari
+- make libpari.std; \$(TEX) libpari; rm -f libpari.std
++ \$(MAKE) libpari.std; \$(TEX) libpari; rm -f libpari.std
+
+ develop.pdf: develop.tex \$(MACROS)
+ -rm -f develop.std
+ \$(PDFTEX) develop
+ \$(PDFTEX) develop
+- make develop.std; \$(PDFTEX) develop; rm -f develop.std
++ \$(MAKE) develop.std; \$(PDFTEX) develop; rm -f develop.std
+ develop.dvi: develop.tex \$(MACROS)
+ -rm -f develop.std
+ \$(TEX) develop
+ \$(TEX) develop
+- make develop.std; \$(TEX) develop; rm -f develop.std
++ \$(MAKE) develop.std; \$(TEX) develop; rm -f develop.std
+
+ parallel.pdf: parallel.tex \$(MACROS)
+ -rm -f parallel.std
+ \$(PDFTEX) parallel
+ \$(PDFTEX) parallel
+- make parallel.std; \$(PDFTEX) parallel; rm -f parallel.std
++ \$(MAKE) parallel.std; \$(PDFTEX) parallel; rm -f parallel.std
+ parallel.dvi: parallel.tex \$(MACROS)
+ -rm -f parallel.std
+ \$(TEX) parallel
+ \$(TEX) parallel
+- make parallel.std; \$(TEX) parallel; rm -f parallel.std
++ \$(MAKE) parallel.std; \$(TEX) parallel; rm -f parallel.std
+
+ tutorial.pdf: tutorial.tex \$(MACROS)
+ -rm -f tutorial.std
+@@ -104,7 +127,7 @@
+ -rm -f users.std
+ \$(PDFTEX) users
+ \$(PDFTEX) users
+- make users.std; \$(PDFTEX) users; rm -f users.std
++ \$(MAKE) users.std; \$(PDFTEX) users; rm -f users.std
+
+ gpman: gp.1
+ nroff -man gp.1 | unix2dos -ascii > gp.man
diff --git a/sci-mathematics/pari/files/pari-2.7.0-no-automagic.patch b/sci-mathematics/pari/files/pari-2.7.0-no-automagic.patch
new file mode 100644
index 000000000000..2d77f19f9f54
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.7.0-no-automagic.patch
@@ -0,0 +1,100 @@
+diff -Naur pari-2.7.0/config/Makefile.SH pari-2.7.0_a/config/Makefile.SH
+--- pari-2.7.0/config/Makefile.SH 2014-03-20 21:59:28.000000000 +1300
++++ pari-2.7.0_a/config/Makefile.SH 2014-05-05 12:00:21.095724368 +1200
+@@ -75,12 +75,12 @@
+ PLOTLIBS="-L\$(QTDIR)/lib $QTLIB"
+ graph=plotQt;;
+ Qt4)
+- PLOTCFLAGS='-D__FANCY_WIN__ -I$(QTDIR)/include'
+- PLOTLIBS="-L\$(QTDIR)/lib $QTLIB"
++ PLOTCFLAGS='-D__FANCY_WIN__ `pkg-config --cflags QtGui`'
++ PLOTLIBS="`pkg-config --libs QtGui`"
+ graph=plotQt4;;
+ fltk)
+- PLOTCFLAGS="-I\$(FLTKDIR)/include $X11_INC"
+- PLOTLIBS="$FLTK_LIBS"
++ PLOTCFLAGS="`fltk-config --cxxflags` $X11_INC"
++ PLOTLIBS="`fltk-config --ldflags`"
+ postconfig='fltk-config --post '
+ graph=plotfltk;;
+ win32)
+@@ -269,7 +269,7 @@
+ GMPINCLUDE = $GMPINCLUDE
+ # Graphic library.
+ QTDIR = "$QTDIR"
+-MOC = \$(QTDIR)/bin/moc
++MOC = "`which moc`"
+ PLOTCFLAGS = $PLOTCFLAGS
+ PLOTLIBS = $PLOTLIBS
+ CPLUSPLUS = g++
+diff -Naur pari-2.7.0/config/get_Qt pari-2.7.0_a/config/get_Qt
+--- pari-2.7.0/config/get_Qt 2014-03-20 21:59:28.000000000 +1300
++++ pari-2.7.0_a/config/get_Qt 2014-05-05 11:56:42.453465262 +1200
+@@ -5,7 +5,7 @@
+ case "$with_qt" in
+ yes)
+ pth="/usr/local/lib /usr/local/share /usr/lib /usr/share"
+- QTDIR=`locatedir qt4/bin $pth`
++ QTDIR=`locatedir qt4 $pth`
+ if test -n "$QTDIR"; then
+ QTLIB="-lQtCore -lQtGui"
+ which_graphic_lib=Qt4
+diff -Naur pari-2.7.0/config/get_config_options pari-2.7.0_a/config/get_config_options
+--- pari-2.7.0/config/get_config_options 2014-03-20 21:59:28.000000000 +1300
++++ pari-2.7.0_a/config/get_config_options 2014-05-05 11:49:14.577963840 +1200
+@@ -85,10 +85,12 @@
+ --with-ncurses-lib=*|--with-ncurses=*)
+ with_ncurses_lib=`echo "$1" | sed -e 's/[-a-z]*=//'` ;;
+
++ --without-qt|--with-qt=no) without_qt=yes ;;
+ --with-qt) with_qt=yes ;;
+ --with-qt=*)
+ with_qt=`echo "$1" | sed -e 's/[-a-z]*=//'` ;;
+
++ --without-fltk|--with-fltk=no) without_fltk=yes ;;
+ --with-fltk) with_fltk=yes ;;
+ --with-fltk=*)
+ with_fltk=`echo "$1" | sed -e 's/[-a-z]*=//'` ;;
+@@ -164,7 +166,9 @@
+ --with-gmp-lib=DIR specify location of gmp libs
+
+ --with-qt[=DIR] use the Qt graphical library [prefix for Qt dir.]
++ --without-qt do not try to use the Qt lib
+ --with-fltk[=DIR] use the FLTK graphical library [prefix for FLTK dir.]
++ --without-fltk do not try to use the FLTK lib
+
+ Environment variables affecting the build:
+ CC C compiler
+diff -Naur pari-2.7.0/config/get_fltk pari-2.7.0_a/config/get_fltk
+--- pari-2.7.0/config/get_fltk 2014-03-20 21:59:28.000000000 +1300
++++ pari-2.7.0_a/config/get_fltk 2014-05-05 11:49:14.578963841 +1200
+@@ -2,6 +2,9 @@
+ with_fltk=yes
+ fi
+ FLTKDIR=
++if test -z "$without_fltk; then
++ FLTKDIR="`fltk-config --prefix 2>/dev/null`"
++fi
+ case "$with_fltk" in
+ yes)
+ pth=$libpth; lib=fltk; . ./locatelib
+diff -Naur pari-2.7.0/config/get_graphic_lib pari-2.7.0_a/config/get_graphic_lib
+--- pari-2.7.0/config/get_graphic_lib 2014-03-20 21:59:28.000000000 +1300
++++ pari-2.7.0_a/config/get_graphic_lib 2014-05-05 11:54:45.469333702 +1200
+@@ -7,6 +7,7 @@
+
+ if test -n "$with_fltk"; then which_graphic_lib=fltk; fi
+ if test -n "$with_qt"; then which_graphic_lib=Qt; fi
++if test -n "$without_fltk" -a -n "$without_qt"; then which_graphic_lib=none; fi
+ if test "$fastread" != yes; then
+ cat << EOT
+ ==========================================================================
+@@ -38,7 +39,7 @@
+ case $osname in
+ darwin) ;; # fltk brings in CoreFoundation, incompatible with pari_daemon
+ *). ./get_fltk # FLTKDIR, FLTK_LIBS ;;
+- if test -z "$FLTKDIR"; then
++ if test -z "`fltk-config --ldflags 2> /dev/null`"; then
+ case $which_graphic_lib in fltk) which_graphic_lib=none;; esac
+ else
+ which_graphic_lib=fltk
diff --git a/sci-mathematics/pari/files/pari-2.7.0-no-dot-inc.patch b/sci-mathematics/pari/files/pari-2.7.0-no-dot-inc.patch
new file mode 100644
index 000000000000..9d868ef6b6a0
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.7.0-no-dot-inc.patch
@@ -0,0 +1,64 @@
+From 2864fe5b852e443d98af92d8929e359525ccb1a2 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentfredric@gmail.com>
+Date: Sun, 11 Jun 2017 10:31:03 +1200
+Subject: [PATCH] Fix for 5.26 removal of '.' in @INC
+
+Previous scripts assumed CWD was in @INC and that "PARI::822" was in
+wherever CWD was.
+
+This fixes both of those, and the latter, because its not obvious
+from the build system where one should assume CWD to be.
+
+Instead, the absolute path of the directory of these scripts is
+inserted into @INC
+---
+ src/desc/doc_make | 5 +++++
+ src/desc/gen_proto | 4 ++++
+ src/desc/merge_822 | 4 ++++
+ 3 files changed, 13 insertions(+)
+
+diff --git a/src/desc/doc_make b/src/desc/doc_make
+index 91b894e..ffbbb78 100755
+--- a/src/desc/doc_make
++++ b/src/desc/doc_make
+@@ -1,6 +1,11 @@
+ #!/usr/bin/perl
+ use warnings FATAL => 'all';
+ use strict;
++
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ my (%funcs, %Fun_by_sec);
+diff --git a/src/desc/gen_proto b/src/desc/gen_proto
+index ee55449..5ca0305 100755
+--- a/src/desc/gen_proto
++++ b/src/desc/gen_proto
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ $class=$ARGV[0];
+diff --git a/src/desc/merge_822 b/src/desc/merge_822
+index 4c9217b..32b3cc9 100755
+--- a/src/desc/merge_822
++++ b/src/desc/merge_822
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl -w
++use File::Spec;
++use File::Basename qw( dirname );
++use lib dirname(File::Spec->rel2abs(__FILE__));
++
+ use PARI::822;
+
+ open(IN, $ARGV[0]) || die "cannot find $ARGV[0]";
+--
+2.13.1
+
diff --git a/sci-mathematics/pari/files/pari-2.7.0-slow-discriminant.patch b/sci-mathematics/pari/files/pari-2.7.0-slow-discriminant.patch
new file mode 100644
index 000000000000..814dc4b2ab9d
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.7.0-slow-discriminant.patch
@@ -0,0 +1,54 @@
+diff -ru src/src/basemath/alglin1.c b/src/basemath/alglin1.c
+--- src/src/basemath/alglin1.c 2014-01-29 18:00:27.000000000 +0100
++++ b/src/basemath/alglin1.c 2014-02-09 01:54:37.676725196 +0100
+@@ -247,6 +247,7 @@
+ a = RgM_shallowcopy(a);
+ for (i=1; i<nbco; i++)
+ {
++ int garbage = 0; /* Only gerepile() once per loop iteration */
+ for(k=i; k<=nbco; k++)
+ {
+ gcoeff(a,k,i) = ff->red(E,gcoeff(a,k,i));
+@@ -271,7 +272,7 @@
+ for (j=i+1; j<=nbco; j++)
+ {
+ gcoeff(a,j,k) = ff->add(E, gcoeff(a,j,k), ff->mul(E,m,gcoeff(a,j,i)));
+- if (low_stack(lim, stack_lim(av,1)))
++ if (low_stack(lim, stack_lim(av,1)) && (garbage++ == 0))
+ {
+ if(DEBUGMEM>1) pari_warn(warnmem,"det. col = %ld",i);
+ gerepileall(av,4, &a,&x,&q,&m);
+@@ -3721,6 +3722,7 @@
+ a = RgM_shallowcopy(a);
+ for (i=1; i<nbco; i++)
+ {
++ int garbage = 0; /* Only gerepile() once per loop iteration */
+ k = pivot(a, data, i, NULL);
+ if (k > nbco) return gerepilecopy(av, gcoeff(a,i,i));
+ if (k != i)
+@@ -3740,7 +3742,7 @@
+ for (j=i+1; j<=nbco; j++)
+ {
+ gcoeff(a,j,k) = gsub(gcoeff(a,j,k), gmul(m,gcoeff(a,j,i)));
+- if (low_stack(lim, stack_lim(av,3)))
++ if (low_stack(lim, stack_lim(av,3)) && (garbage++ == 0))
+ {
+ if(DEBUGMEM>1) pari_warn(warnmem,"det. col = %ld",i);
+ gerepileall(av,2, &a,&x);
+@@ -3791,6 +3793,7 @@
+ {
+ GEN ci, ck, m;
+ int diveuc = (gequal1(pprec)==0);
++ int garbage = 0; /* Only gerepile() once per loop iteration */
+
+ p = gcoeff(a,i,i);
+ if (gequal0(p))
+@@ -3827,7 +3830,7 @@
+ GEN p1 = gsub(gmul(p,gel(ck,j)), gmul(m,gel(ci,j)));
+ if (diveuc) p1 = mydiv(p1,pprec);
+ gel(ck,j) = gerepileupto(av2, p1);
+- if (low_stack(lim,stack_lim(av,2)))
++ if (low_stack(lim,stack_lim(av,2)) && (garbage++ == 0))
+ {
+ if(DEBUGMEM>1) pari_warn(warnmem,"det. col = %ld",i);
+ gerepileall(av,2, &a,&pprec);
diff --git a/sci-mathematics/pari/files/pari-2.7.1-perl-5.22-doc.patch b/sci-mathematics/pari/files/pari-2.7.1-perl-5.22-doc.patch
new file mode 100644
index 000000000000..c4bbadcb2e0c
--- /dev/null
+++ b/sci-mathematics/pari/files/pari-2.7.1-perl-5.22-doc.patch
@@ -0,0 +1,12 @@
+diff -U2 -r pari-2.7.1.orig/src/desc/doc_make pari-2.7.1/src/desc/doc_make
+--- pari-2.7.1.orig/src/desc/doc_make 2014-05-11 00:59:29.000000000 +0700
++++ pari-2.7.1/src/desc/doc_make 2015-11-15 00:51:11.494845695 +0600
+@@ -39,6 +39,6 @@
+ $v =~ s/(\w\w+)/\\var{$1}/g;
+ $v =~ s/\^([a-z])/\\hbox{\\kbd{\\pow}}$1/g;
+- $v =~ s/\\var{flag}/\\fl/g;
+- $v =~ s/\\var{(\d+)}/{$1}/g;
++ $v =~ s/\\var\{flag}/\\fl/g;
++ $v =~ s/\\var\{(\d+)}/{$1}/g;
+
+ $v = "\$($v)\$";
diff --git a/sci-mathematics/pari/metadata.xml b/sci-mathematics/pari/metadata.xml
new file mode 100644
index 000000000000..f4c3bc4e3381
--- /dev/null
+++ b/sci-mathematics/pari/metadata.xml
@@ -0,0 +1,28 @@
+<?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>
+ <longdescription lang="en">
+ PARI is a widely used computer algebra system designed for fast
+ computations in number theory (factorizations, algebraic number
+ theory, elliptic curves...), but also contains a large number of other
+ useful functions to compute with mathematical entities such as
+ matrices, polynomials, power series, algebraic numbers, etc., and a
+ lot of transcendental functions.
+ The extra data is avaialable through use flag:
+ * elldata is PARI/GP version of J. E. Cremona Elliptic Curve Data,
+ needed by ellsearch and ellidentify.
+ * galdata is needed by polgalois to compute Galois group in degrees
+ 8 through 11.
+ * seadata is needed by ellap for large primes.
+ * nftables is a repackaging of the historical megrez number field
+tables (errors fixed, 1/10th the size, easier to use).
+
+</longdescription>
+ <use>
+ <flag name="data">Add additional data (elldata, galdata, seadata, nftables)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-mathematics/pari/pari-2.3.5.ebuild b/sci-mathematics/pari/pari-2.3.5.ebuild
new file mode 100644
index 000000000000..a0f484b46778
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.3.5.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=3
+inherit elisp-common eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="A software package for computer-aided number theory"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+
+SRC_COM="http://pari.math.u-bordeaux.fr/pub/${PN}"
+SRC_URI="${SRC_COM}/unix/${P}.tar.gz
+ data? ( ${SRC_COM}/packages/elldata.tgz
+ ${SRC_COM}/packages/galdata.tgz
+ ${SRC_COM}/packages/seadata.tgz
+ ${SRC_COM}/packages/nftables.tgz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 sparc x86 ~x86-fbsd ~x86-solaris"
+IUSE="doc data fltk gmp static-libs X"
+
+RDEPEND="sys-libs/readline
+ fltk? ( x11-libs/fltk:1 )
+ gmp? ( dev-libs/gmp )
+ X? ( x11-libs/libX11 )
+ doc? ( X? ( x11-misc/xdg-utils ) )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" >& /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd >& /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ # move data into place
+ if use data; then
+ mv "${WORKDIR}"/data "${S}" || die "failed to move data"
+ fi
+ epatch "${FILESDIR}/"${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}/"${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+ epatch "${FILESDIR}/"${PN}-2.3.5-doc-make.patch
+ epatch "${FILESDIR}/"${PN}-2.3.5-no-dot-inc.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+ # propagate ldflags
+ sed -i \
+ -e 's/-shared $extra/-shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "Failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace hardcoded xdvi by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"xdvi":"xdg-open":' \
+ -e 's:xdvi -paper 29.7x21cm:xdg-open:' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+ # disable emacs support
+ sed -i -e '/^list=/s/emacs//' Configure \
+ || die
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+ tc-export CC
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline \
+ $(use_with gmp) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "Bad directory"
+
+ emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE -fPIC" lib-dyn \
+ || die "Building shared library failed!"
+
+ if use static-libs; then
+ emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" lib-sta \
+ || die "Building static library failed!"
+ fi
+
+ emake ${mymake} CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp \
+ || die "Building executables failed!"
+
+ if use doc; then
+ cd "${S}"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf \
+ || die "Failed to generate docs"
+ fi
+}
+
+src_test() {
+ emake test-kernel || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+
+ dodoc AUTHORS Announce.2.1 CHANGES README NEW MACHINES COMPAT
+ if use doc; then
+ emake \
+ DESTDIR="${D}" \
+ EXDIR="${ED}/usr/share/doc/${PF}/examples" \
+ DOCDIR="${ED}/usr/share/doc/${PF}" \
+ install-doc || die "Failed to install docs"
+ insinto /usr/share/doc/${PF}
+ doins doc/*.pdf || die "Failed to install pdf docs"
+ fi
+
+ if use data; then
+ emake DESTDIR="${D}" install-data || die "Failed to install data files"
+ fi
+
+ if use static-libs; then
+ emake \
+ DESTDIR="${D}" \
+ install-lib-sta || die "Install of static library failed"
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.5.0-r3.ebuild b/sci-mathematics/pari/pari-2.5.0-r3.ebuild
new file mode 100644
index 000000000000..57421935e631
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.5.0-r3.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="A software package for computer-aided number theory"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="doc data fltk gmp X"
+
+RDEPEND="sys-libs/readline
+ fltk? ( x11-libs/fltk:1 )
+ gmp? ( dev-libs/gmp )
+ X? ( x11-libs/libX11 )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ data? ( sci-mathematics/pari-data )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}"-2.3.2-strip.patch
+ epatch "${FILESDIR}/${PN}"-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}/${PN}"-2.5.0-doc-make.patch
+ # sage error handling patch
+ epatch "${FILESDIR}/${PN}"-2.5.0-mp.c.patch
+ # OS X: add -install_name to the linker option
+ epatch "${FILESDIR}/${PN}"-2.5.0-macos.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ sed -i "s:/usr:${EPREFIX}/usr:g" config/get_X11 \
+ || die "Failed to fix get_X11"
+
+ # usersch3.tex is generated
+ rm -f doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ local myconfig
+ if use gmp ; then
+ myconfig="--with-gmp=${EPREFIX}/usr"
+ else
+ myconfig="--with-gmp=no"
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $myconfig \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ default
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" install-examples
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.5.1-r1.ebuild b/sci-mathematics/pari/pari-2.5.1-r1.ebuild
new file mode 100644
index 000000000000..7202ed087dea
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.5.1-r1.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="A software package for computer-aided number theory"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="data doc fltk gmp qt4 X"
+
+RDEPEND="sys-libs/readline
+ data? ( sci-mathematics/pari-data )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ fltk? ( x11-libs/fltk:1 )
+ gmp? ( dev-libs/gmp )
+ qt4? ( dev-qt/qtgui:4 )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}"/${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}"/${PN}-2.5.0-doc-make.patch
+ # sage error handling patch
+ epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
+ # OS X: add -install_name to the linker option
+ epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
+ # from debian, fies bug #423617
+ epatch "${FILESDIR}"/${PN}-2.5.1-gcc47.patch
+ # fix automagic
+ epatch "${FILESDIR}"/${PN}-2.5.1-no-automagic.patch
+ # upstream fixes
+ epatch "${FILESDIR}"/${PN}-2.5.1-1302.patch
+ epatch "${FILESDIR}"/${PN}-2.5.1-1304.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ sed -i "s:/usr:${EPREFIX}/usr:g" config/get_X11 \
+ || die "Failed to fix get_X11"
+
+ # usersch3.tex is generated
+ rm -f doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $(use_with fltk) \
+ $(use_with gmp) \
+ $(use_with qt4 qt) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ default
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" install-examples
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.5.1.ebuild b/sci-mathematics/pari/pari-2.5.1.ebuild
new file mode 100644
index 000000000000..fb1efebef0c3
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.5.1.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="A software package for computer-aided number theory"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="doc data fltk gmp X"
+
+RDEPEND="sys-libs/readline
+ fltk? ( x11-libs/fltk:1 )
+ gmp? ( dev-libs/gmp )
+ X? ( x11-libs/libX11 )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ data? ( sci-mathematics/pari-data )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}"-2.3.2-strip.patch
+ epatch "${FILESDIR}/${PN}"-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}/${PN}"-2.5.0-doc-make.patch
+ # sage error handling patch
+ epatch "${FILESDIR}/${PN}"-2.5.0-mp.c.patch
+ # OS X: add -install_name to the linker option
+ epatch "${FILESDIR}/${PN}"-2.5.0-macos.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
+ # from debian, fies bug #423617
+ epatch "${FILESDIR}/${PN}"-2.5.1-gcc47.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ sed -i "s:/usr:${EPREFIX}/usr:g" config/get_X11 \
+ || die "Failed to fix get_X11"
+
+ # usersch3.tex is generated
+ rm -f doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ local myconfig
+ if use gmp ; then
+ myconfig="--with-gmp=${EPREFIX}/usr"
+ else
+ myconfig="--with-gmp=no"
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $myconfig \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ default
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" install-examples
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.5.2.ebuild b/sci-mathematics/pari/pari-2.5.2.ebuild
new file mode 100644
index 000000000000..3bc68a6ccdc0
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.5.2.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="A software package for computer-aided number theory"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="data doc fltk gmp qt4 X"
+
+RDEPEND="sys-libs/readline
+ data? ( sci-mathematics/pari-data )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ fltk? ( x11-libs/fltk:1 )
+ gmp? ( dev-libs/gmp )
+ qt4? ( dev-qt/qtgui:4 )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}"/${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}"/${PN}-2.5.0-doc-make.patch
+ # sage error handling patch
+ epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
+ # OS X: add -install_name to the linker option
+ epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
+ # fix automagic
+ epatch "${FILESDIR}"/${PN}-2.5.1-no-automagic.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ sed -i "s:/\(usr\|lib64\):${EPREFIX}/\1:g" \
+ config/get_{Qt,X11,include_path,libpth} \
+ || die "Failed to fix get_X11"
+
+ # usersch3.tex is generated
+ rm doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $(use_with fltk) \
+ $(use_with gmp) \
+ $(use_with qt4 qt) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ default
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" install-examples
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.5.3.ebuild b/sci-mathematics/pari/pari-2.5.3.ebuild
new file mode 100644
index 000000000000..8f42ea7f9a84
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.5.3.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="A software package for computer-aided number theory"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="data doc fltk gmp qt4 X"
+
+RDEPEND="sys-libs/readline
+ data? ( sci-mathematics/pari-data )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ fltk? ( x11-libs/fltk:1 )
+ gmp? ( dev-libs/gmp )
+ qt4? ( dev-qt/qtgui:4 )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}"/${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}"/${PN}-2.5.0-doc-make.patch
+ # sage error handling patch
+ epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
+ # OS X: add -install_name to the linker option
+ epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
+ # fix automagic
+ epatch "${FILESDIR}"/${PN}-2.5.1-no-automagic.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ sed -i "s:/\(usr\|lib64\):${EPREFIX}/\1:g" \
+ config/get_{Qt,X11,include_path,libpth} \
+ || die "Failed to fix get_X11"
+
+ # usersch3.tex is generated
+ rm doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $(use_with fltk) \
+ $(use_with gmp) \
+ $(use_with qt4 qt) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ default
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" install-examples
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.5.4.ebuild b/sci-mathematics/pari/pari-2.5.4.ebuild
new file mode 100644
index 000000000000..2c261d95efc2
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.5.4.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Computer-aided number theory C library and tools"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="data doc fltk gmp qt4 X"
+
+RDEPEND="
+ sys-libs/readline:0=
+ data? ( sci-mathematics/pari-data )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ fltk? ( x11-libs/fltk:1 )
+ gmp? ( dev-libs/gmp:0= )
+ qt4? ( dev-qt/qtgui:4 )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}"/${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}"/${PN}-2.5.0-doc-make.patch
+ # sage error handling patch
+ epatch "${FILESDIR}"/${PN}-2.5.0-mp.c.patch
+ # OS X: add -install_name to the linker option
+ epatch "${FILESDIR}"/${PN}-2.5.0-macos.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.5.0-no-dot-inc.patch
+ # fix automagic
+ epatch "${FILESDIR}"/${PN}-2.5.1-no-automagic.patch
+ # sage-on-gentoo trac 13902: Slowdown for PARI integer determinant
+ epatch "${FILESDIR}"/${PN}-2.5.4-slow_determinant.patch
+ # sage-on-gentoo trac 13054: polred bug / pari bug 1395
+ epatch "${FILESDIR}"/${PN}-2.5.4-polred.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ sed -i "s:/\(usr\|lib64\):${EPREFIX}/\1:g" \
+ config/get_{Qt,X11,include_path,libpth} \
+ || die "Failed to fix get_X11"
+
+ # usersch3.tex is generated
+ rm doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+ export CPLUSPLUS=$(tc-getCXX)
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $(use_with fltk) \
+ $(use_with gmp) \
+ $(use_with qt4 qt) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ mycxxmake=LD\=$(tc-getCXX)
+
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} ${mycxxmake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ emake ${mymake} ${mycxxmake} DESTDIR="${D}" install
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" install-examples
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.7.0.ebuild b/sci-mathematics/pari/pari-2.7.0.ebuild
new file mode 100644
index 000000000000..5553fa2865b9
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.7.0.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Computer-aided number theory C library and tools"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/4"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="data doc fltk gmp qt4 X"
+
+RDEPEND="
+ sys-libs/readline:0=
+ data? ( sci-mathematics/pari-data )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ fltk? ( x11-libs/fltk:1= )
+ gmp? ( dev-libs/gmp:0= )
+ qt4? ( dev-qt/qtgui:4= )
+ X? ( x11-libs/libX11:0= )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}"/${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}"/${PN}-2.7.0-doc-make.patch
+ # fix automagic
+ epatch "${FILESDIR}"/${PN}-2.7.0-no-automagic.patch
+ # sage-on-gentoo trac 15654: PARI discriminant speed depends on stack size
+ epatch "${FILESDIR}"/${PN}-2.7.0-slow-discriminant.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.7.0-no-dot-inc.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ # usersch3.tex is generated
+ rm doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+ export CPLUSPLUS=$(tc-getCXX)
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $(use_with fltk) \
+ $(use_with gmp) \
+ $(use_with qt4 qt) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ use hppa && \
+ mymake=DLLD\="${EPREFIX}"/usr/bin/gcc\ DLLDFLAGS\=-shared\ -Wl,-soname=\$\(LIBPARI_SONAME\)\ -lm
+
+ mycxxmake=LD\=$(tc-getCXX)
+
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} ${mycxxmake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ emake ${mymake} ${mycxxmake} DESTDIR="${D}" install
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" \
+ -C $(get_compile_dir) install-examples
+ fi
+}
diff --git a/sci-mathematics/pari/pari-2.7.1.ebuild b/sci-mathematics/pari/pari-2.7.1.ebuild
new file mode 100644
index 000000000000..1bf046344426
--- /dev/null
+++ b/sci-mathematics/pari/pari-2.7.1.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Computer-aided number theory C library and tools"
+HOMEPAGE="http://pari.math.u-bordeaux.fr/"
+SRC_URI="http://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/4"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="data doc fltk gmp qt4 X"
+
+RDEPEND="
+ sys-libs/readline:0=
+ data? ( sci-mathematics/pari-data )
+ doc? ( X? ( x11-misc/xdg-utils ) )
+ fltk? ( x11-libs/fltk:1= )
+ gmp? ( dev-libs/gmp:0= )
+ qt4? ( dev-qt/qtgui:4= )
+ X? ( x11-libs/libX11:0= )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )"
+
+get_compile_dir() {
+ pushd "${S}/config" > /dev/null
+ local fastread=yes
+ source ./get_archos
+ popd > /dev/null
+ echo "O${osname}-${arch}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.3.2-strip.patch
+ epatch "${FILESDIR}"/${PN}-2.3.2-ppc-powerpc-arch-fix.patch
+ # fix parallel make
+ epatch "${FILESDIR}"/${PN}-2.7.0-doc-make.patch
+ # fix automagic
+ epatch "${FILESDIR}"/${PN}-2.7.0-no-automagic.patch
+ # sage-on-gentoo trac 15654: PARI discriminant speed depends on stack size
+ epatch "${FILESDIR}"/${PN}-2.7.0-slow-discriminant.patch
+ # Fix Perl 5.26
+ epatch "${FILESDIR}/"${PN}-2.7.0-no-dot-inc.patch
+ # fix building docs with perl-5.22
+ epatch "${FILESDIR}"/${PN}-2.7.1-perl-5.22-doc.patch
+
+ # disable default building of docs during install
+ sed -i \
+ -e "s:install-doc install-examples:install-examples:" \
+ config/Makefile.SH || die "Failed to fix makefile"
+
+ # propagate ldflags
+ sed -i \
+ -e 's/$shared $extra/$shared $extra \\$(LDFLAGS)/' \
+ config/get_dlld || die "failed to fix LDFLAGS"
+ # move doc dir to a gentoo doc dir and replace acroread by xdg-open
+ sed -i \
+ -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
+ -e 's:"acroread":"xdg-open":' \
+ doc/gphelp.in || die "Failed to fix doc dir"
+
+ # usersch3.tex is generated
+ rm doc/usersch3.tex || die "failed to remove generated file"
+}
+
+src_configure() {
+ tc-export CC
+ export CPLUSPLUS=$(tc-getCXX)
+
+ # need to force optimization here, as it breaks without
+ if is-flag -O0; then
+ replace-flags -O0 -O2
+ elif ! is-flag -O?; then
+ append-flags -O2
+ fi
+
+ # sysdatadir installs a pari.cfg stuff which is informative only
+ ./Configure \
+ --prefix="${EPREFIX}"/usr \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --sysdatadir="${EPREFIX}"/usr/share/doc/${PF} \
+ --mandir="${EPREFIX}"/usr/share/man/man1 \
+ --with-readline="${EPREFIX}"/usr \
+ --with-ncurses-lib="${EPREFIX}"/usr/$(get_libdir) \
+ $(use_with fltk) \
+ $(use_with gmp) \
+ $(use_with qt4 qt) \
+ || die "./Configure failed"
+}
+
+src_compile() {
+ use hppa && \
+ mymake=DLLD\="${EPREFIX}"/usr/bin/gcc\ DLLDFLAGS\=-shared\ -Wl,-soname=\$\(LIBPARI_SONAME\)\ -lm
+
+ mycxxmake=LD\=$(tc-getCXX)
+
+ local installdir=$(get_compile_dir)
+ cd "${installdir}" || die "failed to change directory"
+ # upstream set -fno-strict-aliasing.
+ # aliasing is a known issue on amd64, work on x86 by sheer luck
+ emake ${mymake} \
+ CFLAGS="${CFLAGS} -fno-strict-aliasing -DGCC_INLINE -fPIC" lib-dyn
+ emake ${mymake} ${mycxxmake} \
+ CFLAGS="${CFLAGS} -DGCC_INLINE" gp ../gp
+
+ if use doc; then
+ cd "${S}" || die "failed to change directory"
+ # To prevent sandbox violations by metafont
+ VARTEXFONTS="${T}"/fonts emake docpdf
+ fi
+}
+
+src_test() {
+ emake dobench
+}
+
+src_install() {
+ emake ${mymake} ${mycxxmake} DESTDIR="${D}" install
+ dodoc MACHINES COMPAT
+ if use doc; then
+ # install gphelp and the pdf documentations manually.
+ # the install-doc target is overkill.
+ dodoc doc/*.pdf
+ dobin doc/gphelp
+ insinto /usr/share/doc/${PF}
+ # gphelp looks for some of the tex sources...
+ doins doc/*.tex doc/translations
+ # Install the examples - for real.
+ emake EXDIR="${ED}/usr/share/doc/${PF}/examples" \
+ -C $(get_compile_dir) install-examples
+ fi
+}