Merge remote-tracking branch 'github/pr/372'.
[gentoo.git] / app-emacs / auctex / auctex-11.87-r1.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit elisp latex-package
8
9 DESCRIPTION="Extended support for writing, formatting and using (La)TeX, Texinfo and BibTeX files"
10 HOMEPAGE="https://www.gnu.org/software/auctex/"
11 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-3+ FDL-1.3+"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris"
16 IUSE="preview-latex"
17
18 DEPEND="virtual/latex-base
19         preview-latex? (
20                 app-text/dvipng
21                 app-text/ghostscript-gpl
22         )"
23 RDEPEND="${DEPEND}"
24
25 ELISP_PATCHES="${P}-jit-lock.patch"
26 TEXMF="/usr/share/texmf-site"
27
28 src_prepare() {
29         elisp_src_prepare
30 }
31
32 src_configure() {
33         EMACS_NAME=emacs EMACS_FLAVOR=emacs econf --disable-build-dir-test \
34                 --with-auto-dir="${EPREFIX}/var/lib/auctex" \
35                 --with-lispdir="${EPREFIX}${SITELISP}/${PN}" \
36                 --with-packagelispdir="${EPREFIX}${SITELISP}/${PN}" \
37                 --with-packagedatadir="${EPREFIX}${SITEETC}/${PN}" \
38                 --with-texmf-dir="${EPREFIX}${TEXMF}" \
39                 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
40                 $(use_enable preview-latex preview)
41 }
42
43 src_compile() {
44         export VARTEXFONTS="${T}"/fonts
45         emake
46 }
47
48 src_install() {
49         emake -j1 DESTDIR="${D}" install
50         elisp-site-file-install "${FILESDIR}/50${PN}-gentoo.el" || die
51         if use preview-latex; then
52                 elisp-site-file-install "${FILESDIR}/60${PN}-gentoo.el" || die
53         fi
54         dodoc ChangeLog CHANGES FAQ INSTALL README RELEASE TODO
55 }
56
57 pkg_postinst() {
58         # rebuild TeX-inputfiles-database
59         use preview-latex && latex-package_pkg_postinst
60         elisp-site-regen
61 }
62
63 pkg_postrm(){
64         use preview-latex && latex-package_pkg_postrm
65         elisp-site-regen
66 }