Skip to content

Commit

Permalink
sci-mathematics/maxima: Update Emacs support.
Browse files Browse the repository at this point in the history
Consolidate "emacs" and "latex" USE flags. Remove the non-functional
"xemacs" flag. Add a configure option to disable Emacs support in the
upstream build system.

Bug: 448242

Package-Manager: portage-2.2.26
  • Loading branch information
ulm committed Dec 23, 2015
1 parent 8e15250 commit e88abf1
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 23 deletions.
32 changes: 32 additions & 0 deletions sci-mathematics/maxima/files/emacs-0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--- maxima-5.37.3.orig/configure.ac
+++ maxima-5.37.3/configure.ac
@@ -513,6 +513,17 @@
fi
fi

+AC_ARG_ENABLE(emacs,
+ [ --enable-emacs Emacs support],
+ [case "${enableval}" in
+ yes) enable_emacs=true ;;
+ no) enable_emacs=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-emacs) ;;
+ esac],
+ [enable_emacs=true])
+
+AM_CONDITIONAL(WANT_EMACS, test x$enable_emacs = xtrue)
+
dnl xgettext
AC_ARG_ENABLE(gettext,
[ --enable-gettext Locale support],
--- maxima-5.37.3.orig/interfaces/Makefile.am
+++ maxima-5.37.3/interfaces/Makefile.am
@@ -1,5 +1,8 @@
+if WANT_EMACS
+ MAYBE_EMACS = emacs
+endif
if WANT_TK
MAYBE_XMAXIMA = xmaxima
endif
-SUBDIRS = emacs $(MAYBE_XMAXIMA)
+SUBDIRS = $(MAYBE_EMACS) $(MAYBE_XMAXIMA)
EXTRA_DIST = bin/xmaxima.iss
26 changes: 26 additions & 0 deletions sci-mathematics/maxima/files/wish-2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- maxima-5.37.3.orig/configure.ac
+++ maxima-5.37.3/configure.ac
@@ -991,6 +991,11 @@
[ --with-wish=<prog> Use <prog> for Tk wish shell (default wish)],
- [WISH="${withval}"],
- [WISH="wish"])
+ [],
+ [with_wish="wish"])
+case "${with_wish}" in
+ no) WISH="none" ;;
+ yes) WISH="wish" ;;
+ *) WISH="${with_wish}" ;;
+esac
AC_SUBST(WISH)
-
+AM_CONDITIONAL(WANT_TK, test x"${with_wish}" != xno)

--- maxima-5.37.3.orig/interfaces/Makefile.am
+++ maxima-5.37.3/interfaces/Makefile.am
@@ -1,2 +1,5 @@
-SUBDIRS = emacs xmaxima
+if WANT_TK
+ MAYBE_XMAXIMA = xmaxima
+endif
+SUBDIRS = emacs $(MAYBE_XMAXIMA)
EXTRA_DIST = bin/xmaxima.iss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ 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[*]}"
IUSE="emacs tk nls unicode X ${LISPS[*]}"

# Languages
LANGS="es pt pt_BR"
Expand All @@ -36,13 +36,11 @@ 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 ) )"
virtual/latex-base
app-emacs/auctex
app-text/ghostscript-gpl
dev-texlive/texlive-latexrecommended )"

# generating lisp dependencies
depends() {
Expand Down Expand Up @@ -97,7 +95,7 @@ pkg_setup() {

src_prepare() {
local n PATCHES v
PATCHES=( rmaxima-0 wish-1 xdg-utils-0 db-0 )
PATCHES=( emacs-0 rmaxima-0 wish-2 xdg-utils-0 db-0 )

n=${#PATCHES[*]}
for ((n--; n >= 0; n--)); do
Expand Down Expand Up @@ -140,7 +138,10 @@ src_configure() {
done
fi

econf ${CONFS} $(use_with tk wish) --with-lispdir="${EPREFIX}/${SITELISP}"/${PN}
econf ${CONFS} \
$(use_with tk wish) \
$(use_enable emacs) \
--with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
}

src_compile() {
Expand All @@ -156,13 +157,6 @@ src_install() {
/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
Expand All @@ -173,12 +167,14 @@ src_install() {
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
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
Expand All @@ -190,11 +186,15 @@ src_install() {
}

pkg_postinst() {
use emacs && elisp-site-regen
use latex && mktexlsr
if use emacs; then
elisp-site-regen
mktexlsr
fi
}

pkg_postrm() {
use emacs && elisp-site-regen
use latex && mktexlsr
if use emacs; then
lisp-site-regen
mktexlsr
fi
}

0 comments on commit e88abf1

Please sign in to comment.