Gentoo Archives: gentoo-commits

From: Andrey Grozin <grozin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/maxima/, sci-mathematics/maxima/files/
Date: Tue, 25 May 2021 12:07:27
Message-Id: 1621944430.0dbef4d44bbcdece9d737d3d53eea9b2c6c41460.grozin@gentoo
1 commit: 0dbef4d44bbcdece9d737d3d53eea9b2c6c41460
2 Author: Andrey Grozin <grozin <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 25 12:07:10 2021 +0000
4 Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org>
5 CommitDate: Tue May 25 12:07:10 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dbef4d4
7
8 sci-mathematics/maxima: bump to 5.45.0
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: Andrey Grozin <grozin <AT> gentoo.org>
12
13 sci-mathematics/maxima/Manifest | 1 +
14 sci-mathematics/maxima/files/imaxima-0.patch | 10 ++
15 sci-mathematics/maxima/maxima-5.45.0.ebuild | 235 +++++++++++++++++++++++++++
16 3 files changed, 246 insertions(+)
17
18 diff --git a/sci-mathematics/maxima/Manifest b/sci-mathematics/maxima/Manifest
19 index 1fd7d2d37f5..8aabbfd7df5 100644
20 --- a/sci-mathematics/maxima/Manifest
21 +++ b/sci-mathematics/maxima/Manifest
22 @@ -1,2 +1,3 @@
23 DIST maxima-5.42.1.tar.gz 41865510 BLAKE2B d3b8a50594dc0cef0c354c42be1aee96df77a4e222dbe457edeb47d7fe77a8fe376b10ce8da9e4ff6c447242e9c53a32286d09a64d8600112f6feda92f1fb58d SHA512 79c5e70119b0384d9dd8aa47c7e96a0ccb7e6367526b8a14d21f00137a1c2f0c8b7990bb7231d7c90ffa0090f67c1fa30a418d013d9c5982030ae68de9717f48
24 DIST maxima-5.44.0.tar.gz 34976354 BLAKE2B d6870b6fb0581d9e60d6ed97c7daed8ce12b8b1ae49d0edb7b8d31dd723f9b879eb70440659ff958f53cee16d8d2a92f80dcaa3898d9f6dbabd79a5059073a65 SHA512 1e043bebb7c6d002c113d8de20a98d58d1a8e7bedfc9bcf52819e7c7554655991dc2f42f0333889706574249736db833a237b3e59b967e7e42ede28262e31f2f
25 +DIST maxima-5.45.0.tar.gz 39946933 BLAKE2B bdccb6cb88d458eec4359b7bc0b5337c9d1d0af9fe4cfeece9c80e840a2aa3963793cdf5c02437b72af647ef6c9306224c524f5a715860808d3b49ad5a85641f SHA512 353d33a89e5fd1986e84698866cc9716307a5ab3c7a29908ed474b5d00f6f8869f616334ff068c2c5d175c4bbb95f892d6061b12e43686ee4813b9a16e5a4139
26
27 diff --git a/sci-mathematics/maxima/files/imaxima-0.patch b/sci-mathematics/maxima/files/imaxima-0.patch
28 new file mode 100644
29 index 00000000000..6e7ce2ee1a5
30 --- /dev/null
31 +++ b/sci-mathematics/maxima/files/imaxima-0.patch
32 @@ -0,0 +1,10 @@
33 +diff -r -U2 maxima-5.45.0.orig/interfaces/emacs/imaxima/setup-imaxima-imath.el maxima-5.45.0/interfaces/emacs/imaxima/setup-imaxima-imath.el
34 +--- maxima-5.45.0.orig/interfaces/emacs/imaxima/setup-imaxima-imath.el 2021-05-16 06:20:53.000000000 +0700
35 ++++ maxima-5.45.0/interfaces/emacs/imaxima/setup-imaxima-imath.el 2021-05-25 18:31:38.005882847 +0700
36 +@@ -133,5 +133,5 @@
37 + ;;; imaxima-maxima-options should be "" instead of "(user::run)"
38 + ;;; assigned in the imaxima.el
39 +-(setq imaxima-maxima-options "")
40 ++;(setq imaxima-maxima-options "")
41 +
42 + (autoload 'maxima "maxima" "Maxima CAS mode" t nil)
43
44 diff --git a/sci-mathematics/maxima/maxima-5.45.0.ebuild b/sci-mathematics/maxima/maxima-5.45.0.ebuild
45 new file mode 100644
46 index 00000000000..32f16ada3d3
47 --- /dev/null
48 +++ b/sci-mathematics/maxima/maxima-5.45.0.ebuild
49 @@ -0,0 +1,235 @@
50 +# Copyright 1999-2021 Gentoo Authors
51 +# Distributed under the terms of the GNU General Public License v2
52 +
53 +EAPI=7
54 +
55 +PYTHON_COMPAT=( python3_{7,8} )
56 +
57 +inherit autotools elisp-common flag-o-matic python-single-r1 xdg-utils
58 +
59 +DESCRIPTION="Free computer algebra environment based on Macsyma"
60 +HOMEPAGE="http://maxima.sourceforge.net/"
61 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
62 +
63 +LICENSE="GPL-2 GPL-2+"
64 +SLOT="0"
65 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
66 +
67 +IUSE="clisp clozurecl clozurecl64 cmucl ecls emacs gcl gui nls +sbcl unicode vtk X test"
68 +RESTRICT="!test? ( test )"
69 +
70 +# Languages
71 +LANGS="de es pt pt_BR"
72 +for lang in ${LANGS}; do
73 + IUSE="${IUSE} l10n_${lang/_/-}"
74 +done
75 +
76 +LISP_DEPEND="
77 + clisp? ( dev-lisp/clisp )
78 + clozurecl? ( dev-lisp/clozurecl app-misc/rlwrap )
79 + clozurecl64? ( dev-lisp/clozurecl app-misc/rlwrap )
80 + cmucl? ( dev-lisp/cmucl app-misc/rlwrap )
81 + ecls? ( dev-lisp/ecls app-misc/rlwrap )
82 + gcl? ( dev-lisp/gcl[ansi,readline] )
83 + sbcl? ( dev-lisp/sbcl app-misc/rlwrap )
84 +"
85 +
86 +# Python is used in e.g. doc/info/build_html.sh to build the docs.
87 +# LISP_DEPEND is included in both BDEPEND and DEPEND because the various
88 +# lisp engines are used to both compile and run maxima. It's possible
89 +# that they don't (all?) need to be listed in DEPEND; who knows.
90 +BDEPEND="
91 + ${PYTHON_DEPS}
92 + ${LISP_DEPEND}
93 + test? ( sci-visualization/gnuplot )
94 + sys-apps/texinfo
95 +"
96 +
97 +DEPEND="
98 + ${LISP_DEPEND}
99 + emacs? ( >=app-editors/emacs-23.1:* )
100 + gui? ( dev-lang/tk:0 )
101 +"
102 +
103 +# texlive-latexrecommended needed by imaxima for breqn.sty
104 +#
105 +# VTK is an optional plotting backend that can be enabled by
106 +# running "draw_renderer: 'vtk;" within maxima.
107 +#
108 +# It's NON-optional for the scene() command, but that command is
109 +# currently useless since Tcl/Tk support was dropped in sci-libs/vtk.
110 +# Thus we include VTK only as an optional dependency.
111 +#
112 +# We require app-misc/rlwrap for any lisps that don't support readline
113 +# themselves.
114 +RDEPEND="
115 + ${DEPEND}
116 + X? (
117 + x11-misc/xdg-utils
118 + sci-visualization/gnuplot[gd]
119 + vtk? (
120 + ${PYTHON_DEPS}
121 + sci-libs/vtk[python,rendering,${PYTHON_SINGLE_USEDEP}]
122 + )
123 + )
124 + emacs? (
125 + virtual/latex-base
126 + app-emacs/auctex
127 + app-text/ghostscript-gpl
128 + dev-texlive/texlive-latexrecommended
129 + )"
130 +
131 +# Maxima can make use of X features like plotting (and launching a PNG
132 +# viewer) from the console, but you can't use the xmaxima GUI without X.
133 +REQUIRED_USE="
134 + ${PYTHON_REQUIRED_USE}
135 + || ( clisp clozurecl clozurecl64 cmucl ecls gcl sbcl )
136 + gui? ( X )"
137 +
138 +TEXMF="${EPREFIX}"/usr/share/texmf-site
139 +
140 +pkg_setup() {
141 + # Set the PYTHON variable to whatever it should be.
142 + python-single-r1_pkg_setup
143 +}
144 +
145 +PATCHES=(
146 + "${FILESDIR}/dont-hardcode-python.patch"
147 + "${FILESDIR}/imaxima-0.patch"
148 + "${FILESDIR}/xdg-utils-1.patch"
149 + "${FILESDIR}/wish-2.patch"
150 + "${FILESDIR}/rmaxima-0.patch"
151 + "${FILESDIR}/emacs-0.patch"
152 + "${FILESDIR}/clisp-1.patch"
153 + "${FILESDIR}/clozurecl-3.patch"
154 + "${FILESDIR}/ecls-4.patch"
155 + "${FILESDIR}/cmucl-1.patch"
156 + "${FILESDIR}/sbcl-2.patch"
157 +)
158 +
159 +src_prepare() {
160 + default
161 +
162 + # bug #343331
163 + rm share/Makefile.in || die
164 + rm src/Makefile.in || die
165 + touch src/*.mk
166 + touch src/Makefile.am
167 +
168 + eautoreconf
169 +}
170 +
171 +src_configure() {
172 + local CONFS=""
173 +
174 + # enable existing translated doc
175 + if use nls; then
176 + for lang in ${LANGS}; do
177 + if use "l10n_${lang/_/-}"; then
178 + CONFS="${CONFS} --enable-lang-${lang}"
179 + use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
180 + fi
181 + done
182 + fi
183 +
184 + # Using raw-ldflags fixes the error,
185 + #
186 + # x86_64-pc-linux-gnu/bin/ld: fatal error: -O1 -Wl: invalid option
187 + # value (expected an integer): 1 -Wl
188 + #
189 + # when building the maxima.fas library for ECL. See upstream bugs:
190 + #
191 + # * https://sourceforge.net/p/maxima/bugs/3759/
192 + # * https://gitlab.com/embeddable-common-lisp/ecl/-/issues/636
193 + #
194 + # The 32-bit and 64-bit version of the clozurecl executable
195 + # are both called "ccl" on Gentoo, so we need the additional
196 + # use_with for clozurecl64. See bugs 665364 and 715278....
197 + #
198 + # The usex works around https://sourceforge.net/p/maxima/bugs/3757/
199 + #
200 + econf ${CONFS} \
201 + LDFLAGS="$(raw-ldflags)" \
202 + $(use_enable clisp) \
203 + $(use_enable clozurecl ccl) \
204 + $(use_enable clozurecl64 ccl64) \
205 + $(usex clozurecl64 "--with-ccl64=ccl" "") \
206 + $(use_enable cmucl) \
207 + $(use_enable ecls ecl) \
208 + $(use_enable emacs) \
209 + $(use_enable gcl) \
210 + $(use_with gui wish) \
211 + $(use_enable sbcl) \
212 + --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
213 +}
214 +
215 +src_compile() {
216 + # The variable PYTHONBIN is used in one place while building the
217 + # German documentation. Some day that script should be converted
218 + # to use the value of @PYTHON@ obtained during ./configure.
219 + emake PYTHONBIN="${PYTHON}"
220 + if use emacs; then
221 + pushd interfaces/emacs/emaxima > /dev/null
222 + elisp-compile *.el
223 + popd > /dev/null
224 + pushd interfaces/emacs/imaxima > /dev/null
225 + BYTECOMPFLAGS="-L . -L ../emaxima"
226 + elisp-compile *.el
227 + popd > /dev/null
228 + fi
229 +}
230 +
231 +src_install() {
232 + docompress -x /usr/share/info
233 + emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
234 +
235 + # do not use dodoc because interfaces can't read compressed files
236 + # read COPYING before attempt to remove it from dodoc
237 + insinto /usr/share/${PN}/${PV}/doc
238 + doins AUTHORS COPYING README README-lisps.md
239 + dodir /usr/share/doc
240 + dosym ../${PN}/${PV}/doc /usr/share/doc/${PF}
241 +
242 + if use emacs; then
243 + elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp}
244 + elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el
245 +
246 + rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die
247 + insinto ${TEXMF}/tex/latex/emaxima
248 + doins interfaces/emacs/emaxima/emaxima.sty
249 +
250 + insinto /usr/share/${PN}/${PV}/doc/imaxima
251 + doins interfaces/emacs/imaxima/README
252 + doins -r interfaces/emacs/imaxima/imath-example
253 +
254 + if ! use gcl; then
255 + # This emacs package is used to run gcl, maxima, gdb, etc.
256 + # all at once and possibly in the same buffer. As such, it's
257 + # no use without gcl (more to the point: it requires gcl.el).
258 + find "${ED}" -name 'dbl.el' -type f -delete || die
259 + fi
260 + fi
261 +
262 + if use ecls; then
263 + # Use ECL to find the path where it expects to load packages from.
264 + ECLLIB=$(ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)")
265 + insinto "${ECLLIB#${EPREFIX}}"
266 + doins src/binary-ecl/maxima.fas
267 + fi
268 +}
269 +
270 +pkg_postinst() {
271 + xdg_mimeinfo_database_update
272 + if use emacs; then
273 + elisp-site-regen
274 + mktexlsr
275 + fi
276 +}
277 +
278 +pkg_postrm() {
279 + xdg_mimeinfo_database_update
280 + if use emacs; then
281 + elisp-site-regen
282 + mktexlsr
283 + fi
284 +}