1 |
commit: 0547f4e74b206aa4fc02746df0e929a3b8777d19 |
2 |
Author: Andrey Grozin <grozin <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 5 15:26:17 2018 +0000 |
4 |
Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 5 15:26:17 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0547f4e7 |
7 |
|
8 |
sci-mathematics/maxima: be compatible with emacs-27 |
9 |
|
10 |
add the upstream patch |
11 |
bump to eapi 6 |
12 |
Closes: https://bugs.gentoo.org/664848 |
13 |
Package-Manager: Portage-2.3.41, Repoman-2.3.9 |
14 |
|
15 |
sci-mathematics/maxima/files/emacs-27.patch | 10 ++ |
16 |
sci-mathematics/maxima/files/xdg-utils-1.patch | 31 ++++ |
17 |
sci-mathematics/maxima/maxima-5.41.0-r2.ebuild | 212 +++++++++++++++++++++++++ |
18 |
3 files changed, 253 insertions(+) |
19 |
|
20 |
diff --git a/sci-mathematics/maxima/files/emacs-27.patch b/sci-mathematics/maxima/files/emacs-27.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..ded11659900 |
23 |
--- /dev/null |
24 |
+++ b/sci-mathematics/maxima/files/emacs-27.patch |
25 |
@@ -0,0 +1,10 @@ |
26 |
+diff -r -U2 maxima-5.41.0.orig/interfaces/emacs/imaxima/imaxima.el maxima-5.41.0/interfaces/emacs/imaxima/imaxima.el |
27 |
+--- maxima-5.41.0.orig/interfaces/emacs/imaxima/imaxima.el 2016-04-03 03:42:45.000000000 +0600 |
28 |
++++ maxima-5.41.0/interfaces/emacs/imaxima/imaxima.el 2018-09-05 20:29:46.843231210 +0700 |
29 |
+@@ -528,5 +528,5 @@ |
30 |
+ (set-process-filter imaxima-gs-process 'imaxima-gs-filter) |
31 |
+ (imaxima-gs-wait) |
32 |
+- (process-kill-without-query imaxima-gs-process nil) |
33 |
++ (set-process-query-on-exit-flag imaxima-gs-process nil) |
34 |
+ (unless (eq (process-status imaxima-gs-process) 'run) |
35 |
+ (setq output (shell-command-to-string (concat imaxima-gs-program " -h"))) |
36 |
|
37 |
diff --git a/sci-mathematics/maxima/files/xdg-utils-1.patch b/sci-mathematics/maxima/files/xdg-utils-1.patch |
38 |
new file mode 100644 |
39 |
index 00000000000..4150eb52cb9 |
40 |
--- /dev/null |
41 |
+++ b/sci-mathematics/maxima/files/xdg-utils-1.patch |
42 |
@@ -0,0 +1,31 @@ |
43 |
+diff -r -U2 maxima-5.41.0.orig/interfaces/emacs/misc/bookmode.el maxima-5.41.0/interfaces/emacs/misc/bookmode.el |
44 |
+--- maxima-5.41.0.orig/interfaces/emacs/misc/bookmode.el 2017-05-29 05:30:43.000000000 +0700 |
45 |
++++ maxima-5.41.0/interfaces/emacs/misc/bookmode.el 2018-09-05 20:53:02.518172515 +0700 |
46 |
+@@ -681,5 +681,5 @@ |
47 |
+ (and tem |
48 |
+ (list (concat "View "(nth 1 tem)) |
49 |
+- 'call-process "ghostview" nil nil nil |
50 |
++ 'call-process "xdg-open" nil nil nil |
51 |
+ (expand-file-name(nth 1 tem)) |
52 |
+ )) |
53 |
+@@ -706,5 +706,5 @@ |
54 |
+ (cond ((looking-at "%PS") "") |
55 |
+ (t "gzip -dc | ")) |
56 |
+- "ghostview -") |
57 |
++ "xdg-open -") |
58 |
+ |
59 |
+ ))) |
60 |
+diff -r -U2 maxima-5.41.0.orig/interfaces/xmaxima/Tkmaxima/Constants.tcl maxima-5.41.0/interfaces/xmaxima/Tkmaxima/Constants.tcl |
61 |
+--- maxima-5.41.0.orig/interfaces/xmaxima/Tkmaxima/Constants.tcl 2016-04-03 03:42:45.000000000 +0600 |
62 |
++++ maxima-5.41.0/interfaces/xmaxima/Tkmaxima/Constants.tcl 2018-09-05 20:55:25.180166516 +0700 |
63 |
+@@ -154,7 +154,7 @@ |
64 |
+ image/png netmath |
65 |
+ image/jpeg netmath |
66 |
+- application/postscript "ghostview -safer %s" |
67 |
+- application/pdf "acroread %s" |
68 |
+- application/x-dvi "xdvi %s" |
69 |
++ application/postscript "xdg-open %s" |
70 |
++ application/pdf "xdg-open %s" |
71 |
++ application/x-dvi "xdg-open %s" |
72 |
+ } |
73 |
+ set maxima_priv(imagecounter) 0 |
74 |
|
75 |
diff --git a/sci-mathematics/maxima/maxima-5.41.0-r2.ebuild b/sci-mathematics/maxima/maxima-5.41.0-r2.ebuild |
76 |
new file mode 100644 |
77 |
index 00000000000..c09441ad802 |
78 |
--- /dev/null |
79 |
+++ b/sci-mathematics/maxima/maxima-5.41.0-r2.ebuild |
80 |
@@ -0,0 +1,212 @@ |
81 |
+# Copyright 1999-2018 Gentoo Foundation |
82 |
+# Distributed under the terms of the GNU General Public License v2 |
83 |
+ |
84 |
+EAPI=6 |
85 |
+ |
86 |
+inherit autotools elisp-common eutils xdg-utils |
87 |
+ |
88 |
+DESCRIPTION="Free computer algebra environment based on Macsyma" |
89 |
+HOMEPAGE="http://maxima.sourceforge.net/" |
90 |
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
91 |
+ |
92 |
+LICENSE="GPL-2 GPL-2+" |
93 |
+SLOT="0" |
94 |
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" |
95 |
+ |
96 |
+# Supported lisps |
97 |
+LISPS=( sbcl cmucl gcl ecls clozurecl clisp ) |
98 |
+# <lisp> supports readline: . - no, y - yes |
99 |
+SUPP_RL=( . . y . . y ) |
100 |
+# . - just --enable-<lisp>, <flag> - --enable-<flag> |
101 |
+CONF_FLAG=( . . . ecl ccl . ) |
102 |
+# patch file version; . - no patch |
103 |
+PATCH_V=( 2 1 . 2 2 1 ) |
104 |
+ |
105 |
+IUSE="emacs tk nls unicode X ${LISPS[*]}" |
106 |
+ |
107 |
+# Languages |
108 |
+LANGS="de es pt pt_BR" |
109 |
+for lang in ${LANGS}; do |
110 |
+ IUSE="${IUSE} l10n_${lang/_/-}" |
111 |
+done |
112 |
+ |
113 |
+# texlive-latexrecommended needed by imaxima for breqn.sty |
114 |
+RDEPEND="!app-emacs/imaxima |
115 |
+ X? ( x11-misc/xdg-utils |
116 |
+ sci-visualization/gnuplot[gd] |
117 |
+ tk? ( dev-lang/tk:0 ) ) |
118 |
+ emacs? ( virtual/emacs |
119 |
+ virtual/latex-base |
120 |
+ app-emacs/auctex |
121 |
+ app-text/ghostscript-gpl |
122 |
+ dev-texlive/texlive-latexrecommended )" |
123 |
+ |
124 |
+# generating lisp dependencies |
125 |
+depends() { |
126 |
+ local LISP DEP |
127 |
+ LISP=${LISPS[$1]} |
128 |
+ DEP="dev-lisp/${LISP}:=" |
129 |
+ if [ "${SUPP_RL[$1]}" = "." ]; then |
130 |
+ DEP="${DEP} app-misc/rlwrap" |
131 |
+ fi |
132 |
+ echo ${DEP} |
133 |
+} |
134 |
+ |
135 |
+n=${#LISPS[*]} |
136 |
+for ((n--; n >= 0; n--)); do |
137 |
+ LISP=${LISPS[${n}]} |
138 |
+ RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )" |
139 |
+ DEF_DEP="${DEF_DEP} !${LISP}? ( " |
140 |
+done |
141 |
+ |
142 |
+# default lisp |
143 |
+DEF_LISP=0 # sbcl |
144 |
+ARM_LISP=2 # gcl |
145 |
+DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )" |
146 |
+ |
147 |
+n=${#LISPS[*]} |
148 |
+for ((n--; n >= 0; n--)); do |
149 |
+ DEF_DEP="${DEF_DEP} )" |
150 |
+done |
151 |
+ |
152 |
+unset LISP |
153 |
+ |
154 |
+RDEPEND="${RDEPEND} |
155 |
+ ${DEF_DEP}" |
156 |
+ |
157 |
+DEPEND="${RDEPEND} |
158 |
+ sys-apps/texinfo" |
159 |
+ |
160 |
+TEXMF="${EPREFIX}"/usr/share/texmf-site |
161 |
+ |
162 |
+pkg_setup() { |
163 |
+ local n=${#LISPS[*]} |
164 |
+ |
165 |
+ for ((n--; n >= 0; n--)); do |
166 |
+ use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}" |
167 |
+ done |
168 |
+ |
169 |
+ if [ -z "${NLISPS}" ]; then |
170 |
+ use arm && DEF_LISP=${ARM_LISP} |
171 |
+ ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default" |
172 |
+ NLISPS=${DEF_LISP} |
173 |
+ fi |
174 |
+} |
175 |
+ |
176 |
+src_prepare() { |
177 |
+ local n PATCHES v |
178 |
+ PATCHES=( emacs-0 emacs-27 rmaxima-0 wish-2 xdg-utils-1 ) |
179 |
+ |
180 |
+ n=${#PATCHES[*]} |
181 |
+ for ((n--; n >= 0; n--)); do |
182 |
+ eapply "${FILESDIR}"/${PATCHES[${n}]}.patch |
183 |
+ done |
184 |
+ |
185 |
+ n=${#LISPS[*]} |
186 |
+ for ((n--; n >= 0; n--)); do |
187 |
+ v=${PATCH_V[${n}]} |
188 |
+ if [ "${v}" != "." ]; then |
189 |
+ eapply "${FILESDIR}"/${LISPS[${n}]}-${v}.patch |
190 |
+ fi |
191 |
+ done |
192 |
+ |
193 |
+ eapply_user |
194 |
+ |
195 |
+ # bug #343331 |
196 |
+ rm share/Makefile.in || die |
197 |
+ rm src/Makefile.in || die |
198 |
+ touch src/*.mk |
199 |
+ touch src/Makefile.am |
200 |
+ eautoreconf |
201 |
+} |
202 |
+ |
203 |
+src_configure() { |
204 |
+ local CONFS CONF n lang |
205 |
+ for n in ${NLISPS}; do |
206 |
+ CONF=${CONF_FLAG[${n}]} |
207 |
+ if [ ${CONF} = . ]; then |
208 |
+ CONF=${LISPS[${n}]} |
209 |
+ fi |
210 |
+ CONFS="${CONFS} --enable-${CONF}" |
211 |
+ done |
212 |
+ |
213 |
+ # enable existing translated doc |
214 |
+ if use nls; then |
215 |
+ for lang in ${LANGS}; do |
216 |
+ if use "l10n_${lang/_/-}"; then |
217 |
+ CONFS="${CONFS} --enable-lang-${lang}" |
218 |
+ use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8" |
219 |
+ fi |
220 |
+ done |
221 |
+ fi |
222 |
+ |
223 |
+ econf ${CONFS} \ |
224 |
+ $(use_with tk wish) \ |
225 |
+ $(use_enable emacs) \ |
226 |
+ --with-lispdir="${EPREFIX}/${SITELISP}/${PN}" |
227 |
+} |
228 |
+ |
229 |
+src_compile() { |
230 |
+ emake |
231 |
+ if use emacs; then |
232 |
+ pushd interfaces/emacs/emaxima > /dev/null |
233 |
+ elisp-compile *.el |
234 |
+ popd > /dev/null |
235 |
+ pushd interfaces/emacs/imaxima > /dev/null |
236 |
+ BYTECOMPFLAGS="-L . -L ../emaxima" |
237 |
+ elisp-compile *.el |
238 |
+ popd > /dev/null |
239 |
+ fi |
240 |
+} |
241 |
+ |
242 |
+src_install() { |
243 |
+ docompress -x /usr/share/info |
244 |
+ emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install |
245 |
+ |
246 |
+ use tk && make_desktop_entry xmaxima xmaxima \ |
247 |
+ /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \ |
248 |
+ "Science;Math;Education" |
249 |
+ |
250 |
+ # do not use dodoc because interfaces can't read compressed files |
251 |
+ # read COPYING before attempt to remove it from dodoc |
252 |
+ insinto /usr/share/${PN}/${PV}/doc |
253 |
+ doins AUTHORS COPYING README README.lisps |
254 |
+ dodir /usr/share/doc |
255 |
+ dosym ../${PN}/${PV}/doc /usr/share/doc/${PF} |
256 |
+ |
257 |
+ if use emacs; then |
258 |
+ elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp} |
259 |
+ elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el |
260 |
+ |
261 |
+ rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die |
262 |
+ insinto ${TEXMF}/tex/latex/emaxima |
263 |
+ doins interfaces/emacs/emaxima/emaxima.sty |
264 |
+ |
265 |
+ insinto /usr/share/${PN}/${PV}/doc/imaxima |
266 |
+ doins interfaces/emacs/imaxima/README |
267 |
+ doins -r interfaces/emacs/imaxima/imath-example |
268 |
+ fi |
269 |
+ |
270 |
+ # if we use ecls, build an ecls library for maxima |
271 |
+ if use ecls; then |
272 |
+ ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"` |
273 |
+ insinto "${ECLLIB#${EPREFIX}}" |
274 |
+ doins src/binary-ecl/maxima.fas |
275 |
+ fi |
276 |
+} |
277 |
+ |
278 |
+pkg_postinst() { |
279 |
+ xdg_mimeinfo_database_update |
280 |
+ if use emacs; then |
281 |
+ elisp-site-regen |
282 |
+ mktexlsr |
283 |
+ fi |
284 |
+} |
285 |
+ |
286 |
+pkg_postrm() { |
287 |
+ xdg_mimeinfo_database_update |
288 |
+ if use emacs; then |
289 |
+ elisp-site-regen |
290 |
+ mktexlsr |
291 |
+ fi |
292 |
+} |