Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 20 Jan 2020 10:49:49
Message-Id: 1579517379.912553d65e683b32868589f1426ab81564611151.zlogene@gentoo
1 commit: 912553d65e683b32868589f1426ab81564611151
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 20 10:49:16 2020 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 20 10:49:39 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=912553d6
7
8 Revert "latex-package: remove old EAPIs support"
9
10 This reverts commit 487a775183d1f62734c80d67e9e49a21292adab7.
11
12 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
13
14 eclass/latex-package.eclass | 55 ++++++++++++++++++++++++++++-----------------
15 1 file changed, 35 insertions(+), 20 deletions(-)
16
17 diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass
18 index 17b937683ac..1a684ef00a6 100644
19 --- a/eclass/latex-package.eclass
20 +++ b/eclass/latex-package.eclass
21 @@ -7,7 +7,7 @@
22 # @AUTHOR:
23 # Matthew Turk <satai@g.o>
24 # Martin Ehmsen <ehmsen@g.o>
25 -# @SUPPORTED_EAPIS: 7
26 +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
27 # @BLURB: An eclass for easy installation of LaTeX packages
28 # @DESCRIPTION:
29 # This eClass is designed to be easy to use and implement. The vast majority of
30 @@ -53,15 +53,18 @@
31 #
32 # It inherits base and eutils in EAPI 5 and earlier.
33
34 +case ${EAPI:-0} in
35 + 0|1|2|3|4|5) inherit base eutils ;;
36 +esac
37 +
38 RDEPEND="virtual/latex-base"
39 DEPEND="${RDEPEND}
40 >=sys-apps/texinfo-4.2-r5"
41 -
42 case ${EAPI:-0} in
43 0|1|2|3|4|5|6) ;;
44 - *) die "${EAPI} is not supported" ;;
45 + 7) BDEPEND="${DEPEND}"; DEPEND="" ;;
46 + *) die "${ECLASS}: Unknown EAPI ${EAPI}" ;;
47 esac
48 -
49 HOMEPAGE="http://www.tug.org/"
50 TEXMF="/usr/share/texmf-site"
51
52 @@ -78,6 +81,14 @@ SUPPLIER="misc"
53 # must be set after inherit, as it gets automatically cleared otherwise.
54 LATEX_DOC_ARGUMENTS=""
55
56 +# Kept for backwards compatibility
57 +latex-package_has_tetex_3() {
58 + case ${EAPI:-0} in
59 + 0|1|2|3|4|5) return 0 ;;
60 + *) die "${FUNCNAME} no longer supported in EAPI ${EAPI}" ;;
61 + esac
62 +}
63 +
64 # @FUNCTION: latex-package_src_doinstall
65 # @USAGE: [ module ]
66 # @DESCRIPTION:
67 @@ -94,31 +105,34 @@ latex-package_src_doinstall() {
68
69 # This actually follows the directions for a "single-user" system
70 # at http://www.ctan.org/installationadvice/ modified for gentoo.
71 - [[ -z $1 ]] && latex-package_src_install all
72 + [ -z "$1" ] && latex-package_src_install all
73
74 - while [[ $1 ]]; do
75 + while [ "$1" ]; do
76 case $1 in
77 "sh")
78 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
79 do
80 - dobin ${i} || die "dobin $i failed"
81 + dobin $i || die "dobin $i failed"
82 done
83 ;;
84 "sty" | "cls" | "fd" | "clo" | "def" | "cfg")
85 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
86 do
87 insinto ${TEXMF}/tex/latex/${PN}
88 - doins ${i}
89 + doins $i || die "doins $i failed"
90 done
91 ;;
92 "dvi" | "ps" | "pdf")
93 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
94 do
95 insinto /usr/share/doc/${PF}
96 - doins ${i}
97 + doins $i || die "doins $i failed"
98 dosym /usr/share/doc/${PF}/$(basename ${i}) ${TEXMF}/doc/latex/${PN}/${i}
99 + case "${EAPI:-0}" in
100 + 0|1|2|3) ;;
101 + *)
102 # prevent compression of symlink target
103 - docompress -x /usr/share/doc/${PF}/$(basename ${i})
104 + docompress -x /usr/share/doc/${PF}/$(basename ${i})
105 ;;
106 esac
107 done
108 @@ -127,13 +141,13 @@ latex-package_src_doinstall() {
109 if ! in_iuse doc || use doc ; then
110 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
111 do
112 - [[-n ${LATEX_PACKAGE_SKIP} ]] && has ${i##*/} ${LATEX_PACKAGE_SKIP} && continue
113 - einfo "Making documentation: ${i}"
114 + [ -n "${LATEX_PACKAGE_SKIP}" ] && has ${i##*/} ${LATEX_PACKAGE_SKIP} && continue
115 + einfo "Making documentation: $i"
116 if pdflatex ${LATEX_DOC_ARGUMENTS} --halt-on-error --interaction=nonstopmode $i ; then
117 pdflatex ${LATEX_DOC_ARGUMENTS} --halt-on-error --interaction=nonstopmode $i || die
118 else
119 einfo "pdflatex failed, trying texi2dvi"
120 - texi2dvi -q -c --language=latex ${i} || die
121 + texi2dvi -q -c --language=latex $i || die
122 fi
123 done
124 fi
125 @@ -142,27 +156,28 @@ latex-package_src_doinstall() {
126 for i in `find . -maxdepth 1 -type f -name "*.${1}"`
127 do
128 insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN}
129 - doins ${i}
130 + doins $i || die "doins $i failed"
131 done
132 ;;
133 "pfb")
134 for i in `find . -maxdepth 1 -type f -name "*.pfb"`
135 do
136 insinto ${TEXMF}/fonts/type1/${SUPPLIER}/${PN}
137 - doins ${i}
138 + doins $i || die "doins $i failed"
139 + done
140 ;;
141 "ttf")
142 for i in `find . -maxdepth 1 -type f -name "*.ttf"`
143 do
144 insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN}
145 - doins ${i}
146 + doins $i || die "doins $i failed"
147 done
148 ;;
149 "bst")
150 for i in `find . -maxdepth 1 -type f -name "*.bst"`
151 do
152 insinto ${TEXMF}/bibtex/bst/${PN}
153 - doins ${i}
154 + doins $i || die "doins $i failed"
155 done
156 ;;
157 "styles")
158 @@ -193,8 +208,8 @@ latex-package_src_compile() {
159 debug-print function $FUNCNAME $*
160 for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"`
161 do
162 - einfo "Extracting from ${i}"
163 - latex --halt-on-error --interaction=nonstopmode ${i} || die
164 + einfo "Extracting from $i"
165 + latex --halt-on-error --interaction=nonstopmode $i || die
166 done
167 }
168
169 @@ -204,7 +219,7 @@ latex-package_src_compile() {
170 latex-package_src_install() {
171 debug-print function $FUNCNAME $*
172 latex-package_src_doinstall all
173 - if [[ -n ${DOCS} ]] ; then
174 + if [ -n "${DOCS}" ] ; then
175 dodoc ${DOCS}
176 fi
177 }