void-packages/srcpkgs/maxima/template
2021-12-21 14:19:58 +01:00

110 lines
3.2 KiB
Bash

# Template file for 'maxima'
pkgname=maxima
version=5.45.1
revision=2
build_style=gnu-configure
configure_args="$(vopt_enable clisp) $(vopt_enable sbcl sbcl-exec) $(vopt_enable ecl)"
hostmakedepends="python3 perl emacs texinfo patchelf"
makedepends="$(vopt_if clisp clisp) $(vopt_if sbcl sbcl) $(vopt_if ecl ecl)"
depends="$(vopt_if clisp clisp) rlwrap"
checkdepends="gnuplot"
short_desc="Computer Algebra System"
maintainer="Bosco Garcia <jboscogg@gmail.org>"
license="GPL-2.0-only"
homepage="http://maxima.sourceforge.net"
distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
checksum=fe9016276970bef214a1a244348558644514d7fdfaa4fc8b9d0e87afcbb4e7dc
nostrip=yes
nopie=yes
build_options="clisp sbcl ecl"
desc_option_clisp="Build with CLISP"
desc_option_sbcl="Build with SBCL"
desc_option_ecl="Build with ECL"
build_options_default="sbcl ecl"
vopt_conflict clisp sbcl
post_build() {
if [ "$build_option_ecl" ]; then
# everything will go in the same directory, use rpath=$ORIGIN
patchelf --remove-rpath src/binary-ecl/libmaxima-ecl.so
patchelf --set-rpath \$ORIGIN \
src/binary-ecl/{maxima,maxima.fas}
patchelf \
--replace-needed binary-ecl/libmaxima-ecl.so libmaxima-ecl.so \
src/binary-ecl/{maxima,maxima.fas}
fi
}
do_check() {
if [ "$build_option_ecl" ]; then
echo "Check that maxima.fas works"
ecl --eval "(require 'maxima \"src/binary-ecl/maxima.fas\")" \
--eval "(quit)"
fi
# now run the testsuite
make ${makejobs} check
}
post_install() {
vmkdir usr/share/doc
ln -sf ../maxima/${version}/doc ${DESTDIR}/usr/share/doc/maxima
# symlink man pages for rmaxima and xmaxima
ln -s maxima.1 ${DESTDIR}/usr/share/man/man1/rmaxima.1
ln -s maxima.1 ${DESTDIR}/usr/share/man/man1/xmaxima.1
# info files are used for maxima help, and need to be uncompressed
# removing this file prevents compression of info files
rm ${DESTDIR}/usr/share/info/dir
}
maxima-src_package() {
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - source files"
pkg_install() {
vmove usr/share/maxima/${version}/src
}
}
maxima-emacs_package() {
short_desc+=" - Emacs interface"
depends="${sourcepkg}-${version}_${revision} virtual?emacs"
pkg_install() {
vmove usr/share/emacs
}
}
xmaxima_package() {
short_desc+=" - Tk interface"
depends="${sourcepkg}-${version}_${revision} tk"
pkg_install() {
vmove usr/bin/xmaxima
vmove usr/share/man/man1/xmaxima.1
vmove usr/share/maxima/${version}/xmaxima
vmove usr/share/info/xmaxima.info
vinstall ${FILESDIR}/maxima.desktop 644 usr/share/applications
vmkdir usr/share/pixmaps
ln -sf /usr/share/maxima/${version}/xmaxima/maxima-new.png \
${PKGDESTDIR}/usr/share/pixmaps/maxima
}
}
maxima-ecl_package() {
short_desc+=" - compiled with ECL"
depends="${sourcepkg}-${version}_${revision}"
pkg_install() {
BINARY_ECL=/usr/lib/maxima/${version}/binary-ecl
vmove ${BINARY_ECL}
vinstall src/binary-ecl/libmaxima-ecl.so 755 ${BINARY_ECL}
vinstall src/binary-ecl/maxima.fas 755 ${BINARY_ECL}
# symlink maxima.fas in ECLDIR
ECLDIR=$(ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)")
vmkdir ${ECLDIR}
ln -sr ${PKGDESTDIR}/${BINARY_ECL}/maxima.fas ${PKGDESTDIR}/${ECLDIR}
}
}
subpackages="maxima-src maxima-emacs xmaxima $(vopt_if ecl maxima-ecl)"