summaryrefslogtreecommitdiff
path: root/sci-mathematics/maxima
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/maxima
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-mathematics/maxima')
-rw-r--r--sci-mathematics/maxima/Manifest25
-rw-r--r--sci-mathematics/maxima/files/50maxima-gentoo-1.el13
-rw-r--r--sci-mathematics/maxima/files/clisp-1.patch19
-rw-r--r--sci-mathematics/maxima/files/clozurecl-2.patch27
-rw-r--r--sci-mathematics/maxima/files/cmucl-1.patch19
-rw-r--r--sci-mathematics/maxima/files/db-0.patch20
-rw-r--r--sci-mathematics/maxima/files/ecls-2.patch35
-rw-r--r--sci-mathematics/maxima/files/emacs-0.patch32
-rw-r--r--sci-mathematics/maxima/files/rmaxima-0.patch25
-rw-r--r--sci-mathematics/maxima/files/sbcl-1.patch18
-rw-r--r--sci-mathematics/maxima/files/sbcl-2.patch13
-rw-r--r--sci-mathematics/maxima/files/wish-2.patch26
-rw-r--r--sci-mathematics/maxima/files/xdg-utils-0.patch35
-rw-r--r--sci-mathematics/maxima/maxima-5.37.3-r4.ebuild208
-rw-r--r--sci-mathematics/maxima/maxima-5.38.1.ebuild208
-rw-r--r--sci-mathematics/maxima/maxima-5.39.0.ebuild208
-rw-r--r--sci-mathematics/maxima/maxima-5.40.0.ebuild208
-rw-r--r--sci-mathematics/maxima/maxima-5.41.0.ebuild208
-rw-r--r--sci-mathematics/maxima/metadata.xml35
19 files changed, 1382 insertions, 0 deletions
diff --git a/sci-mathematics/maxima/Manifest b/sci-mathematics/maxima/Manifest
new file mode 100644
index 000000000000..2d8c4285a42d
--- /dev/null
+++ b/sci-mathematics/maxima/Manifest
@@ -0,0 +1,25 @@
+AUX 50maxima-gentoo-1.el 538 SHA256 60bc64eaeedfe1bbd3dcf40bb0cb02ba5a097ba97a7222b327f48fe6771a82d3 SHA512 e1325f0d401b80f302c3e6b5d6c0fe8f58a53336f670f73450ff7876ca1c25b8bacbaff49ce05ec1dec1dda08062986ba4b9988927fce835dfca9f24460a0ddd WHIRLPOOL 9e5f058cf0560a5fd5813cb7488b3cb27d25c07f49ae32ec62b2bbdcab02882fe070702819f40747bf031edef134285182ecd693051884b987c0744c389b4ace
+AUX clisp-1.patch 1194 SHA256 2e2e37da1901c6dad0851cc82a081906cfb678f01eccba8d91eefa7b4fb1871b SHA512 05febcd92f6e9d667a8bc8c5c2bf7f02a1585cf5cff8add669716b6fc014ca603ee5bd72e2824db2b8d20cf3f7c9e5cc981c7bce7091c8f5f7ec002a20de40d3 WHIRLPOOL 68891d4ec98e33675eaba8412d5493fa4ad26f41fcad82d1bfdb1096811db15ce629ffbcefa75b479985dcffb2c02a5b511cb82719beafbd53f8d2ff9ad9f4e6
+AUX clozurecl-2.patch 1505 SHA256 5fb15195d8864a32a9f5c271a1ddedfaa331589898674901ea91d8709e49394d SHA512 41664b77eae0f2c3cc0e551bd2c26c02769faed339b5725dc790691929094cd5d5008169eba9788515392d9fed00919aaacbb24ee91b76f5d51eb6468335cf9c WHIRLPOOL 5dc9a53536e354292a4a18e479053f9fd52f7fb086aa363a152164740aa29cb623581eb72ab62c25d13ba42a76790d43b16f563e51f04052f26031131a182a71
+AUX cmucl-1.patch 1336 SHA256 178218d3ead339d721c7b8f819cb34170e025ebfb00b6d2f927347a26bed6924 SHA512 3b8c01ecbbcd87101e4e31356293216d9c2a018ddabc076905a8b87eeda27bea6cd36242ab6b9caf7553fb9187544beb620b739211c63e21afa1b2f050ef318e WHIRLPOOL ad923ce5460aaada4622d7401fdc81cee8028c010abe8f57ceb79ca9d8857eb91f40a3a570cdcc76cd64cfb6b2f9532db2ad9d0950596579a811e5d8eb06214c
+AUX db-0.patch 529 SHA256 470f7b590f390afd31bd6deb8f7fa51af89651ad360e06f3511a6433522ce169 SHA512 c3a196c2192be23c7551c1b4dd893c8304926318234ef06cf438c24f425f7fc93d8ebed4a9b4708852bb2e8ca7284afa03dfe53548cec8ebd6ba89e73a901cfa WHIRLPOOL 8c9d2c5e96231e09272467fe134a6775f0e4cc8d939735168ebc468f9778d2d0d620ec2fc3c1358ed3aafb5bb6346a72cc96e51934e3325d181e4a7341b9db57
+AUX ecls-2.patch 1612 SHA256 719b07457b3eccdfe2694b3d92f2c882f1ecb14e0ab1544d9a8243fb231cdfcd SHA512 cd37e62c24f24e49f264d63526615537cb088386cfc48f3eac8fcc746d16f6d79c585dee6f24c664fca355f539728a1a23cc75f3672c240a210a407e87b73141 WHIRLPOOL 14ef102a7f90ec87ebca7b1cf2983a0e63244128bd96da6b7cfaffa6216f327833ce5c40c27fc11e611e44bce88ca66b1b0ec4fe3bec914a8b37b702d19d511d
+AUX emacs-0.patch 807 SHA256 b261df805300f45c3ad881e28e1205dd0ba0b4482a82f32292701b75b2b2eb25 SHA512 f62d364651838ed196a2e8965930b42313cb73f912b898b953b526ffc5dc0135841b53618fbbb6a32d21d3412ba5f2bfb253bf41c640a136f68d830f43628ac4 WHIRLPOOL 18b5b087f73d204896857a1e44e4b076b90af48c0ccd64ae8aa00acfacaaed167bf3d779caaf35843827002c24443bc4d4283b77664c9923984ba4afe69bef63
+AUX rmaxima-0.patch 552 SHA256 73cc45185ee9de683686348e11ed4135a498a1a65cc61b80cf1407c6ec49b133 SHA512 a60c8c5ac23b0342823fbcd15e27f44ea85652640271ea845e383796422fa416b221dd036eb0a1639f70f9b09473471657612c7a5f99892cfb214d52156a6907 WHIRLPOOL a328f28ecf817b77f621d46652df8450e47855614e51f0760be0ac0d9d7e5886956d3ce108e2acdae88b81c2dc8f3cadafe3693529c452d076937b70a9a6256f
+AUX sbcl-1.patch 1412 SHA256 0792033f74af272732c97a16b7b000dfe920ab9a6f28d6c6a47b64c6eafbb313 SHA512 a75d05de3e80e255b36180469a6c51a200b287e8c11aaeb09916a6c8e7b6a16abf41d78a66a51325ca5ca4129c12121ceedd1ae87a89f5adc0666b2094cf2f14 WHIRLPOOL 22bbac501826fa80a73e3f13563600b5731aa11295da6cded2f43afecda7a742f68514cddc1dbb61944b861ae691a166709284e177ad40dac9219cec1dbf1db0
+AUX sbcl-2.patch 1072 SHA256 27346467918b4382d35ff2fc7bf64de647b73b391ea443b7c8fdb08dcf9b009c SHA512 b8df0b53f4ae04e175dfab8889206ea8ffa83c51b2408322423d5f52cf956b1084e7d1ba0c054032f9121cb1684fcc6bb9d48b1a967f9e01492ad25c035b1c62 WHIRLPOOL 7ca8053d74b0a867fc1e3990986f48dcdc611bee64f93b24386b9c18be97706d4d20e46d6917ef1d056b0be2130d200fdbc4757cec2b7c3a4a552cec9c7a2f6b
+AUX wish-2.patch 662 SHA256 d78edf60b416ace294cfe8dc63ef01f9427fc56e39d48445aa874d48ce13b2c5 SHA512 110db85899241e1f9ea8427ffb397737aefe0bb6286d037c2c04cfad9726838521ef6403242aeb1e4246d06f13cf83af84bba38567a99b00ed6a081f17b38ead WHIRLPOOL 70a5823c74653853c18858f182b724c0a75e0b947f6ce8c8dca388535844a6d0698f1d21c73f8add695db1ad0b04cb905446ed8f827ed8894382c96520a02799
+AUX xdg-utils-0.patch 1090 SHA256 99c600c4c7e813305da375a4afa4a5e7ea6aa4ec9f1ecc051b9c913281af53ea SHA512 31b121a2d6f1c24e5f2fa3e6129f661a891660665bf45a2907146e3bae9309d185f83d7001287df92a73aff81562a7011ad6b92e03516883bc0ae0730570fa38 WHIRLPOOL 1aee0e9b00d7991b6d07b954927b152f1a5effddf3dca79b11ba47203f8be8b2d8432feb394295d77fc7669e9c3c8f9e0dd8d4fefc9657270d20e033f5fb49d7
+DIST maxima-5.37.3.tar.gz 29964644 SHA256 8bd5dcd672f37ea752385475fc64f8c87dfa29bbe34766cbcb87b1f63dfb5934 SHA512 a337afdc779abc88297e7dadf8af949da881c91a237e85ed654046c98692f2446c0b2ddb8c81b637cb7a35dd3b712832aadc5dedcaa8b681496dae4835c9d0f1 WHIRLPOOL d24eeb7f39f88b9f542e28db28b8f249b1badc059fe744a83209b102b8f776131e4b2f91c28949f4f6de8323f163cb0a6be9bafc3c0ef058a73e9b543622e976
+DIST maxima-5.38.1.tar.gz 38641257 SHA256 0e866536ab5847ec045ba013570f80f36206ca6ce07a5d13987010bcb321c6dc SHA512 abca10984dbb22a48bae481b2e803cb5bee6776e974b4bb9271773aa035fb5e49f34b2458aabca01f0a681a07179e57c012273be6f8d53c615b3309b1034abf9 WHIRLPOOL 443ab032e784e4e2c37274dc3b1635acd9ede08af7863793f93b2f8fdc10e9cce8d4b1a5e98df9a6486fe97e082fb4030fbb3208939ab627f7ca333de7c224b8
+DIST maxima-5.39.0.tar.gz 38652090 SHA256 f58ff98013fcaa37d8661b941672c38db58f982f082d6cfcca1f1b5fac7d71b3 SHA512 393ade47fc3832ee44df7bf0c3bd2e501755167ec0f02d50d5876e7cf54fe682f2ebf2511290fa498d174e55961451e61ea5c1c5f6e5f9e6d04ad73d45a5d2a9 WHIRLPOOL 35c7e4acf7933c11562ade2ce30b9c3865a052fc13f9880502165313aae66925aff44cc9d70666001d0378ef14b2e0bf6bc2faeb258b6d50e558b9e043cd972c
+DIST maxima-5.40.0.tar.gz 41668208 SHA256 74fe468cd372714622a99afb6b34297589ddd80386e125d71067d3e75519f796 SHA512 7aa36ae56c289e1cc6bb1722a6ee93fed5bf893747a26bb52a48f93cd02d65b63c453f37dc2c86ab4596ad192150aed9ad6b361ab295eda5207d9633c07cdee6 WHIRLPOOL 0e66c5492728a1d21ef7b72fd227943200725c5dad812d81e111f609f381a94a66432c7ff13608e18fc5f2616f8992b46769b421b6942d10fb796d3992d46c8a
+DIST maxima-5.41.0.tar.gz 41540226 SHA256 daf8254600f4c7d9f079a0084178aaf036bd97a63b1e77b945f4120d7e401674 SHA512 1b93ae2db055ba7fb4a95924a896667f0cfa1c675c603c104181662aeb32b10b006158526b2f3ad93a59688a23eacdc82e870bb8ffb182a89e1e51de013ec209 WHIRLPOOL 3b3ebd648be9c51280e80312ef4666eb1e190391f196fd4f4a49326be1abd46f1bbffe2d6184d0e4d477a18f0409eb259104f1a030218bc190185873cee3e3a1
+EBUILD maxima-5.37.3-r4.ebuild 4828 SHA256 724431de44b4b65c638d14fc4560eec20cf45bd6f0758420b796f9b4219ed229 SHA512 633d63be6891ada0e394415e236355c3a5141472df821f37b92e23e3c7b01f1b18e3fba39d60e94b7289d6c0eeae5f1521fa617bb5a3669ccc0905b486f91ecf WHIRLPOOL 20a6c2544cbda7c91f34abed6908dcbab2b361988dbf0156658089ea1d3129117cbe4c64ef8168b65f16ef12e793bd2b6306b4a126d9eaebd11a81fc45b6d0a8
+EBUILD maxima-5.38.1.ebuild 4821 SHA256 defa887bde90ba135ca84645ba8f03f862b3cbb1a8ccd760c3c3fe1efe565b4d SHA512 3003b55bf303482d51462ab9b5332a6cb5e170b9780836666f9af5bd5d0838cca2fe57f26f5c955a5414594184bfd3c90064ee638f086074a40b66a7cf02cc22 WHIRLPOOL 9e31003a78daf7714b3d0dbf3c7ae2a97870af5418376923c7b79983a0408c724354614147c0bf8842c63963f827c12b04e6a77a26627101daf932a9c2f45732
+EBUILD maxima-5.39.0.ebuild 4824 SHA256 af8bbe6eea4ba1ba70ac749ea053e79ac90d5a4b3c3f3f27c3ee68582671a1de SHA512 c7926f33b56a0d18bf958513282ba8876427acac63d27f374b2eda914e733ea693357a01d7bfa90beb6f15d8f849e60c20a81d3436f9942aa510bbb591a5b999 WHIRLPOOL f3034eafe58361d7146b2c110e472c164dd9b94dfd9f5872d9d976ea68fa6540ba3ba145fe6db521bca9edf06a307857a64f90ec4f1fa140f113624c770d2bdb
+EBUILD maxima-5.40.0.ebuild 4824 SHA256 63b572b143b04a22f0de241639fca864cffc2fc16334d2aafa46f7d119537c9c SHA512 cb5bd1095eeeab1a6a08da4f3dd7aaf6ffc7721efb6f8dda327b238a5e879c4f3fca898dd85e363a809cb90747b0f3a85dfcbe2de4311a371b4efd81f7e82335 WHIRLPOOL cbcc129709946395aa722d4411c051718d861abb5faf398fb2fcbd59a502b79652d75c0606c5ee5d60da6870a3c3d93da82374786c4241aa601cb3f106b54bf2
+EBUILD maxima-5.41.0.ebuild 4824 SHA256 63b572b143b04a22f0de241639fca864cffc2fc16334d2aafa46f7d119537c9c SHA512 cb5bd1095eeeab1a6a08da4f3dd7aaf6ffc7721efb6f8dda327b238a5e879c4f3fca898dd85e363a809cb90747b0f3a85dfcbe2de4311a371b4efd81f7e82335 WHIRLPOOL cbcc129709946395aa722d4411c051718d861abb5faf398fb2fcbd59a502b79652d75c0606c5ee5d60da6870a3c3d93da82374786c4241aa601cb3f106b54bf2
+MISC ChangeLog 8801 SHA256 f6a3e5d32576f97dae75966eec54d24c28fcac0012d67433a440f7716f258a2b SHA512 4bcbd12c3023ca1f736ed09127479d3065c49f48c47114bb71e18155aef5fff2ad949146d121c82f16859c577804f8e39202af969467bfc60f6d0a930f70c866 WHIRLPOOL 16aba06e3ac3c093994c7d735391478146877d8ecc14c5e832430b024ab26e72dc2e8472b0c3868157cd60223e60fde964fa870d1908c879d6e14106fe685450
+MISC ChangeLog-2015 26867 SHA256 928928dc8eb994e97729bc32db4f8c018edc7fa47f865b9ff7c5f306c859afa4 SHA512 b193def6b27345190771f51ff3e96f5b6fe36eca890ee5825effccd7d9ed01eb009f71663f8745862eb48b1a63eb324c433c55e7dafc8e8c1711397255b2b970 WHIRLPOOL 66906b06d9b1a21acda62ae8910298718ff82bf40998a8b96d23759cc1b452c9284b37039c79d631bb9a504f06aa393cd0a9add86604b69ffc15e8aaf5767a2e
+MISC metadata.xml 1521 SHA256 0cf04cc8344e9e348fa29e7870be8ccd313212cc0ce4b956a7e10c5018f2932a SHA512 d2db86fcab10cabb9533954838babc9cee4ebb26b99604ebe0cb995b1239ac2a462455cc72d6311dab142290fbf460eaec920138c09045003b46dd382ed8cbf3 WHIRLPOOL 02bfdec70b8d568d342ee04e870687608a17efc5be955a360b879c40d4b8d9d6313117f155b36be13fe5e54fec4ea85568ef06115eb48a844c0c584693d7fff4
diff --git a/sci-mathematics/maxima/files/50maxima-gentoo-1.el b/sci-mathematics/maxima/files/50maxima-gentoo-1.el
new file mode 100644
index 000000000000..be14dbfc7d2f
--- /dev/null
+++ b/sci-mathematics/maxima/files/50maxima-gentoo-1.el
@@ -0,0 +1,13 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'maxima-mode "maxima" "Maxima mode" t)
+(autoload 'maxima "maxima" "Maxima interactive" t)
+(autoload 'dbl "dbl" "Make a debugger to run lisp, maxima and or gdb in" t)
+(add-to-list 'auto-mode-alist '("\\.ma?[cx]\\'" . maxima-mode))
+
+;; emaxima mode
+(autoload 'emaxima-mode "emaxima" "EMaxima" t)
+(add-hook 'emaxima-mode-hook 'emaxima-mark-file-as-emaxima)
+
+;; imaxima
+(autoload 'imaxima "imaxima" "Image support for Maxima." t)
+(autoload 'imath-mode "imath" "Interactive Math minor mode." t)
diff --git a/sci-mathematics/maxima/files/clisp-1.patch b/sci-mathematics/maxima/files/clisp-1.patch
new file mode 100644
index 000000000000..9dc8dfd7d51e
--- /dev/null
+++ b/sci-mathematics/maxima/files/clisp-1.patch
@@ -0,0 +1,19 @@
+diff -r -U1 maxima-5.37.1.orig/src/maxima.in maxima-5.37.1/src/maxima.in
+--- maxima-5.37.1.orig/src/maxima.in 2015-05-22 04:40:03.000000000 +0600
++++ maxima-5.37.1/src/maxima.in 2015-09-03 16:08:22.467930422 +0600
+@@ -135,5 +135,5 @@
+ if [ -x "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" ]; then
+- exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" $MAXIMA_LISP_OPTIONS -q "" -- "$@"
++ exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" $MAXIMA_LISP_OPTIONS -q -norc "" -- "$@"
+ else
+- exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/@CLISP_RUNTIME@" $MAXIMA_LISP_OPTIONS -q -M "$maxima_image_base.mem" "" -- "$@"
++ exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/@CLISP_RUNTIME@" $MAXIMA_LISP_OPTIONS -q -norc -M "$maxima_image_base.mem" "" -- "$@"
+ fi
+@@ -141,5 +141,5 @@
+ if [ -x "$maxima_image_base" ]; then
+- exec "$maxima_image_base" $MAXIMA_LISP_OPTIONS -q "" -- "$@"
++ exec "$maxima_image_base" $MAXIMA_LISP_OPTIONS -q -norc "" -- "$@"
+ else
+- exec "@CLISP_NAME@" $MAXIMA_LISP_OPTIONS -q -M "$maxima_image_base.mem" "" -- "$@"
++ exec "@CLISP_NAME@" $MAXIMA_LISP_OPTIONS -q -norc -M "$maxima_image_base.mem" "" -- "$@"
+ fi
diff --git a/sci-mathematics/maxima/files/clozurecl-2.patch b/sci-mathematics/maxima/files/clozurecl-2.patch
new file mode 100644
index 000000000000..5c5189c7e051
--- /dev/null
+++ b/sci-mathematics/maxima/files/clozurecl-2.patch
@@ -0,0 +1,27 @@
+diff -r -U1 maxima-5.37.1.orig/configure.ac maxima-5.37.1/configure.ac
+--- maxima-5.37.1.orig/configure.ac 2015-09-01 02:28:02.000000000 +0600
++++ maxima-5.37.1/configure.ac 2015-09-03 18:11:54.335618720 +0600
+@@ -386,3 +386,3 @@
+ dnl n.b. openmcl_default_name is hardcoded in "with" message
+-openmcl_default_name=openmcl
++openmcl_default_name=ccl
+ AC_ARG_ENABLE(openmcl,
+diff -r -U1 maxima-5.37.1.orig/src/Makefile.am maxima-5.37.1/src/Makefile.am
+--- maxima-5.37.1.orig/src/Makefile.am 2015-08-11 02:44:21.000000000 +0600
++++ maxima-5.37.1/src/Makefile.am 2015-09-03 17:26:12.849734012 +0600
+@@ -338,3 +338,3 @@
+
+-EXECUTEOPENMCL = $(OPENMCL_NAME) -e
++EXECUTEOPENMCL = $(OPENMCL_NAME) --no-init -e
+ BUILT_FILES += $(OPENMCL_MAXIMA)
+diff -r -U1 maxima-5.37.1.orig/src/maxima.in maxima-5.37.1/src/maxima.in
+--- maxima-5.37.1.orig/src/maxima.in 2015-05-22 04:40:03.000000000 +0600
++++ maxima-5.37.1/src/maxima.in 2015-09-03 17:22:31.841743306 +0600
+@@ -182,5 +182,5 @@
+ if [ -x "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" ]; then
+- exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" $MAXIMA_LISP_OPTIONS -e '(cl-user::run)' -- "$@"
++ exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" $MAXIMA_LISP_OPTIONS --no-init -e '(cl-user::run)' -- "$@"
+ else
+- exec "@OPENMCL_NAME@" -I "$maxima_image_base.image" $MAXIMA_LISP_OPTIONS -e '(cl-user::run)' -- "$@"
++ exec "@OPENMCL_NAME@" -I "$maxima_image_base.image" $MAXIMA_LISP_OPTIONS --no-init -e '(cl-user::run)' -- "$@"
+ fi
diff --git a/sci-mathematics/maxima/files/cmucl-1.patch b/sci-mathematics/maxima/files/cmucl-1.patch
new file mode 100644
index 000000000000..c87a6c922b38
--- /dev/null
+++ b/sci-mathematics/maxima/files/cmucl-1.patch
@@ -0,0 +1,19 @@
+diff -r -U1 maxima-5.37.1.orig/src/maxima.in maxima-5.37.1/src/maxima.in
+--- maxima-5.37.1.orig/src/maxima.in 2015-05-22 04:40:03.000000000 +0600
++++ maxima-5.37.1/src/maxima.in 2015-09-03 16:29:30.751877085 +0600
+@@ -152,5 +152,5 @@
+ if [ -x "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" ]; then
+- exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" $MAXIMA_LISP_OPTIONS -quiet -- "$@"
++ exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" $MAXIMA_LISP_OPTIONS -quiet -nositeinit -noinit -- "$@"
+ else
+- exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/@CMUCL_RUNTIME@" $MAXIMA_LISP_OPTIONS -quiet -core "$maxima_image_base.core" -eval '(cl-user::run)' -- "$@"
++ exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/@CMUCL_RUNTIME@" $MAXIMA_LISP_OPTIONS -quiet -nositeinit -noinit -core "$maxima_image_base.core" -eval '(cl-user::run)' -- "$@"
+ fi
+@@ -158,5 +158,5 @@
+ if [ -x "$maxima_image_base" ]; then
+- exec "$maxima_image_base" $MAXIMA_LISP_OPTIONS -quiet -- "$@"
++ exec "$maxima_image_base" $MAXIMA_LISP_OPTIONS -quiet -nositeinit -noinit -- "$@"
+ else
+- exec "@CMUCL_NAME@" $MAXIMA_LISP_OPTIONS -quiet -core "$maxima_image_base.core" -eval '(cl-user::run)' -- "$@"
++ exec "@CMUCL_NAME@" $MAXIMA_LISP_OPTIONS -quiet -nositeinit -noinit -core "$maxima_image_base.core" -eval '(cl-user::run)' -- "$@"
+ fi
diff --git a/sci-mathematics/maxima/files/db-0.patch b/sci-mathematics/maxima/files/db-0.patch
new file mode 100644
index 000000000000..d6cc18617cc5
--- /dev/null
+++ b/sci-mathematics/maxima/files/db-0.patch
@@ -0,0 +1,20 @@
+diff -r -U2 maxima-5.37.1.orig/src/db.lisp maxima-5.37.1/src/db.lisp
+--- maxima-5.37.1.orig/src/db.lisp 2015-08-11 01:01:13.000000000 +0600
++++ maxima-5.37.1/src/db.lisp 2015-09-04 00:21:43.596685564 +0600
+@@ -389,10 +389,14 @@
+
+ (defmfun isp (pat)
+- (let ((isp 'unknown))
++ (let ((isp 'unknown) #+ccl (err t))
+ (ignore-errors
+ (setq isp
+ (cond ((truep pat))
+ ((falsep pat) nil)
+- (t 'unknown))))
++ (t 'unknown)))
++ (setq err nil))
++ #+ccl
++ (when err
++ (setq +labs nil))
+ isp))
+
diff --git a/sci-mathematics/maxima/files/ecls-2.patch b/sci-mathematics/maxima/files/ecls-2.patch
new file mode 100644
index 000000000000..d9af8c373caf
--- /dev/null
+++ b/sci-mathematics/maxima/files/ecls-2.patch
@@ -0,0 +1,35 @@
+diff -r -U1 maxima-5.37.1.orig/src/maxima.in maxima-5.37.1/src/maxima.in
+--- maxima-5.37.1.orig/src/maxima.in 2015-05-22 04:40:03.000000000 +0600
++++ maxima-5.37.1/src/maxima.in 2015-09-03 16:33:30.913866985 +0600
+@@ -188,3 +188,3 @@
+ elif [ "$MAXIMA_LISP" = "ecl" ]; then
+- exec "$maxima_image_base" $MAXIMA_LISP_OPTIONS -- "$@"
++ exec "$maxima_image_base" $MAXIMA_LISP_OPTIONS -norc -- "$@"
+
+diff -r -U1 maxima-5.37.1.orig/src/maxima.system maxima-5.37.1/src/maxima.system
+--- maxima-5.37.1.orig/src/maxima.system 2015-09-01 02:26:13.000000000 +0600
++++ maxima-5.37.1/src/maxima.system 2015-09-03 16:42:47.071843596 +0600
+@@ -61,2 +61,10 @@
+ #+ecl
++(defun split-ld-flags-for-ecl (string &aux space)
++ (setf string (string-trim '(#\Space) string))
++ (if (setf space (position #\Space string))
++ (cons (subseq string 0 space)
++ (split-ld-flags-for-ecl (subseq string (1+ space))))
++ (cons string nil)))
++
++#+ecl
+ (defun build-maxima-lib ()
+@@ -77,2 +85,7 @@
+ files)))
++ (c::build-fasl "binary-ecl/maxima" :lisp-files obj
++ :ld-flags
++ (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
++ (find-package "MAXIMA")))))
++ (if (and x (not (string= x ""))) (split-ld-flags-for-ecl x))))
+ (c::build-program "binary-ecl/maxima" :lisp-files obj
+@@ -81,3 +94,3 @@
+ (find-package "MAXIMA")))))
+- (if (and x (not (string= x ""))) (list x)))
++ (if (and x (not (string= x ""))) (split-ld-flags-for-ecl x)))
+ :epilogue-code '(progn (require :defsystem)
diff --git a/sci-mathematics/maxima/files/emacs-0.patch b/sci-mathematics/maxima/files/emacs-0.patch
new file mode 100644
index 000000000000..8c84149e256b
--- /dev/null
+++ b/sci-mathematics/maxima/files/emacs-0.patch
@@ -0,0 +1,32 @@
+--- maxima-5.37.3.orig/configure.ac
++++ maxima-5.37.3/configure.ac
+@@ -513,6 +513,17 @@
+ fi
+ fi
+
++AC_ARG_ENABLE(emacs,
++ [ --enable-emacs Emacs support],
++ [case "${enableval}" in
++ yes) enable_emacs=true ;;
++ no) enable_emacs=false ;;
++ *) AC_MSG_ERROR(bad value ${enableval} for --enable-emacs) ;;
++ esac],
++ [enable_emacs=true])
++
++AM_CONDITIONAL(WANT_EMACS, test x$enable_emacs = xtrue)
++
+ dnl xgettext
+ AC_ARG_ENABLE(gettext,
+ [ --enable-gettext Locale support],
+--- maxima-5.37.3.orig/interfaces/Makefile.am
++++ maxima-5.37.3/interfaces/Makefile.am
+@@ -1,5 +1,8 @@
++if WANT_EMACS
++ MAYBE_EMACS = emacs
++endif
+ if WANT_TK
+ MAYBE_XMAXIMA = xmaxima
+ endif
+-SUBDIRS = emacs $(MAYBE_XMAXIMA)
++SUBDIRS = $(MAYBE_EMACS) $(MAYBE_XMAXIMA)
+ EXTRA_DIST = bin/xmaxima.iss
diff --git a/sci-mathematics/maxima/files/rmaxima-0.patch b/sci-mathematics/maxima/files/rmaxima-0.patch
new file mode 100644
index 000000000000..712cbda19d45
--- /dev/null
+++ b/sci-mathematics/maxima/files/rmaxima-0.patch
@@ -0,0 +1,25 @@
+diff -r -U2 maxima-5.28.0.orig/src/Makefile.am maxima-5.28.0/src/Makefile.am
+--- maxima-5.28.0.orig/src/Makefile.am 2012-06-15 12:21:34.000000000 +0700
++++ maxima-5.28.0/src/Makefile.am 2012-10-30 22:22:29.000000000 +0700
+@@ -4,5 +4,21 @@
+ bin_SCRIPTS = maxima maxima-command.ico maxima.bat set_lang.vbs
+ else
++if SBCL
+ bin_SCRIPTS = maxima rmaxima
++else
++if CMUCL
++bin_SCRIPTS = maxima rmaxima
++else
++if ECL
++bin_SCRIPTS = maxima rmaxima
++else
++if OPENMCL
++bin_SCRIPTS = maxima rmaxima
++else
++bin_SCRIPTS = maxima
++endif
++endif
++endif
++endif
+ endif
+
diff --git a/sci-mathematics/maxima/files/sbcl-1.patch b/sci-mathematics/maxima/files/sbcl-1.patch
new file mode 100644
index 000000000000..8899f0973708
--- /dev/null
+++ b/sci-mathematics/maxima/files/sbcl-1.patch
@@ -0,0 +1,18 @@
+diff -r -U1 maxima-5.37.1.orig/src/maxima.in maxima-5.37.1/src/maxima.in
+--- maxima-5.37.1.orig/src/maxima.in 2015-05-22 04:40:03.000000000 +0600
++++ maxima-5.37.1/src/maxima.in 2015-09-03 16:22:57.340893630 +0600
+@@ -193,5 +193,5 @@
+ if [ -x "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" ]; then
+- exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options "$@"
++ exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --no-sysinit --no-userinit --eval '(cl-user::run)' --end-toplevel-options "$@"
+ else
+- exec "@SBCL_NAME@" --core "$maxima_image_base.core" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options "$@"
++ exec "@SBCL_NAME@" --core "$maxima_image_base.core" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --no-sysinit --no-userinit --eval '(cl-user::run)' --end-toplevel-options "$@"
+ fi
+diff -r -U1 maxima-5.37.1.orig/src/server.lisp maxima-5.37.1/src/server.lisp
+--- maxima-5.37.1.orig/src/server.lisp 2015-04-10 01:41:59.000000000 +0600
++++ maxima-5.37.1/src/server.lisp 2015-09-03 16:23:47.100891537 +0600
+@@ -10,3 +10,2 @@
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+- #+sbcl (require 'asdf) ;not needed here for a recent SBCL
+ #+sbcl (require 'sb-posix)
diff --git a/sci-mathematics/maxima/files/sbcl-2.patch b/sci-mathematics/maxima/files/sbcl-2.patch
new file mode 100644
index 000000000000..9fedc741a20d
--- /dev/null
+++ b/sci-mathematics/maxima/files/sbcl-2.patch
@@ -0,0 +1,13 @@
+diff -r -U2 maxima-5.38.0.orig/src/maxima.in maxima-5.38.0/src/maxima.in
+--- maxima-5.38.0.orig/src/maxima.in 2016-04-02 23:42:45.000000000 +0200
++++ maxima-5.38.0/src/maxima.in 2016-04-03 09:07:46.317809312 +0200
+@@ -195,7 +195,7 @@
+ # switch --dynamic-space-size in order to do so.
+ if [ -x "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" ]; then
+- exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options "$@"
++ exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --no-sysinit --no-userinit --eval '(cl-user::run)' --end-toplevel-options "$@"
+ else
+- exec "@SBCL_NAME@" --core "$maxima_image_base.core" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options "$@"
++ exec "@SBCL_NAME@" --core "$maxima_image_base.core" --noinform $MAXIMA_LISP_OPTIONS --end-runtime-options --no-sysinit --no-userinit --eval '(cl-user::run)' --end-toplevel-options "$@"
+ fi
+
diff --git a/sci-mathematics/maxima/files/wish-2.patch b/sci-mathematics/maxima/files/wish-2.patch
new file mode 100644
index 000000000000..59427331b38d
--- /dev/null
+++ b/sci-mathematics/maxima/files/wish-2.patch
@@ -0,0 +1,26 @@
+--- maxima-5.37.3.orig/configure.ac
++++ maxima-5.37.3/configure.ac
+@@ -991,6 +991,11 @@
+ [ --with-wish=<prog> Use <prog> for Tk wish shell (default wish)],
+- [WISH="${withval}"],
+- [WISH="wish"])
++ [],
++ [with_wish="wish"])
++case "${with_wish}" in
++ no) WISH="none" ;;
++ yes) WISH="wish" ;;
++ *) WISH="${with_wish}" ;;
++esac
+ AC_SUBST(WISH)
+-
++AM_CONDITIONAL(WANT_TK, test x"${with_wish}" != xno)
+
+--- maxima-5.37.3.orig/interfaces/Makefile.am
++++ maxima-5.37.3/interfaces/Makefile.am
+@@ -1,2 +1,5 @@
+-SUBDIRS = emacs xmaxima
++if WANT_TK
++ MAYBE_XMAXIMA = xmaxima
++endif
++SUBDIRS = emacs $(MAYBE_XMAXIMA)
+ EXTRA_DIST = bin/xmaxima.iss
diff --git a/sci-mathematics/maxima/files/xdg-utils-0.patch b/sci-mathematics/maxima/files/xdg-utils-0.patch
new file mode 100644
index 000000000000..876fe6fcd469
--- /dev/null
+++ b/sci-mathematics/maxima/files/xdg-utils-0.patch
@@ -0,0 +1,35 @@
+--- interfaces/emacs/misc/bookmode.el.orig 2008-02-07 12:42:18.008472937 +0000
++++ interfaces/emacs/misc/bookmode.el 2008-02-07 12:43:02.531010132 +0000
+@@ -680,7 +680,7 @@
+
+ (and tem
+ (list (concat "View "(nth 1 tem))
+- 'call-process "ghostview" nil nil nil
++ 'call-process "xdg-open" nil nil nil
+ (expand-file-name(nth 1 tem))
+ ))
+ (list "Cancel")
+@@ -705,7 +705,7 @@
+ (concat
+ (cond ((looking-at "%PS") "")
+ (t "gzip -dc | "))
+- "ghostview -")
++ "xdg-open -")
+
+ )))
+
+--- interfaces/xmaxima/Tkmaxima/Constants.tcl.orig 2008-02-07 12:42:47.294141832 +0000
++++ interfaces/xmaxima/Tkmaxima/Constants.tcl 2008-02-07 12:43:02.539010587 +0000
+@@ -143,9 +143,9 @@
+ image/gif netmath
+ image/png netmath
+ image/jpeg netmath
+- application/postscript "ghostview -safer %s"
+- application/pdf "acroread %s"
+- application/x-dvi "xdvi %s"
++ application/postscript "xdg-open -safer %s"
++ application/pdf "xdg-open %s"
++ application/x-dvi "xdg-open %s"
+ }
+ set maxima_priv(imagecounter) 0
+
diff --git a/sci-mathematics/maxima/maxima-5.37.3-r4.ebuild b/sci-mathematics/maxima/maxima-5.37.3-r4.ebuild
new file mode 100644
index 000000000000..93b6c5ed9385
--- /dev/null
+++ b/sci-mathematics/maxima/maxima-5.37.3-r4.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools elisp-common eutils
+
+DESCRIPTION="Free computer algebra environment based on Macsyma"
+HOMEPAGE="http://maxima.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+# Supported lisps
+LISPS=( sbcl cmucl gcl ecls clozurecl clisp )
+# <lisp> supports readline: . - no, y - yes
+SUPP_RL=( . . y . . y )
+# . - just --enable-<lisp>, <flag> - --enable-<flag>
+CONF_FLAG=( . . . ecl ccl . )
+# patch file version; . - no patch
+PATCH_V=( 1 1 . 2 2 1 )
+
+IUSE="emacs tk nls unicode X ${LISPS[*]}"
+
+# Languages
+LANGS="de es pt pt_BR"
+for lang in ${LANGS}; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+# texlive-latexrecommended needed by imaxima for breqn.sty
+RDEPEND="!app-emacs/imaxima
+ X? ( x11-misc/xdg-utils
+ sci-visualization/gnuplot[gd]
+ tk? ( dev-lang/tk:0 ) )
+ emacs? ( virtual/emacs
+ virtual/latex-base
+ app-emacs/auctex
+ app-text/ghostscript-gpl
+ dev-texlive/texlive-latexrecommended )"
+
+# generating lisp dependencies
+depends() {
+ local LISP DEP
+ LISP=${LISPS[$1]}
+ DEP="dev-lisp/${LISP}:="
+ if [ "${SUPP_RL[$1]}" = "." ]; then
+ DEP="${DEP} app-misc/rlwrap"
+ fi
+ echo ${DEP}
+}
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ LISP=${LISPS[${n}]}
+ RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
+ DEF_DEP="${DEF_DEP} !${LISP}? ( "
+done
+
+# default lisp
+DEF_LISP=0 # sbcl
+ARM_LISP=2 # gcl
+DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )"
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ DEF_DEP="${DEF_DEP} )"
+done
+
+unset LISP
+
+RDEPEND="${RDEPEND}
+ ${DEF_DEP}"
+
+DEPEND="${RDEPEND}
+ sys-apps/texinfo"
+
+TEXMF="${EPREFIX}"/usr/share/texmf-site
+
+pkg_setup() {
+ local n=${#LISPS[*]}
+
+ for ((n--; n >= 0; n--)); do
+ use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
+ done
+
+ if [ -z "${NLISPS}" ]; then
+ use arm && DEF_LISP=${ARM_LISP}
+ ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default"
+ NLISPS=${DEF_LISP}
+ fi
+}
+
+src_prepare() {
+ local n PATCHES v
+ PATCHES=( emacs-0 rmaxima-0 wish-2 xdg-utils-0 db-0 )
+
+ n=${#PATCHES[*]}
+ for ((n--; n >= 0; n--)); do
+ epatch "${FILESDIR}"/${PATCHES[${n}]}.patch
+ done
+
+ n=${#LISPS[*]}
+ for ((n--; n >= 0; n--)); do
+ v=${PATCH_V[${n}]}
+ if [ "${v}" != "." ]; then
+ epatch "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
+ fi
+ done
+
+ # bug #343331
+ rm share/Makefile.in || die
+ rm src/Makefile.in || die
+ touch src/*.mk
+ touch src/Makefile.am
+ eautoreconf
+}
+
+src_configure() {
+ local CONFS CONF n lang
+ for n in ${NLISPS}; do
+ CONF=${CONF_FLAG[${n}]}
+ if [ ${CONF} = . ]; then
+ CONF=${LISPS[${n}]}
+ fi
+ CONFS="${CONFS} --enable-${CONF}"
+ done
+
+ # enable existing translated doc
+ if use nls; then
+ for lang in ${LANGS}; do
+ if use "linguas_${lang}"; then
+ CONFS="${CONFS} --enable-lang-${lang}"
+ use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
+ fi
+ done
+ fi
+
+ econf ${CONFS} \
+ $(use_with tk wish) \
+ $(use_enable emacs) \
+ --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ pushd interfaces/emacs/emaxima > /dev/null
+ elisp-compile *.el
+ popd > /dev/null
+ pushd interfaces/emacs/imaxima > /dev/null
+ BYTECOMPFLAGS="-L . -L ../emaxima"
+ elisp-compile *.el
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ docompress -x /usr/share/info
+ emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
+
+ use tk && make_desktop_entry xmaxima xmaxima \
+ /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
+ "Science;Math;Education"
+
+ # do not use dodoc because interfaces can't read compressed files
+ # read COPYING before attempt to remove it from dodoc
+ insinto /usr/share/${PN}/${PV}/doc
+ doins AUTHORS COPYING README README.lisps
+ dodir /usr/share/doc
+ dosym ../${PN}/${PV}/doc /usr/share/doc/${PF}
+
+ if use emacs; then
+ elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp}
+ elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el
+
+ rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die
+ insinto ${TEXMF}/tex/latex/emaxima
+ doins interfaces/emacs/emaxima/emaxima.sty
+
+ insinto /usr/share/${PN}/${PV}/doc/imaxima
+ doins interfaces/emacs/imaxima/README
+ doins -r interfaces/emacs/imaxima/imath-example
+ fi
+
+ # if we use ecls, build an ecls library for maxima
+ if use ecls; then
+ ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
+ insinto "${ECLLIB#${EPREFIX}}"
+ doins src/binary-ecl/maxima.fas
+ fi
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
+
+pkg_postrm() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
diff --git a/sci-mathematics/maxima/maxima-5.38.1.ebuild b/sci-mathematics/maxima/maxima-5.38.1.ebuild
new file mode 100644
index 000000000000..af6a58ee4353
--- /dev/null
+++ b/sci-mathematics/maxima/maxima-5.38.1.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools elisp-common eutils
+
+DESCRIPTION="Free computer algebra environment based on Macsyma"
+HOMEPAGE="http://maxima.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+# Supported lisps
+LISPS=( sbcl cmucl gcl ecls clozurecl clisp )
+# <lisp> supports readline: . - no, y - yes
+SUPP_RL=( . . y . . y )
+# . - just --enable-<lisp>, <flag> - --enable-<flag>
+CONF_FLAG=( . . . ecl ccl . )
+# patch file version; . - no patch
+PATCH_V=( 2 1 . 2 2 1 )
+
+IUSE="emacs tk nls unicode X ${LISPS[*]}"
+
+# Languages
+LANGS="de es pt pt_BR"
+for lang in ${LANGS}; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+# texlive-latexrecommended needed by imaxima for breqn.sty
+RDEPEND="!app-emacs/imaxima
+ X? ( x11-misc/xdg-utils
+ sci-visualization/gnuplot[gd]
+ tk? ( dev-lang/tk:0 ) )
+ emacs? ( virtual/emacs
+ virtual/latex-base
+ app-emacs/auctex
+ app-text/ghostscript-gpl
+ dev-texlive/texlive-latexrecommended )"
+
+# generating lisp dependencies
+depends() {
+ local LISP DEP
+ LISP=${LISPS[$1]}
+ DEP="dev-lisp/${LISP}:="
+ if [ "${SUPP_RL[$1]}" = "." ]; then
+ DEP="${DEP} app-misc/rlwrap"
+ fi
+ echo ${DEP}
+}
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ LISP=${LISPS[${n}]}
+ RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
+ DEF_DEP="${DEF_DEP} !${LISP}? ( "
+done
+
+# default lisp
+DEF_LISP=0 # sbcl
+ARM_LISP=2 # gcl
+DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )"
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ DEF_DEP="${DEF_DEP} )"
+done
+
+unset LISP
+
+RDEPEND="${RDEPEND}
+ ${DEF_DEP}"
+
+DEPEND="${RDEPEND}
+ sys-apps/texinfo"
+
+TEXMF="${EPREFIX}"/usr/share/texmf-site
+
+pkg_setup() {
+ local n=${#LISPS[*]}
+
+ for ((n--; n >= 0; n--)); do
+ use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
+ done
+
+ if [ -z "${NLISPS}" ]; then
+ use arm && DEF_LISP=${ARM_LISP}
+ ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default"
+ NLISPS=${DEF_LISP}
+ fi
+}
+
+src_prepare() {
+ local n PATCHES v
+ PATCHES=( emacs-0 rmaxima-0 wish-2 xdg-utils-0 )
+
+ n=${#PATCHES[*]}
+ for ((n--; n >= 0; n--)); do
+ epatch "${FILESDIR}"/${PATCHES[${n}]}.patch
+ done
+
+ n=${#LISPS[*]}
+ for ((n--; n >= 0; n--)); do
+ v=${PATCH_V[${n}]}
+ if [ "${v}" != "." ]; then
+ epatch "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
+ fi
+ done
+
+ # bug #343331
+ rm share/Makefile.in || die
+ rm src/Makefile.in || die
+ touch src/*.mk
+ touch src/Makefile.am
+ eautoreconf
+}
+
+src_configure() {
+ local CONFS CONF n lang
+ for n in ${NLISPS}; do
+ CONF=${CONF_FLAG[${n}]}
+ if [ ${CONF} = . ]; then
+ CONF=${LISPS[${n}]}
+ fi
+ CONFS="${CONFS} --enable-${CONF}"
+ done
+
+ # enable existing translated doc
+ if use nls; then
+ for lang in ${LANGS}; do
+ if use "linguas_${lang}"; then
+ CONFS="${CONFS} --enable-lang-${lang}"
+ use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
+ fi
+ done
+ fi
+
+ econf ${CONFS} \
+ $(use_with tk wish) \
+ $(use_enable emacs) \
+ --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ pushd interfaces/emacs/emaxima > /dev/null
+ elisp-compile *.el
+ popd > /dev/null
+ pushd interfaces/emacs/imaxima > /dev/null
+ BYTECOMPFLAGS="-L . -L ../emaxima"
+ elisp-compile *.el
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ docompress -x /usr/share/info
+ emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
+
+ use tk && make_desktop_entry xmaxima xmaxima \
+ /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
+ "Science;Math;Education"
+
+ # do not use dodoc because interfaces can't read compressed files
+ # read COPYING before attempt to remove it from dodoc
+ insinto /usr/share/${PN}/${PV}/doc
+ doins AUTHORS COPYING README README.lisps
+ dodir /usr/share/doc
+ dosym ../${PN}/${PV}/doc /usr/share/doc/${PF}
+
+ if use emacs; then
+ elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp}
+ elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el
+
+ rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die
+ insinto ${TEXMF}/tex/latex/emaxima
+ doins interfaces/emacs/emaxima/emaxima.sty
+
+ insinto /usr/share/${PN}/${PV}/doc/imaxima
+ doins interfaces/emacs/imaxima/README
+ doins -r interfaces/emacs/imaxima/imath-example
+ fi
+
+ # if we use ecls, build an ecls library for maxima
+ if use ecls; then
+ ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
+ insinto "${ECLLIB#${EPREFIX}}"
+ doins src/binary-ecl/maxima.fas
+ fi
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
+
+pkg_postrm() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
diff --git a/sci-mathematics/maxima/maxima-5.39.0.ebuild b/sci-mathematics/maxima/maxima-5.39.0.ebuild
new file mode 100644
index 000000000000..b43477f95708
--- /dev/null
+++ b/sci-mathematics/maxima/maxima-5.39.0.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools elisp-common eutils
+
+DESCRIPTION="Free computer algebra environment based on Macsyma"
+HOMEPAGE="http://maxima.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+# Supported lisps
+LISPS=( sbcl cmucl gcl ecls clozurecl clisp )
+# <lisp> supports readline: . - no, y - yes
+SUPP_RL=( . . y . . y )
+# . - just --enable-<lisp>, <flag> - --enable-<flag>
+CONF_FLAG=( . . . ecl ccl . )
+# patch file version; . - no patch
+PATCH_V=( 2 1 . 2 2 1 )
+
+IUSE="emacs tk nls unicode X ${LISPS[*]}"
+
+# Languages
+LANGS="de es pt pt_BR"
+for lang in ${LANGS}; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+# texlive-latexrecommended needed by imaxima for breqn.sty
+RDEPEND="!app-emacs/imaxima
+ X? ( x11-misc/xdg-utils
+ sci-visualization/gnuplot[gd]
+ tk? ( dev-lang/tk:0 ) )
+ emacs? ( virtual/emacs
+ virtual/latex-base
+ app-emacs/auctex
+ app-text/ghostscript-gpl
+ dev-texlive/texlive-latexrecommended )"
+
+# generating lisp dependencies
+depends() {
+ local LISP DEP
+ LISP=${LISPS[$1]}
+ DEP="dev-lisp/${LISP}:="
+ if [ "${SUPP_RL[$1]}" = "." ]; then
+ DEP="${DEP} app-misc/rlwrap"
+ fi
+ echo ${DEP}
+}
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ LISP=${LISPS[${n}]}
+ RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
+ DEF_DEP="${DEF_DEP} !${LISP}? ( "
+done
+
+# default lisp
+DEF_LISP=0 # sbcl
+ARM_LISP=2 # gcl
+DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )"
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ DEF_DEP="${DEF_DEP} )"
+done
+
+unset LISP
+
+RDEPEND="${RDEPEND}
+ ${DEF_DEP}"
+
+DEPEND="${RDEPEND}
+ sys-apps/texinfo"
+
+TEXMF="${EPREFIX}"/usr/share/texmf-site
+
+pkg_setup() {
+ local n=${#LISPS[*]}
+
+ for ((n--; n >= 0; n--)); do
+ use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
+ done
+
+ if [ -z "${NLISPS}" ]; then
+ use arm && DEF_LISP=${ARM_LISP}
+ ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default"
+ NLISPS=${DEF_LISP}
+ fi
+}
+
+src_prepare() {
+ local n PATCHES v
+ PATCHES=( emacs-0 rmaxima-0 wish-2 xdg-utils-0 )
+
+ n=${#PATCHES[*]}
+ for ((n--; n >= 0; n--)); do
+ epatch "${FILESDIR}"/${PATCHES[${n}]}.patch
+ done
+
+ n=${#LISPS[*]}
+ for ((n--; n >= 0; n--)); do
+ v=${PATCH_V[${n}]}
+ if [ "${v}" != "." ]; then
+ epatch "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
+ fi
+ done
+
+ # bug #343331
+ rm share/Makefile.in || die
+ rm src/Makefile.in || die
+ touch src/*.mk
+ touch src/Makefile.am
+ eautoreconf
+}
+
+src_configure() {
+ local CONFS CONF n lang
+ for n in ${NLISPS}; do
+ CONF=${CONF_FLAG[${n}]}
+ if [ ${CONF} = . ]; then
+ CONF=${LISPS[${n}]}
+ fi
+ CONFS="${CONFS} --enable-${CONF}"
+ done
+
+ # enable existing translated doc
+ if use nls; then
+ for lang in ${LANGS}; do
+ if use "linguas_${lang}"; then
+ CONFS="${CONFS} --enable-lang-${lang}"
+ use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
+ fi
+ done
+ fi
+
+ econf ${CONFS} \
+ $(use_with tk wish) \
+ $(use_enable emacs) \
+ --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ pushd interfaces/emacs/emaxima > /dev/null
+ elisp-compile *.el
+ popd > /dev/null
+ pushd interfaces/emacs/imaxima > /dev/null
+ BYTECOMPFLAGS="-L . -L ../emaxima"
+ elisp-compile *.el
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ docompress -x /usr/share/info
+ emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
+
+ use tk && make_desktop_entry xmaxima xmaxima \
+ /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
+ "Science;Math;Education"
+
+ # do not use dodoc because interfaces can't read compressed files
+ # read COPYING before attempt to remove it from dodoc
+ insinto /usr/share/${PN}/${PV}/doc
+ doins AUTHORS COPYING README README.lisps
+ dodir /usr/share/doc
+ dosym ../${PN}/${PV}/doc /usr/share/doc/${PF}
+
+ if use emacs; then
+ elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp}
+ elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el
+
+ rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die
+ insinto ${TEXMF}/tex/latex/emaxima
+ doins interfaces/emacs/emaxima/emaxima.sty
+
+ insinto /usr/share/${PN}/${PV}/doc/imaxima
+ doins interfaces/emacs/imaxima/README
+ doins -r interfaces/emacs/imaxima/imath-example
+ fi
+
+ # if we use ecls, build an ecls library for maxima
+ if use ecls; then
+ ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
+ insinto "${ECLLIB#${EPREFIX}}"
+ doins src/binary-ecl/maxima.fas
+ fi
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
+
+pkg_postrm() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
diff --git a/sci-mathematics/maxima/maxima-5.40.0.ebuild b/sci-mathematics/maxima/maxima-5.40.0.ebuild
new file mode 100644
index 000000000000..8bdc377e8486
--- /dev/null
+++ b/sci-mathematics/maxima/maxima-5.40.0.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools elisp-common eutils
+
+DESCRIPTION="Free computer algebra environment based on Macsyma"
+HOMEPAGE="http://maxima.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+# Supported lisps
+LISPS=( sbcl cmucl gcl ecls clozurecl clisp )
+# <lisp> supports readline: . - no, y - yes
+SUPP_RL=( . . y . . y )
+# . - just --enable-<lisp>, <flag> - --enable-<flag>
+CONF_FLAG=( . . . ecl ccl . )
+# patch file version; . - no patch
+PATCH_V=( 2 1 . 2 2 1 )
+
+IUSE="emacs tk nls unicode X ${LISPS[*]}"
+
+# Languages
+LANGS="de es pt pt_BR"
+for lang in ${LANGS}; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+# texlive-latexrecommended needed by imaxima for breqn.sty
+RDEPEND="!app-emacs/imaxima
+ X? ( x11-misc/xdg-utils
+ sci-visualization/gnuplot[gd]
+ tk? ( dev-lang/tk:0 ) )
+ emacs? ( virtual/emacs
+ virtual/latex-base
+ app-emacs/auctex
+ app-text/ghostscript-gpl
+ dev-texlive/texlive-latexrecommended )"
+
+# generating lisp dependencies
+depends() {
+ local LISP DEP
+ LISP=${LISPS[$1]}
+ DEP="dev-lisp/${LISP}:="
+ if [ "${SUPP_RL[$1]}" = "." ]; then
+ DEP="${DEP} app-misc/rlwrap"
+ fi
+ echo ${DEP}
+}
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ LISP=${LISPS[${n}]}
+ RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
+ DEF_DEP="${DEF_DEP} !${LISP}? ( "
+done
+
+# default lisp
+DEF_LISP=0 # sbcl
+ARM_LISP=2 # gcl
+DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )"
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ DEF_DEP="${DEF_DEP} )"
+done
+
+unset LISP
+
+RDEPEND="${RDEPEND}
+ ${DEF_DEP}"
+
+DEPEND="${RDEPEND}
+ sys-apps/texinfo"
+
+TEXMF="${EPREFIX}"/usr/share/texmf-site
+
+pkg_setup() {
+ local n=${#LISPS[*]}
+
+ for ((n--; n >= 0; n--)); do
+ use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
+ done
+
+ if [ -z "${NLISPS}" ]; then
+ use arm && DEF_LISP=${ARM_LISP}
+ ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default"
+ NLISPS=${DEF_LISP}
+ fi
+}
+
+src_prepare() {
+ local n PATCHES v
+ PATCHES=( emacs-0 rmaxima-0 wish-2 xdg-utils-0 )
+
+ n=${#PATCHES[*]}
+ for ((n--; n >= 0; n--)); do
+ epatch "${FILESDIR}"/${PATCHES[${n}]}.patch
+ done
+
+ n=${#LISPS[*]}
+ for ((n--; n >= 0; n--)); do
+ v=${PATCH_V[${n}]}
+ if [ "${v}" != "." ]; then
+ epatch "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
+ fi
+ done
+
+ # bug #343331
+ rm share/Makefile.in || die
+ rm src/Makefile.in || die
+ touch src/*.mk
+ touch src/Makefile.am
+ eautoreconf
+}
+
+src_configure() {
+ local CONFS CONF n lang
+ for n in ${NLISPS}; do
+ CONF=${CONF_FLAG[${n}]}
+ if [ ${CONF} = . ]; then
+ CONF=${LISPS[${n}]}
+ fi
+ CONFS="${CONFS} --enable-${CONF}"
+ done
+
+ # enable existing translated doc
+ if use nls; then
+ for lang in ${LANGS}; do
+ if use "linguas_${lang}"; then
+ CONFS="${CONFS} --enable-lang-${lang}"
+ use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
+ fi
+ done
+ fi
+
+ econf ${CONFS} \
+ $(use_with tk wish) \
+ $(use_enable emacs) \
+ --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ pushd interfaces/emacs/emaxima > /dev/null
+ elisp-compile *.el
+ popd > /dev/null
+ pushd interfaces/emacs/imaxima > /dev/null
+ BYTECOMPFLAGS="-L . -L ../emaxima"
+ elisp-compile *.el
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ docompress -x /usr/share/info
+ emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
+
+ use tk && make_desktop_entry xmaxima xmaxima \
+ /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
+ "Science;Math;Education"
+
+ # do not use dodoc because interfaces can't read compressed files
+ # read COPYING before attempt to remove it from dodoc
+ insinto /usr/share/${PN}/${PV}/doc
+ doins AUTHORS COPYING README README.lisps
+ dodir /usr/share/doc
+ dosym ../${PN}/${PV}/doc /usr/share/doc/${PF}
+
+ if use emacs; then
+ elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp}
+ elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el
+
+ rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die
+ insinto ${TEXMF}/tex/latex/emaxima
+ doins interfaces/emacs/emaxima/emaxima.sty
+
+ insinto /usr/share/${PN}/${PV}/doc/imaxima
+ doins interfaces/emacs/imaxima/README
+ doins -r interfaces/emacs/imaxima/imath-example
+ fi
+
+ # if we use ecls, build an ecls library for maxima
+ if use ecls; then
+ ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
+ insinto "${ECLLIB#${EPREFIX}}"
+ doins src/binary-ecl/maxima.fas
+ fi
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
+
+pkg_postrm() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
diff --git a/sci-mathematics/maxima/maxima-5.41.0.ebuild b/sci-mathematics/maxima/maxima-5.41.0.ebuild
new file mode 100644
index 000000000000..8bdc377e8486
--- /dev/null
+++ b/sci-mathematics/maxima/maxima-5.41.0.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools elisp-common eutils
+
+DESCRIPTION="Free computer algebra environment based on Macsyma"
+HOMEPAGE="http://maxima.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+# Supported lisps
+LISPS=( sbcl cmucl gcl ecls clozurecl clisp )
+# <lisp> supports readline: . - no, y - yes
+SUPP_RL=( . . y . . y )
+# . - just --enable-<lisp>, <flag> - --enable-<flag>
+CONF_FLAG=( . . . ecl ccl . )
+# patch file version; . - no patch
+PATCH_V=( 2 1 . 2 2 1 )
+
+IUSE="emacs tk nls unicode X ${LISPS[*]}"
+
+# Languages
+LANGS="de es pt pt_BR"
+for lang in ${LANGS}; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+# texlive-latexrecommended needed by imaxima for breqn.sty
+RDEPEND="!app-emacs/imaxima
+ X? ( x11-misc/xdg-utils
+ sci-visualization/gnuplot[gd]
+ tk? ( dev-lang/tk:0 ) )
+ emacs? ( virtual/emacs
+ virtual/latex-base
+ app-emacs/auctex
+ app-text/ghostscript-gpl
+ dev-texlive/texlive-latexrecommended )"
+
+# generating lisp dependencies
+depends() {
+ local LISP DEP
+ LISP=${LISPS[$1]}
+ DEP="dev-lisp/${LISP}:="
+ if [ "${SUPP_RL[$1]}" = "." ]; then
+ DEP="${DEP} app-misc/rlwrap"
+ fi
+ echo ${DEP}
+}
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ LISP=${LISPS[${n}]}
+ RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
+ DEF_DEP="${DEF_DEP} !${LISP}? ( "
+done
+
+# default lisp
+DEF_LISP=0 # sbcl
+ARM_LISP=2 # gcl
+DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )"
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+ DEF_DEP="${DEF_DEP} )"
+done
+
+unset LISP
+
+RDEPEND="${RDEPEND}
+ ${DEF_DEP}"
+
+DEPEND="${RDEPEND}
+ sys-apps/texinfo"
+
+TEXMF="${EPREFIX}"/usr/share/texmf-site
+
+pkg_setup() {
+ local n=${#LISPS[*]}
+
+ for ((n--; n >= 0; n--)); do
+ use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
+ done
+
+ if [ -z "${NLISPS}" ]; then
+ use arm && DEF_LISP=${ARM_LISP}
+ ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default"
+ NLISPS=${DEF_LISP}
+ fi
+}
+
+src_prepare() {
+ local n PATCHES v
+ PATCHES=( emacs-0 rmaxima-0 wish-2 xdg-utils-0 )
+
+ n=${#PATCHES[*]}
+ for ((n--; n >= 0; n--)); do
+ epatch "${FILESDIR}"/${PATCHES[${n}]}.patch
+ done
+
+ n=${#LISPS[*]}
+ for ((n--; n >= 0; n--)); do
+ v=${PATCH_V[${n}]}
+ if [ "${v}" != "." ]; then
+ epatch "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
+ fi
+ done
+
+ # bug #343331
+ rm share/Makefile.in || die
+ rm src/Makefile.in || die
+ touch src/*.mk
+ touch src/Makefile.am
+ eautoreconf
+}
+
+src_configure() {
+ local CONFS CONF n lang
+ for n in ${NLISPS}; do
+ CONF=${CONF_FLAG[${n}]}
+ if [ ${CONF} = . ]; then
+ CONF=${LISPS[${n}]}
+ fi
+ CONFS="${CONFS} --enable-${CONF}"
+ done
+
+ # enable existing translated doc
+ if use nls; then
+ for lang in ${LANGS}; do
+ if use "linguas_${lang}"; then
+ CONFS="${CONFS} --enable-lang-${lang}"
+ use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
+ fi
+ done
+ fi
+
+ econf ${CONFS} \
+ $(use_with tk wish) \
+ $(use_enable emacs) \
+ --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
+}
+
+src_compile() {
+ emake
+ if use emacs; then
+ pushd interfaces/emacs/emaxima > /dev/null
+ elisp-compile *.el
+ popd > /dev/null
+ pushd interfaces/emacs/imaxima > /dev/null
+ BYTECOMPFLAGS="-L . -L ../emaxima"
+ elisp-compile *.el
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ docompress -x /usr/share/info
+ emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
+
+ use tk && make_desktop_entry xmaxima xmaxima \
+ /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
+ "Science;Math;Education"
+
+ # do not use dodoc because interfaces can't read compressed files
+ # read COPYING before attempt to remove it from dodoc
+ insinto /usr/share/${PN}/${PV}/doc
+ doins AUTHORS COPYING README README.lisps
+ dodir /usr/share/doc
+ dosym ../${PN}/${PV}/doc /usr/share/doc/${PF}
+
+ if use emacs; then
+ elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp}
+ elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el
+
+ rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die
+ insinto ${TEXMF}/tex/latex/emaxima
+ doins interfaces/emacs/emaxima/emaxima.sty
+
+ insinto /usr/share/${PN}/${PV}/doc/imaxima
+ doins interfaces/emacs/imaxima/README
+ doins -r interfaces/emacs/imaxima/imath-example
+ fi
+
+ # if we use ecls, build an ecls library for maxima
+ if use ecls; then
+ ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
+ insinto "${ECLLIB#${EPREFIX}}"
+ doins src/binary-ecl/maxima.fas
+ fi
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
+
+pkg_postrm() {
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
diff --git a/sci-mathematics/maxima/metadata.xml b/sci-mathematics/maxima/metadata.xml
new file mode 100644
index 000000000000..2ee0d1e396a8
--- /dev/null
+++ b/sci-mathematics/maxima/metadata.xml
@@ -0,0 +1,35 @@
+<?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">
+ Computer Algebra system, descendent of Macsyma.
+ Maxima is a system for the manipulation of symbolic and
+ numerical expressions, including differentiation, integration,
+ Taylor series, Laplace transforms, ordinary differential
+ equations, systems of linear equations, and vectors, matrices,
+ and tensors. Maxima produces high precision results by using
+ exact fractions and arbitrarily long floating point representations,
+ and can plot functions and data in two and three dimensions.
+</longdescription>
+ <use>
+ <flag name="clisp">Compile maxima with GNU CLISP
+ (<pkg>dev-lisp/clisp</pkg>)</flag>
+ <flag name="clozurecl">Compile maxima with Clozure Common Lisp
+ (<pkg>dev-lisp/clozurecl</pkg>)</flag>
+ <flag name="cmucl">Compile maxima with CMU Common Lisp
+ (<pkg>dev-lisp/cmucl</pkg>)</flag>
+ <flag name="ecls">Compile maxima with Embeddable Common Lisp
+ (<pkg>dev-lisp/ecls</pkg>)</flag>
+ <flag name="gcl">Compile maxima with GNU Common Lisp
+ (<pkg>dev-lisp/gcl</pkg>)</flag>
+ <flag name="sbcl">Compile maxima with Steel Bank Common Lisp
+ (<pkg>dev-lisp/sbcl</pkg>)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">maxima</remote-id>
+ </upstream>
+</pkgmetadata>