/[gentoo-x86]/sci-mathematics/maxima/maxima-5.27.0-r1.ebuild
Gentoo

Contents of /sci-mathematics/maxima/maxima-5.27.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jun 14 18:58:27 2012 UTC (2 years, 2 months ago) by mr_bones_
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
whitespace

(Portage version: 2.1.10.49/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-mathematics/maxima/maxima-5.27.0-r1.ebuild,v 1.1 2012/06/14 15:54:14 neurogeek Exp $
4
5 EAPI=3
6
7 inherit autotools elisp-common eutils
8
9 DESCRIPTION="Free computer algebra environment based on Macsyma"
10 HOMEPAGE="http://maxima.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
16
17 # Supported lisps (the first one is the default)
18 LISPS=( sbcl cmucl gcl ecls clozurecl clisp )
19 # . - just dev-lisp/<lisp>, <version> - >= dev-lisp/<lisp>-<version>
20 MIN_VER=( . . 2.6.8_pre[ansi] 10 . . )
21 # <lisp> supports readline: . - no, y - yes
22 SUPP_RL=( . . y . . y )
23 # . - just --enable-<lisp>, <flag> - --enable-<flag>
24 CONF_FLAG=( . . . ecl ccl . )
25
26 IUSE="latex emacs tk nls unicode xemacs X ${LISPS[*]}"
27
28 # Languages
29 LANGS="es pt pt_BR"
30 for lang in ${LANGS}; do
31 IUSE="${IUSE} linguas_${lang}"
32 done
33
34 RDEPEND="X? ( x11-misc/xdg-utils
35 sci-visualization/gnuplot[gd]
36 tk? ( dev-lang/tk ) )
37 latex? ( virtual/latex-base )
38 emacs? ( virtual/emacs
39 latex? ( app-emacs/auctex ) )
40 xemacs? ( app-editors/xemacs
41 latex? ( app-emacs/auctex ) )"
42
43 PDEPEND="emacs? ( app-emacs/imaxima )"
44
45 # generating lisp dependencies
46 depends() {
47 local LISP DEP
48 LISP=${LISPS[$1]}
49 DEP=${MIN_VER[$1]}
50 if [ "${DEP}" = "." ]; then
51 DEP="dev-lisp/${LISP}"
52 else
53 DEP=">=dev-lisp/${LISP}-${DEP}"
54 fi
55 if [ "${SUPP_RL[$1]}" = "." ]; then
56 DEP="${DEP} app-misc/rlwrap"
57 fi
58 echo ${DEP}
59 }
60
61 n=${#LISPS[*]}
62 for ((n--; n >= 0; n--)); do
63 LISP=${LISPS[${n}]}
64 RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
65 if (( ${n} > 0 )); then
66 DEF_DEP="${DEF_DEP} !${LISP}? ( "
67 fi
68 done
69
70 DEF_DEP="${DEF_DEP} `depends 0`"
71
72 n=${#LISPS[*]}
73 for ((n--; n > 0; n--)); do
74 DEF_DEP="${DEF_DEP} )"
75 done
76
77 unset LISP
78
79 RDEPEND="${RDEPEND}
80 ${DEF_DEP}"
81
82 DEPEND="${RDEPEND}
83 sys-apps/texinfo"
84
85 TEXMF="${EPREFIX}"/usr/share/texmf-site
86
87 pkg_setup() {
88 local n=${#LISPS[*]}
89
90 for ((n--; n >= 0; n--)); do
91 use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
92 done
93
94 if [ -z "${NLISPS}" ]; then
95 ewarn "No lisp specified in USE flags, choosing ${LISPS[0]} as default"
96 NLISPS=0
97 fi
98 }
99
100 src_prepare() {
101 # use xdg-open to view ps, pdf
102 epatch "${FILESDIR}"/${PN}-xdg-utils.patch
103
104 # Don't use lisp init files
105 # ClozureCL (former OpenMCL) executable name is ccl
106 epatch "${FILESDIR}"/${P}.patch
107
108 # make xmaxima conditional on tk (wish)
109 epatch "${FILESDIR}"/${P}-wish.patch
110
111 # don't install imaxima, since we have a separate package for it
112 epatch "${FILESDIR}"/${PN}-imaxima.patch
113
114 # remove rmaxima if not needed
115 epatch "${FILESDIR}"/${PN}-rmaxima.patch
116
117 # fix LDFLAGS handling in ecl (#378195)
118 epatch "${FILESDIR}"/${PN}-ecl-ldflags.patch
119
120 #fix init files
121 epatch "${FILESDIR}"/${P}-inhibit-sys_usr-inits.patch
122
123 # bug #343331
124 rm share/Makefile.in || die
125 rm src/Makefile.in || die
126 touch src/*.mk
127 touch src/Makefile.am
128 eautoreconf
129 }
130
131 src_configure() {
132 local CONFS CONF n lang
133 for n in ${NLISPS}; do
134 CONF=${CONF_FLAG[${n}]}
135 if [ ${CONF} = . ]; then
136 CONF=${LISPS[${n}]}
137 fi
138 CONFS="${CONFS} --enable-${CONF}"
139 done
140
141 # enable existing translated doc
142 if use nls; then
143 for lang in ${LANGS}; do
144 if use "linguas_${lang}"; then
145 CONFS="${CONFS} --enable-lang-${lang}"
146 use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
147 fi
148 done
149 fi
150
151 econf ${CONFS} $(use_with tk wish) --with-lispdir="${SITELISP}"/${PN}
152 }
153
154 src_install() {
155 einstall emacsdir="${ED}${SITELISP}/${PN}" || die "einstall failed"
156
157 use tk && make_desktop_entry xmaxima xmaxima \
158 /usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
159 "Science;Math;Education"
160
161 if use latex; then
162 insinto ${TEXMF}/tex/latex/emaxima
163 doins interfaces/emacs/emaxima/emaxima.sty
164 fi
165
166 # do not use dodoc because interfaces can't read compressed files
167 # read COPYING before attempt to remove it from dodoc
168 insinto /usr/share/${PN}/${PV}/doc
169 doins AUTHORS COPYING README README.lisps || die
170 dodir /usr/share/doc
171 dosym ../${PN}/${PV}/doc /usr/share/doc/${PF} || die
172
173 if use emacs; then
174 elisp-site-file-install "${FILESDIR}"/50maxima-gentoo.el || die
175 fi
176
177 # if we use ecls, build an ecls library for maxima
178 if use ecls; then
179 cd src
180 mkdir ./lisp-cache
181 ecl \
182 -eval '(require `asdf)' \
183 -eval '(setf asdf::*user-cache* (truename "./lisp-cache"))' \
184 -eval '(load "maxima-build.lisp")' \
185 -eval '(asdf:make-build :maxima :type :fasl :move-here ".")' \
186 -eval '(quit)'
187 ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
188 insinto "${ECLLIB#${EPREFIX}}"
189 newins maxima.fasb maxima.fas
190 fi
191 }
192
193 pkg_preinst() {
194 # some lisps do not read compress info files (bug #176411)
195 local infofile
196 for infofile in "${ED}"/usr/share/info/*.bz2 ; do
197 bunzip2 "${infofile}"
198 done
199 }
200
201 pkg_postinst() {
202 use emacs && elisp-site-regen
203 use latex && mktexlsr
204 }
205
206 pkg_postrm() {
207 use emacs && elisp-site-regen
208 use latex && mktexlsr
209 }

  ViewVC Help
Powered by ViewVC 1.1.20