summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Grozin <grozin@gentoo.org>2018-10-01 23:05:52 +0700
committerAndrey Grozin <grozin@gentoo.org>2018-10-01 23:05:52 +0700
commite671c6b407b19d81a63ece43e98f5c507594e96b (patch)
tree6f0de33a206c20320bd0e600e7aac99e2a0cd9e9
parentdev-lisp/sbcl: bump to 1.4.12 (diff)
downloadgentoo-e671c6b4.tar.gz
gentoo-e671c6b4.tar.bz2
gentoo-e671c6b4.zip
sci-mathematics/maxima: bump to 5.42.0
Signed-off-by: Andrey Grozin <grozin@gentoo.org> Package-Manager: Portage-2.3.41, Repoman-2.3.9
-rw-r--r--sci-mathematics/maxima/Manifest1
-rw-r--r--sci-mathematics/maxima/files/ecls-3.patch48
-rw-r--r--sci-mathematics/maxima/maxima-5.42.0.ebuild212
3 files changed, 261 insertions, 0 deletions
diff --git a/sci-mathematics/maxima/Manifest b/sci-mathematics/maxima/Manifest
index 47cab5b50efd..76d4d1d38649 100644
--- a/sci-mathematics/maxima/Manifest
+++ b/sci-mathematics/maxima/Manifest
@@ -1,2 +1,3 @@
DIST maxima-5.38.1.tar.gz 38641257 BLAKE2B 0244b5dbdd337e64d4f7c3e7f6b946463b0246a9fd0660588798f7891fd1599cf400369fe0d1ce3433d01ce2e4b8bc86ad405d3f8368b429cd028362ec66a1b4 SHA512 abca10984dbb22a48bae481b2e803cb5bee6776e974b4bb9271773aa035fb5e49f34b2458aabca01f0a681a07179e57c012273be6f8d53c615b3309b1034abf9
DIST maxima-5.41.0.tar.gz 41540226 BLAKE2B ff726044c9026bc58d04832fa6382146ed7e7d61d801fa7131b1e7e2ed386b99e238e039481697f9aa24cea59ffd0f6811675cd28818c9fe53f023f965f9d149 SHA512 1b93ae2db055ba7fb4a95924a896667f0cfa1c675c603c104181662aeb32b10b006158526b2f3ad93a59688a23eacdc82e870bb8ffb182a89e1e51de013ec209
+DIST maxima-5.42.0.tar.gz 41902466 BLAKE2B ff09294ee66fc407845b1713e5762d28597bda067fdcaca942a61e6f07365965a9cdeb3f6d7369d9a074f5835cf64d9724d1ac8f2ad84033b84483f3cb619476 SHA512 dedd86838b254c9932166eb161589187f353e986ecd398e9405db43b5159597ba87369e9d7afa8bbfd18288c1213818812fe27881b5f5e99efc63bf31a1d7854
diff --git a/sci-mathematics/maxima/files/ecls-3.patch b/sci-mathematics/maxima/files/ecls-3.patch
new file mode 100644
index 000000000000..b44dea4d09a8
--- /dev/null
+++ b/sci-mathematics/maxima/files/ecls-3.patch
@@ -0,0 +1,48 @@
+diff -r -U3 maxima-5.42.0.orig/src/maxima.in maxima-5.42.0/src/maxima.in
+--- maxima-5.42.0.orig/src/maxima.in 2018-09-21 08:21:11.000000000 +0700
++++ maxima-5.42.0/src/maxima.in 2018-10-01 21:49:23.551633882 +0700
+@@ -236,7 +236,7 @@
+ fi
+
+ elif [ "$MAXIMA_LISP" = "ecl" ]; then
+- exec "$maxima_image_base" --frame-stack 4096 --lisp-stack 65536 $MAXIMA_LISP_OPTIONS -- "$@"
++ exec "$maxima_image_base" --frame-stack 4096 --lisp-stack 65536 $MAXIMA_LISP_OPTIONS -norc -- "$@"
+
+ elif [ "$MAXIMA_LISP" = "sbcl" ]; then
+ # Use executable image if it exists.
+diff -r -U3 maxima-5.42.0.orig/src/maxima.system maxima-5.42.0/src/maxima.system
+--- maxima-5.42.0.orig/src/maxima.system 2016-12-04 05:27:40.000000000 +0700
++++ maxima-5.42.0/src/maxima.system 2018-10-01 22:01:08.068604254 +0700
+@@ -59,6 +59,14 @@
+ (c:build-fasl output :lisp-files (list object-output)))))
+
+ #+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 ()
+ (labels ((list-all-objects (module)
+ (if (eql (mk::component-type module) :file)
+@@ -75,11 +83,16 @@
+ ;; Convert dir/foo.fas to dir/foo.o
+ (make-pathname :type "o" :defaults p))
+ 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
+ :ld-flags
+ (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*"
+ (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)
+ (cl-user::run)))))))
+
diff --git a/sci-mathematics/maxima/maxima-5.42.0.ebuild b/sci-mathematics/maxima/maxima-5.42.0.ebuild
new file mode 100644
index 000000000000..1c0c67e3ac6e
--- /dev/null
+++ b/sci-mathematics/maxima/maxima-5.42.0.ebuild
@@ -0,0 +1,212 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools elisp-common eutils xdg-utils
+
+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 . 3 2 1 )
+
+IUSE="emacs tk nls unicode X ${LISPS[*]}"
+
+# Languages
+LANGS="de es pt pt_BR"
+for lang in ${LANGS}; do
+ IUSE="${IUSE} l10n_${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-1 )
+
+ n=${#PATCHES[*]}
+ for ((n--; n >= 0; n--)); do
+ eapply "${FILESDIR}"/${PATCHES[${n}]}.patch
+ done
+
+ n=${#LISPS[*]}
+ for ((n--; n >= 0; n--)); do
+ v=${PATCH_V[${n}]}
+ if [ "${v}" != "." ]; then
+ eapply "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
+ fi
+ done
+
+ eapply_user
+
+ # 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 "l10n_${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() {
+ xdg_mimeinfo_database_update
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}
+
+pkg_postrm() {
+ xdg_mimeinfo_database_update
+ if use emacs; then
+ elisp-site-regen
+ mktexlsr
+ fi
+}