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/
Date: Sun, 31 Dec 2017 05:00:14
Message-Id: 1514696368.474542b951582bba7565591e70121c55774fdd13.grozin@gentoo
1 commit: 474542b951582bba7565591e70121c55774fdd13
2 Author: Andrey Grozin <grozin <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 31 04:59:28 2017 +0000
4 Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 31 04:59:28 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=474542b9
7
8 sci-mathematics/maxima: use l10n instead of linguas
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 sci-mathematics/maxima/maxima-5.41.0-r1.ebuild | 208 +++++++++++++++++++++++++
13 1 file changed, 208 insertions(+)
14
15 diff --git a/sci-mathematics/maxima/maxima-5.41.0-r1.ebuild b/sci-mathematics/maxima/maxima-5.41.0-r1.ebuild
16 new file mode 100644
17 index 00000000000..d525a57c25f
18 --- /dev/null
19 +++ b/sci-mathematics/maxima/maxima-5.41.0-r1.ebuild
20 @@ -0,0 +1,208 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=5
25 +
26 +inherit autotools elisp-common eutils
27 +
28 +DESCRIPTION="Free computer algebra environment based on Macsyma"
29 +HOMEPAGE="http://maxima.sourceforge.net/"
30 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
31 +
32 +LICENSE="GPL-2 GPL-2+"
33 +SLOT="0"
34 +KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
35 +
36 +# Supported lisps
37 +LISPS=( sbcl cmucl gcl ecls clozurecl clisp )
38 +# <lisp> supports readline: . - no, y - yes
39 +SUPP_RL=( . . y . . y )
40 +# . - just --enable-<lisp>, <flag> - --enable-<flag>
41 +CONF_FLAG=( . . . ecl ccl . )
42 +# patch file version; . - no patch
43 +PATCH_V=( 2 1 . 2 2 1 )
44 +
45 +IUSE="emacs tk nls unicode X ${LISPS[*]}"
46 +
47 +# Languages
48 +LANGS="de es pt pt_BR"
49 +for lang in ${LANGS}; do
50 + IUSE="${IUSE} l10n_${lang/_/-}"
51 +done
52 +
53 +# texlive-latexrecommended needed by imaxima for breqn.sty
54 +RDEPEND="!app-emacs/imaxima
55 + X? ( x11-misc/xdg-utils
56 + sci-visualization/gnuplot[gd]
57 + tk? ( dev-lang/tk:0 ) )
58 + emacs? ( virtual/emacs
59 + virtual/latex-base
60 + app-emacs/auctex
61 + app-text/ghostscript-gpl
62 + dev-texlive/texlive-latexrecommended )"
63 +
64 +# generating lisp dependencies
65 +depends() {
66 + local LISP DEP
67 + LISP=${LISPS[$1]}
68 + DEP="dev-lisp/${LISP}:="
69 + if [ "${SUPP_RL[$1]}" = "." ]; then
70 + DEP="${DEP} app-misc/rlwrap"
71 + fi
72 + echo ${DEP}
73 +}
74 +
75 +n=${#LISPS[*]}
76 +for ((n--; n >= 0; n--)); do
77 + LISP=${LISPS[${n}]}
78 + RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
79 + DEF_DEP="${DEF_DEP} !${LISP}? ( "
80 +done
81 +
82 +# default lisp
83 +DEF_LISP=0 # sbcl
84 +ARM_LISP=2 # gcl
85 +DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )"
86 +
87 +n=${#LISPS[*]}
88 +for ((n--; n >= 0; n--)); do
89 + DEF_DEP="${DEF_DEP} )"
90 +done
91 +
92 +unset LISP
93 +
94 +RDEPEND="${RDEPEND}
95 + ${DEF_DEP}"
96 +
97 +DEPEND="${RDEPEND}
98 + sys-apps/texinfo"
99 +
100 +TEXMF="${EPREFIX}"/usr/share/texmf-site
101 +
102 +pkg_setup() {
103 + local n=${#LISPS[*]}
104 +
105 + for ((n--; n >= 0; n--)); do
106 + use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
107 + done
108 +
109 + if [ -z "${NLISPS}" ]; then
110 + use arm && DEF_LISP=${ARM_LISP}
111 + ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default"
112 + NLISPS=${DEF_LISP}
113 + fi
114 +}
115 +
116 +src_prepare() {
117 + local n PATCHES v
118 + PATCHES=( emacs-0 rmaxima-0 wish-2 xdg-utils-0 )
119 +
120 + n=${#PATCHES[*]}
121 + for ((n--; n >= 0; n--)); do
122 + epatch "${FILESDIR}"/${PATCHES[${n}]}.patch
123 + done
124 +
125 + n=${#LISPS[*]}
126 + for ((n--; n >= 0; n--)); do
127 + v=${PATCH_V[${n}]}
128 + if [ "${v}" != "." ]; then
129 + epatch "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
130 + fi
131 + done
132 +
133 + # bug #343331
134 + rm share/Makefile.in || die
135 + rm src/Makefile.in || die
136 + touch src/*.mk
137 + touch src/Makefile.am
138 + eautoreconf
139 +}
140 +
141 +src_configure() {
142 + local CONFS CONF n lang
143 + for n in ${NLISPS}; do
144 + CONF=${CONF_FLAG[${n}]}
145 + if [ ${CONF} = . ]; then
146 + CONF=${LISPS[${n}]}
147 + fi
148 + CONFS="${CONFS} --enable-${CONF}"
149 + done
150 +
151 + # enable existing translated doc
152 + if use nls; then
153 + for lang in ${LANGS}; do
154 + if use "l10n_${lang/_/-}"; then
155 + CONFS="${CONFS} --enable-lang-${lang}"
156 + use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
157 + fi
158 + done
159 + fi
160 +
161 + econf ${CONFS} \
162 + $(use_with tk wish) \
163 + $(use_enable emacs) \
164 + --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
165 +}
166 +
167 +src_compile() {
168 + emake
169 + if use emacs; then
170 + pushd interfaces/emacs/emaxima > /dev/null
171 + elisp-compile *.el
172 + popd > /dev/null
173 + pushd interfaces/emacs/imaxima > /dev/null
174 + BYTECOMPFLAGS="-L . -L ../emaxima"
175 + elisp-compile *.el
176 + popd > /dev/null
177 + fi
178 +}
179 +
180 +src_install() {
181 + docompress -x /usr/share/info
182 + emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
183 +
184 + use tk && make_desktop_entry xmaxima xmaxima \
185 + /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
186 + "Science;Math;Education"
187 +
188 + # do not use dodoc because interfaces can't read compressed files
189 + # read COPYING before attempt to remove it from dodoc
190 + insinto /usr/share/${PN}/${PV}/doc
191 + doins AUTHORS COPYING README README.lisps
192 + dodir /usr/share/doc
193 + dosym ../${PN}/${PV}/doc /usr/share/doc/${PF}
194 +
195 + if use emacs; then
196 + elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp}
197 + elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el
198 +
199 + rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die
200 + insinto ${TEXMF}/tex/latex/emaxima
201 + doins interfaces/emacs/emaxima/emaxima.sty
202 +
203 + insinto /usr/share/${PN}/${PV}/doc/imaxima
204 + doins interfaces/emacs/imaxima/README
205 + doins -r interfaces/emacs/imaxima/imath-example
206 + fi
207 +
208 + # if we use ecls, build an ecls library for maxima
209 + if use ecls; then
210 + ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
211 + insinto "${ECLLIB#${EPREFIX}}"
212 + doins src/binary-ecl/maxima.fas
213 + fi
214 +}
215 +
216 +pkg_postinst() {
217 + if use emacs; then
218 + elisp-site-regen
219 + mktexlsr
220 + fi
221 +}
222 +
223 +pkg_postrm() {
224 + if use emacs; then
225 + elisp-site-regen
226 + mktexlsr
227 + fi
228 +}