aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCormac Stephenson <c7s@kasku.net>2024-01-21 13:18:37 +0000
committerCeleste <20312-Celeste@users.gitlab.alpinelinux.org>2024-04-19 05:11:56 +0000
commit7c8028288544efdc878b93a818a582b3443319a6 (patch)
tree5f1a0277cebf9b8285b2d61d388853f18f9aea11
parent0d2b17a1fd92e8d371c54870aaa705946fe7658f (diff)
testing/maxima: build with eclHEADmaster
Sage calls maxima through ecl, and unless anyone has any other use for maxima there's not really any point in using sbcl, so disable that until there's a reason to enable it.
-rw-r--r--testing/maxima/APKBUILD39
-rw-r--r--testing/maxima/handle-multiple-ldflags.patch43
2 files changed, 72 insertions, 10 deletions
diff --git a/testing/maxima/APKBUILD b/testing/maxima/APKBUILD
index 407d2bdc205..9d2efdec9a6 100644
--- a/testing/maxima/APKBUILD
+++ b/testing/maxima/APKBUILD
@@ -3,16 +3,24 @@
# Contributor: Grigory Kirillov <txgk@bk.ru>
pkgname=maxima
pkgver=5.47.0
-pkgrel=6
+pkgrel=7
pkgdesc="Sophisticated computer algebra system"
url="http://maxima.sourceforge.net"
-# ppc64le, s390x, riscv64: blocked by sbcl
-# arm*, x86: not useful on 32-bit
-# aarch64: fails to build
-arch="x86_64"
+# riscv64: TODO after Alpine 3.20
+arch="all !riscv64"
license="GPL-2.0-or-later"
-depends="texinfo shared-mime-info sbcl"
-makedepends="python3 perl gmp-dev"
+_ecl_version="23.9.9"
+depends="texinfo shared-mime-info"
+makedepends="
+ autoconf
+ automake
+ ecl-dev~=$_ecl_version
+ gc-dev
+ gmp-dev
+ libffi-dev
+ perl
+ python3
+ "
checkdepends="gnuplot"
subpackages="
$pkgname-doc
@@ -20,9 +28,17 @@ subpackages="
$pkgname-bash-completion
$pkgname-emacs
"
-source="maxima-$pkgver.tar.gz::https://sourceforge.net/projects/maxima/files/Maxima-source/$pkgver-source/maxima-$pkgver.tar.gz/download"
+source="
+ maxima-$pkgver.tar.gz::https://sourceforge.net/projects/maxima/files/Maxima-source/$pkgver-source/maxima-$pkgver.tar.gz/download
+ handle-multiple-ldflags.patch
+ "
options="!check" # take hours
+prepare() {
+ default_prepare
+ autoreconf -fi
+}
+
build() {
./configure \
--build=$CBUILD \
@@ -33,8 +49,8 @@ build() {
--infodir=/usr/share/info \
--libexecdir=/usr/lib \
--localstatedir=/var \
- --enable-sbcl \
- --with-default-lisp=sbcl
+ --enable-ecl \
+ --with-default-lisp=ecl
make
}
@@ -47,6 +63,8 @@ package() {
# remove unused files
find "$pkgdir" -type d -iname tests -exec rm -r {} \+
+
+ install -Dm664 src/binary-ecl/maxima.fas -t "$pkgdir"/usr/lib/ecl-$_ecl_version/
}
extra() {
@@ -66,4 +84,5 @@ emacs() {
sha512sums="
953b98336eb086069edaa917981372450ce165dedd7a7b39b181d3f2d8b089551eea943e0084148eaa3ded395dcba9135509d3d11d9132ab7a3ad8bb800d3a11 maxima-5.47.0.tar.gz
+58b574a91f14aa1568b43ce96ac847babed75e91b68be25f40d7da1f09d1e4c8a37f549d33d7566c54e546f4825e8f8f9038777460beea0d3f9282e1ead27eb0 handle-multiple-ldflags.patch
"
diff --git a/testing/maxima/handle-multiple-ldflags.patch b/testing/maxima/handle-multiple-ldflags.patch
new file mode 100644
index 00000000000..799fc15f918
--- /dev/null
+++ b/testing/maxima/handle-multiple-ldflags.patch
@@ -0,0 +1,43 @@
+Description: Handle multiple LDFLAGS
+ Without this patch, building with LDFLAGS containing more than one flag results
+ in flags being dropped.
+Author: Graham Inggs <ginggs@debian.org>
+Bug-Debian: http://bugs.debian.org/847925
+
+--- a/src/maxima.system
++++ b/src/maxima.system
+@@ -58,6 +58,19 @@
+ (and (apply #'compile-file file :output-file object-output args)
+ (c:build-fasl output :lisp-files (list object-output)))))
+
++(defun split-string (string &key (item #\space) (test #'char=))
++ ;; Splits the string into substrings at spaces.
++ (let ((len (length string))
++ (index 0) result)
++ (dotimes (i len
++ (progn (unless (= index len)
++ (push (subseq string index) result))
++ (reverse result)))
++ (when (funcall test (char string i) item)
++ (unless (= index i);; two spaces in a row
++ (push (subseq string index i) result))
++ (setf index (1+ i))))))
++
+ #+ecl
+ (defun build-maxima-lib ()
+ (labels ((list-all-objects (module)
+@@ -79,12 +92,12 @@
+ :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-string 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-string x)))
+ :epilogue-code '(progn (cl-user::run)))))))
+
+ (defun maxima-binary-pathname ()