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