Date: Friday, April 1, 2022 @ 07:01:16 Author: arojas Revision: 441070
Merge maxima-ecl, add patch to use GMP in sbcl version Added: maxima/trunk/build-fasl.patch maxima/trunk/matrixexp.patch maxima/trunk/maxima-sbcl-gmp.patch Modified: maxima/trunk/PKGBUILD -----------------------+ PKGBUILD | 64 ++++++++++++++++++++++++++++++++++-------------- build-fasl.patch | 23 +++++++++++++++++ matrixexp.patch | 13 +++++++++ maxima-sbcl-gmp.patch | 19 ++++++++++++++ 4 files changed, 101 insertions(+), 18 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-04-01 05:36:50 UTC (rev 441069) +++ PKGBUILD 2022-04-01 07:01:16 UTC (rev 441070) @@ -1,28 +1,53 @@ -# Maintainer: Ronald van Haren <ronald.archlinux.org> +# Maintainer: Antonio Rojas <[email protected]> +# Contributor: Ronald van Haren <ronald.archlinux.org> # Contributor: Damir Perisa <[email protected]> pkgname=maxima pkgver=5.45.1 +_sbclver=2.2.2 +_eclver=21.2.1 pkgrel=8 -pkgdesc="A sophisticated computer algebra system" -arch=('x86_64') -license=('GPL') -url="http://maxima.sourceforge.net" -depends=('sbcl=2.2.2' 'texinfo' 'sh' 'shared-mime-info') -makedepends=('python' 'emacs') -optdepends=('gnuplot: plotting capabilities' 'rlwrap: readline support via /usr/bin/rmaxima' 'tk: graphical xmaxima interface') +pkgdesc='A sophisticated computer algebra system' +arch=(x86_64) +license=(GPL) +url='http://maxima.sourceforge.net' +depends=(sbcl=$_sbclver texinfo shared-mime-info) +makedepends=(python emacs ecl) +optdepends=('gnuplot: plotting capabilities' + 'rlwrap: readline support via /usr/bin/rmaxima' + 'tk: graphical xmaxima interface' + 'ecl=$_eclver: ECL lisp backend') +provides=(maxima-ecl) +replaces=(maxima-ecl) # needs rebuild when bash changes version # needs a rebuild when sbcl changes version -options=('!makeflags' '!zipman') # don't zip info pages or they won't work inside maxima -source=("https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz") -sha1sums=('a259f53b0362b77e6a642cf5b5d55aa35c0a483a') +options=(!zipman) # don't zip info pages or they won't work inside maxima +source=(https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz + build-fasl.patch + matrixexp.patch + maxima-sbcl-gmp.patch) +sha256sums=('fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc' + '90ced3b33361fa24c2b417e0aeba8956892f0965b4a22d57d0c04115f2a3274b' + 'ef1bc6a15fc982ff8c6aa1800bbbd3284d9e060ca27abf9d8c1266632c0c2619' + '7e85da0b6672b096d7aefac861573a57323dfe805e08d033781448f7ca6ed856') +prepare() { + patch -d $pkgname-$pkgver -p1 < build-fasl.patch # build maxima ecl library + patch -d $pkgname-$pkgver -p1 < matrixexp.patch # fix matrix exponentiation + patch -d $pkgname-$pkgver -p1 < maxima-sbcl-gmp.patch # Use GMP arithmetic with sbcl (Void Linux) +} + build() { - cd ${pkgname}-${pkgver} + cd $pkgname-$pkgver + ./configure \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --libexecdir=/usr/lib \ + --enable-sbcl \ + --enable-ecl \ + --with-default-lisp=sbcl - ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info \ - --libexecdir=/usr/lib --enable-sbcl --with-default-lisp=sbcl - # help avoid (re)running makeinfo/tex touch doc/info/maxima.info make @@ -29,11 +54,14 @@ } #check() { # test 23&129 fail from rtest_taylor -# cd ${pkgname}-${pkgver} +# cd $pkgname-$pkgver # make check #} package() { - cd ${pkgname}-${pkgver} - make DESTDIR="${pkgdir}" emacsdir=/usr/share/emacs/site-lisp/maxima install + cd $pkgname-$pkgver + make DESTDIR="$pkgdir" emacsdir=/usr/share/emacs/site-lisp/maxima install + +# Install FAS module for sagemath + install -Dm644 src/binary-ecl/maxima.fas -t "$pkgdir"/usr/lib/ecl-$_eclver } Added: build-fasl.patch =================================================================== --- build-fasl.patch (rev 0) +++ build-fasl.patch 2022-04-01 07:01:16 UTC (rev 441070) @@ -0,0 +1,23 @@ +Build a fasl library for ecl in addition to an executable program. + +References: +* http://trac.sagemath.org/ticket/16178 +* https://github.com/cschwan/sage-on-gentoo/issues/226 +* https://bugs.gentoo.org/show_bug.cgi?id=499634 + +Index: maxima-5.29.1/src/maxima.system +=================================================================== +--- maxima-5.29.1.orig/src/maxima.system ++++ maxima-5.29.1/src/maxima.system +@@ -75,6 +75,11 @@ + ;; 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 ""))) (list x)))) + (c::build-program "binary-ecl/maxima" :lisp-files obj + :ld-flags + (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*" Added: matrixexp.patch =================================================================== --- matrixexp.patch (rev 0) +++ matrixexp.patch 2022-04-01 07:01:16 UTC (rev 441070) @@ -0,0 +1,13 @@ +--- a/share/linearalgebra/matrixexp.lisp ++++ b/share/linearalgebra/matrixexp.lisp +@@ -138,8 +138,8 @@ + (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic)) + (print `(ratfac = ,$ratfac)) + (merror "Unable to find the spectrum"))) +- +- (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z)) ++ ++ (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z)) + (setq m (length sp)) + (dotimes (i m) + (setq zi (nth i sp)) Added: maxima-sbcl-gmp.patch =================================================================== --- maxima-sbcl-gmp.patch (rev 0) +++ maxima-sbcl-gmp.patch 2022-04-01 07:01:16 UTC (rev 441070) @@ -0,0 +1,19 @@ +Patch maxima initialization for sbcl so it uses gmp for arithmetic + + +--- a/src/init-cl.lisp 2021-05-15 20:20:53.000000000 -0300 ++++ b/src/init-cl.lisp 2022-01-04 17:45:03.838273626 -0300 +@@ -574,8 +574,13 @@ + (delete-file file))))) + *temp-files-list*)) + ++#+sbcl ++(eval-when (:compile-toplevel :load-toplevel :execute) ++ (require 'sb-gmp)) ++ + (defun cl-user::run () + "Run Maxima in its own package." ++ #+sbcl (sb-gmp:install-gmp-funs) + (in-package :maxima) + (initialize-runtime-globals) + (let ((input-stream *standard-input*)
