-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
template
144 lines (127 loc) · 4.19 KB
/
template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Template file for 'maxima'
pkgname=maxima
version=5.47.0
revision=3
build_style=gnu-configure
configure_args="$(vopt_enable clisp) $(vopt_enable sbcl) $(vopt_enable ecl)
makeinfo_found=true"
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="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-2.0-only"
homepage="http://maxima.sourceforge.net"
changelog="https://sourceforge.net/p/maxima/code/ci/master/tree/changelogs/ChangeLog-${version%.*}.md?format=raw"
distfiles="${SOURCEFORGE_SITE}/maxima/maxima-${version}.tar.gz"
checksum=9104021b24fd53e8c03a983509cb42e937a925e8c0c85c335d7709a14fd40f7a
nocross=yes
# maxima-sbcl is nopie and should NOT be stripped or it won't work
nostrip_files=/usr/lib/maxima/$version/binary-sbcl/maxima
nopie_files=/usr/lib/maxima/$version/binary-sbcl/maxima
if [ "$build_option_sbcl" ]; then
# binary-sbcl/maxima uses libgmp but this won't show up in objdump
shlib_requires=libgmp.so.10
fi
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="ecl"
# sbcl is only available for these architectures
case "$XBPS_TARGET_MACHINE" in
i686|x86_64*|armv7l|ppc64le*)
build_options_default+=" sbcl"
;;
esac
vopt_conflict clisp sbcl
pre_build() {
# do not rebuild these files if they exist
touch -c doc/info/*.html
touch -c doc/info/maxima.info*
touch -c doc/info/maxima_toc.html
touch -c doc/info/maxima-index.lisp
touch -c doc/info/maxima-index-html.lisp
touch -c interfaces/xmaxima/doc/xmaxima.info
touch -c interfaces/xmaxima/doc/xmaxima.html
}
post_build() {
# this one needs to be done after building
touch -c interfaces/emacs/imaxima/imaxima.info
}
do_check() {
if [ "$build_option_ecl" ]; then
echo "maxima-ecl: check that maxima.fas works (#34273)"
ecl --eval '(require :maxima "src/binary-ecl/maxima.fas")' \
--eval '(quit)'
echo PASS
echo "maxima-ecl: check that unlimited heap-size works (#34861)"
./maxima-local -q -l ecl --batch-string=":lisp \
(ext:set-limit 'ext:heap-size 0)
showtime : true $
a : 10^(10^5) $
b : a^600 $
c : a^600 $
"
echo PASS
fi
if [ "$build_option_sbcl" ]; then
echo "maxima-sbcl: check that long arithmetic is fast (#34849)"
timeout -v 30s ./maxima-local -q -l sbcl --batch-string="
showtime : true $
a : 10^(10^5) $
b : a^1000 $
"
echo PASS
fi
if [ "$XBPS_CHECK_PKGS" = full ]; then
# run the testsuite for all versions enabled
make ${makejobs} check
fi
}
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 -f ${DESTDIR}/usr/share/info/dir
}
maxima-src_package() {
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - source files"
pkg_install() {
vmove usr/share/maxima/${version}/src
}
}
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 xmaxima $(vopt_if ecl maxima-ecl)"