Gentoo Archives: gentoo-commits

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