summaryrefslogtreecommitdiff
blob: 7a01b56ff0808a254fab45d354e7a034ae0c6c90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit latex-package

DESCRIPTION="LaTeX2e macros to prepare manuscripts for the journals of the APS and AIP"
HOMEPAGE="https://journals.aps.org/revtex"
SRC_URI="http://mirrors.ctan.org/macros/latex/contrib/revtex.zip -> ${P}.zip"

LICENSE="LPPL-1.3c"
SLOT="0"
KEYWORDS="amd64 ~x86"

RDEPEND=">=dev-texlive/texlive-latex-2012"
DEPEND="${RDEPEND}
	app-arch/unzip
"

IUSE="doc"

S="${WORKDIR}/${PN}"

TEXMF=/usr/share/texmf-site

src_prepare() {
	default
	find "${S}" -name '*4-1*' -delete || die
	find "${S}" -name reftest4-2.tex -delete || die
}

src_compile() {
	cd "${S}/source" || die

	for name in *.dtx; do
		tex $name || die
	done
	latex-package_src_compile

	cd "${S}/bibtex" || die
	latex-package_src_compile
}

src_install() {
	cd "${S}/source"

	use doc && rm -f aip.dtx # fails to build docs

	latex-package_src_install

	# we need the revtex-specific rtx files in the same dir as the class files
	insinto ${TEXMF}/tex/latex/${PN}
	for i in `find . -maxdepth 1 -type f -name "*.rtx"` ; do
		doins $i
	done

	cd "${S}/bibtex" || die
	latex-package_src_install

	find "${D}" -name aip4-1.rtx -delete || die
}