# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) inherit autotools elisp-common flag-o-matic python-single-r1 xdg-utils DESCRIPTION="Free computer algebra environment based on Macsyma" HOMEPAGE="http://maxima.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="GPL-2 GPL-2+" SLOT="0" KEYWORDS="amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" IUSE="clisp clozurecl clozurecl64 cmucl ecl emacs gcl gui nls +sbcl vtk X test" RESTRICT="test" # bug 838202 # Languages LANGS="de es pt pt_BR" for lang in ${LANGS}; do IUSE="${IUSE} l10n_${lang/_/-}" done LISP_DEPEND=" clisp? ( dev-lisp/clisp:= ) clozurecl? ( dev-lisp/clozurecl app-misc/rlwrap ) clozurecl64? ( dev-lisp/clozurecl app-misc/rlwrap ) cmucl? ( dev-lisp/cmucl app-misc/rlwrap ) ecl? ( dev-lisp/ecl:= app-misc/rlwrap ) gcl? ( /dev/null elisp-compile *.el popd > /dev/null pushd interfaces/emacs/imaxima > /dev/null BYTECOMPFLAGS="-L . -L ../emaxima" elisp-compile *.el popd > /dev/null fi } src_install() { docompress -x /usr/share/info emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install # do not use dodoc because interfaces can't read compressed files # read COPYING before attempt to remove it from dodoc insinto /usr/share/${PN}/${PV}/doc doins AUTHORS COPYING README README-lisps.md dodir /usr/share/doc dosym ../${PN}/${PV}/doc /usr/share/doc/${PF} if use emacs; then elisp-install ${PN} interfaces/emacs/{emaxima,imaxima}/*.{el,elc,lisp} elisp-site-file-install "${FILESDIR}"/50maxima-gentoo-1.el rm "${ED}"/${SITELISP}/${PN}/emaxima.sty || die insinto ${TEXMF}/tex/latex/emaxima doins interfaces/emacs/emaxima/emaxima.sty insinto /usr/share/${PN}/${PV}/doc/imaxima doins interfaces/emacs/imaxima/README doins -r interfaces/emacs/imaxima/imath-example if ! use gcl; then # This emacs package is used to run gcl, maxima, gdb, etc. # all at once and possibly in the same buffer. As such, it's # no use without gcl (more to the point: it requires gcl.el). find "${ED}" -name 'dbl.el' -type f -delete || die fi fi if use ecl; then # Use ECL to find the path where it expects to load packages from. ECLLIB=$(ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)") insinto "${ECLLIB#${EPREFIX}}" doins src/binary-ecl/maxima.fas fi } pkg_postinst() { xdg_mimeinfo_database_update if use emacs; then elisp-site-regen mktexlsr fi } pkg_postrm() { xdg_mimeinfo_database_update if use emacs; then elisp-site-regen mktexlsr fi }