From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-852748-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 71EEF1388C1
	for <garchives@archives.gentoo.org>; Mon, 21 Dec 2015 21:08:33 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 8F5B5E084D;
	Mon, 21 Dec 2015 21:08:30 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 18BE9E084D
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Dec 2015 21:08:30 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id A7D5C3406DD
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Dec 2015 21:08:27 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 40EAC920
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Dec 2015 21:08:25 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1450732096.727022b39e84bcb80ee0b63a1fd3424c83b90b79.ulm@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/maxima/, sci-mathematics/maxima/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sci-mathematics/maxima/files/50maxima-gentoo-1.el sci-mathematics/maxima/maxima-5.37.3-r2.ebuild
X-VCS-Directories: sci-mathematics/maxima/ sci-mathematics/maxima/files/
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: 727022b39e84bcb80ee0b63a1fd3424c83b90b79
X-VCS-Branch: master
Date: Mon, 21 Dec 2015 21:08:25 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 7f7251df-ab2f-4232-a8fd-5b3ef4d34202
X-Archives-Hash: 8cb9cccf4be78fec3405fb737bea3a96

commit:     727022b39e84bcb80ee0b63a1fd3424c83b90b79
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 21 21:00:34 2015 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 21 21:08:16 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=727022b3

sci-mathematics/maxima: Install imaxima.

With USE=emacs, install imaxima and byte-compile the elisp files.
This obsoletes app-emacs/imaxima, so block against it.
With USE=-emacs, remove any emacs files installed by the build system.

Bug: 448242

Package-Manager: portage-2.2.26

 sci-mathematics/maxima/files/50maxima-gentoo-1.el |  13 ++
 sci-mathematics/maxima/maxima-5.37.3-r2.ebuild    | 200 ++++++++++++++++++++++
 2 files changed, 213 insertions(+)

diff --git a/sci-mathematics/maxima/files/50maxima-gentoo-1.el b/sci-mathematics/maxima/files/50maxima-gentoo-1.el
new file mode 100644
index 0000000..be14dbf
--- /dev/null
+++ b/sci-mathematics/maxima/files/50maxima-gentoo-1.el
@@ -0,0 +1,13 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'maxima-mode "maxima" "Maxima mode" t)
+(autoload 'maxima "maxima" "Maxima interactive" t)
+(autoload 'dbl "dbl" "Make a debugger to run lisp, maxima and or gdb in" t)
+(add-to-list 'auto-mode-alist '("\\.ma?[cx]\\'" . maxima-mode))
+
+;; emaxima mode
+(autoload 'emaxima-mode "emaxima" "EMaxima" t)
+(add-hook 'emaxima-mode-hook 'emaxima-mark-file-as-emaxima)
+
+;; imaxima
+(autoload 'imaxima "imaxima" "Image support for Maxima." t)
+(autoload 'imath-mode "imath" "Interactive Math minor mode." t)

diff --git a/sci-mathematics/maxima/maxima-5.37.3-r2.ebuild b/sci-mathematics/maxima/maxima-5.37.3-r2.ebuild
new file mode 100644
index 0000000..3afffbf
--- /dev/null
+++ b/sci-mathematics/maxima/maxima-5.37.3-r2.ebuild
@@ -0,0 +1,200 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools elisp-common eutils
+
+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 ~ppc-macos ~x86-macos"
+
+# Supported lisps
+LISPS=(     sbcl cmucl gcl             ecls clozurecl clisp )
+# <lisp> supports readline: . - no, y - yes
+SUPP_RL=(   .    .     y               .    .         y     )
+# . - just --enable-<lisp>, <flag> - --enable-<flag>
+CONF_FLAG=( .    .     .               ecl  ccl       .     )
+# patch file version; . - no patch
+PATCH_V=(   1    1     .               2    2         1     )
+
+IUSE="latex emacs tk nls unicode xemacs X ${LISPS[*]}"
+
+# Languages
+LANGS="es pt pt_BR"
+for lang in ${LANGS}; do
+	IUSE="${IUSE} linguas_${lang}"
+done
+
+# texlive-latexrecommended needed by imaxima for breqn.sty
+RDEPEND="!app-emacs/imaxima
+	X? ( x11-misc/xdg-utils
+		 sci-visualization/gnuplot[gd]
+		 tk? ( dev-lang/tk:0 ) )
+	latex? ( virtual/latex-base )
+	emacs? ( virtual/emacs
+		latex? ( app-emacs/auctex
+			app-text/ghostscript-gpl
+			dev-texlive/texlive-latexrecommended ) )
+	xemacs? ( app-editors/xemacs
+		latex? ( app-xemacs/auctex ) )"
+
+# generating lisp dependencies
+depends() {
+	local LISP DEP
+	LISP=${LISPS[$1]}
+	DEP="dev-lisp/${LISP}:="
+	if [ "${SUPP_RL[$1]}" = "." ]; then
+		DEP="${DEP} app-misc/rlwrap"
+	fi
+	echo ${DEP}
+}
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+	LISP=${LISPS[${n}]}
+	RDEPEND="${RDEPEND} ${LISP}? ( $(depends ${n}) )"
+	DEF_DEP="${DEF_DEP} !${LISP}? ( "
+done
+
+# default lisp
+DEF_LISP=0 # sbcl
+ARM_LISP=2 # gcl
+DEF_DEP="${DEF_DEP} arm? ( `depends ${ARM_LISP}` ) !arm? ( `depends ${DEF_LISP}` )"
+
+n=${#LISPS[*]}
+for ((n--; n >= 0; n--)); do
+	DEF_DEP="${DEF_DEP} )"
+done
+
+unset LISP
+
+RDEPEND="${RDEPEND}
+	${DEF_DEP}"
+
+DEPEND="${RDEPEND}
+	sys-apps/texinfo"
+
+TEXMF="${EPREFIX}"/usr/share/texmf-site
+
+pkg_setup() {
+	local n=${#LISPS[*]}
+
+	for ((n--; n >= 0; n--)); do
+		use ${LISPS[${n}]} && NLISPS="${NLISPS} ${n}"
+	done
+
+	if [ -z "${NLISPS}" ]; then
+		ewarn "No lisp specified in USE flags, choosing ${LISPS[${DEF_LISP}]} as default"
+		NLISPS=${DEF_LISP}
+	fi
+}
+
+src_prepare() {
+	local n PATCHES v
+	PATCHES=( rmaxima-0 wish-1 xdg-utils-0 db-0 )
+
+	n=${#PATCHES[*]}
+	for ((n--; n >= 0; n--)); do
+		epatch "${FILESDIR}"/${PATCHES[${n}]}.patch
+	done
+
+	n=${#LISPS[*]}
+	for ((n--; n >= 0; n--)); do
+		v=${PATCH_V[${n}]}
+		if [ "${v}" != "." ]; then
+			epatch "${FILESDIR}"/${LISPS[${n}]}-${v}.patch
+		fi
+	done
+
+	# bug #343331
+	rm share/Makefile.in || die
+	rm src/Makefile.in || die
+	touch src/*.mk
+	touch src/Makefile.am
+	eautoreconf
+}
+
+src_configure() {
+	local CONFS CONF n lang
+	for n in ${NLISPS}; do
+		CONF=${CONF_FLAG[${n}]}
+		if [ ${CONF} = . ]; then
+			CONF=${LISPS[${n}]}
+		fi
+		CONFS="${CONFS} --enable-${CONF}"
+	done
+
+	# enable existing translated doc
+	if use nls; then
+		for lang in ${LANGS}; do
+			if use "linguas_${lang}"; then
+				CONFS="${CONFS} --enable-lang-${lang}"
+				use unicode && CONFS="${CONFS} --enable-lang-${lang}-utf8"
+			fi
+		done
+	fi
+
+	econf ${CONFS} $(use_with tk wish) --with-lispdir="${EPREFIX}/${SITELISP}"/${PN}
+}
+
+src_compile() {
+	emake
+	use emacs && elisp-compile interfaces/emacs/{emaxima,imaxima}/*.el
+}
+
+src_install() {
+	docompress -x /usr/share/info
+	emake DESTDIR="${D}" emacsdir="${EPREFIX}/${SITELISP}/${PN}" install
+
+	use tk && make_desktop_entry xmaxima xmaxima \
+		/usr/share/${PN}/${PV}/xmaxima/maxima-new.png \
+		"Science;Math;Education"
+
+	rm -f "${ED}"/${SITELISP}/${PN}/emaxima.sty
+
+	if use latex; then
+		insinto ${TEXMF}/tex/latex/emaxima
+		doins interfaces/emacs/emaxima/emaxima.sty
+	fi
+
+	# 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
+	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
+		insinto /usr/share/${PN}/${PV}/doc/imaxima
+		doins interfaces/emacs/imaxima/README
+		doins -r interfaces/emacs/imaxima/imath-example
+	else
+		# remove any emacs files installed by the build system
+		rm -rf "${ED}"/usr/share/emacs
+	fi
+
+	# if we use ecls, build an ecls library for maxima
+	if use ecls; then
+		ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
+		insinto "${ECLLIB#${EPREFIX}}"
+		doins src/binary-ecl/maxima.fas
+	fi
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+	use latex && mktexlsr
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+	use latex && mktexlsr
+}