1 |
Create symlinks with dosym -r. Use debug-print-function. Document TEXMF. |
2 |
|
3 |
Signed-off-by: Ulrich Müller <ulm@g.o> |
4 |
--- |
5 |
v2: Assign BDEPEND in EAPI 8 |
6 |
|
7 |
eclass/latex-package.eclass | 44 +++++++++++++++++++++++-------------- |
8 |
1 file changed, 27 insertions(+), 17 deletions(-) |
9 |
|
10 |
diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass |
11 |
index bee04b607de1..e04671211824 100644 |
12 |
--- a/eclass/latex-package.eclass |
13 |
+++ b/eclass/latex-package.eclass |
14 |
@@ -7,7 +7,7 @@ |
15 |
# @AUTHOR: |
16 |
# Matthew Turk <satai@g.o> |
17 |
# Martin Ehmsen <ehmsen@g.o> |
18 |
-# @SUPPORTED_EAPIS: 7 |
19 |
+# @SUPPORTED_EAPIS: 7 8 |
20 |
# @BLURB: An eclass for easy installation of LaTeX packages |
21 |
# @DESCRIPTION: |
22 |
# This eClass is designed to be easy to use and implement. The vast majority of |
23 |
@@ -51,21 +51,29 @@ |
24 |
# you must either grab each file individually, or find a place to mirror an |
25 |
# archive of them. (iBiblio) |
26 |
|
27 |
+case ${EAPI} in |
28 |
+ 7) inherit eapi8-dosym ;; |
29 |
+ 8) ;; |
30 |
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
31 |
+esac |
32 |
+ |
33 |
if [[ -z ${_LATEX_PACKAGE_ECLASS} ]]; then |
34 |
_LATEX_PACKAGE_ECLASS=1 |
35 |
|
36 |
RDEPEND="virtual/latex-base" |
37 |
-DEPEND="${RDEPEND} |
38 |
+BDEPEND="${RDEPEND} |
39 |
>=sys-apps/texinfo-4.2-r5" |
40 |
|
41 |
-case ${EAPI:-0} in |
42 |
- [0-6]) |
43 |
- die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; |
44 |
- 7) ;; |
45 |
- *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; |
46 |
-esac |
47 |
+if [[ ${EAPI} == 7 ]]; then |
48 |
+ DEPEND="${BDEPEND}" |
49 |
+ unset BDEPEND |
50 |
+fi |
51 |
|
52 |
HOMEPAGE="http://www.tug.org/" |
53 |
+ |
54 |
+# @ECLASS_VARIABLE: TEXMF |
55 |
+# @DESCRIPTION: |
56 |
+# Top-level installation path. |
57 |
TEXMF="/usr/share/texmf-site" |
58 |
|
59 |
# @ECLASS_VARIABLE: SUPPLIER |
60 |
@@ -90,7 +98,7 @@ LATEX_DOC_ARGUMENTS="" |
61 |
# It installs the files found in the current directory to the standard locations |
62 |
# for a TeX installation |
63 |
latex-package_src_doinstall() { |
64 |
- debug-print function $FUNCNAME $* |
65 |
+ debug-print-function "${FUNCNAME}" "$@" |
66 |
|
67 |
# Avoid generating font cache outside of the sandbox |
68 |
export VARTEXFONTS="${T}/fonts" |
69 |
@@ -118,7 +126,9 @@ latex-package_src_doinstall() { |
70 |
while IFS= read -r -d '' i; do |
71 |
insinto /usr/share/doc/${PF} |
72 |
doins "${i}" |
73 |
- dosym "/usr/share/doc/${PF}/$(basename "${i}")" \ |
74 |
+ local dosym=dosym |
75 |
+ [[ ${EAPI} == 7 ]] && dosym=dosym8 |
76 |
+ ${dosym} -r "/usr/share/doc/${PF}/$(basename "${i}")" \ |
77 |
"${TEXMF}/doc/latex/${PN}/${i}" |
78 |
docompress -x "/usr/share/doc/${PF}/$(basename "${i}")" |
79 |
done < <(find -maxdepth 1 -type f -name "*.${1}" -print0) |
80 |
@@ -200,7 +210,7 @@ latex-package_src_doinstall() { |
81 |
# Calls latex for each *.ins in the current directory in order to generate the |
82 |
# relevant files that will be installed |
83 |
latex-package_src_compile() { |
84 |
- debug-print function $FUNCNAME $* |
85 |
+ debug-print-function "${FUNCNAME}" "$@" |
86 |
while IFS= read -r -d '' i; do |
87 |
einfo "Extracting from ${i}" |
88 |
latex --halt-on-error --interaction=nonstopmode "${i}" || die |
89 |
@@ -211,7 +221,7 @@ latex-package_src_compile() { |
90 |
# @DESCRIPTION: |
91 |
# Installs the package |
92 |
latex-package_src_install() { |
93 |
- debug-print function $FUNCNAME $* |
94 |
+ debug-print-function "${FUNCNAME}" "$@" |
95 |
latex-package_src_doinstall all |
96 |
einstalldocs |
97 |
} |
98 |
@@ -221,7 +231,7 @@ latex-package_src_install() { |
99 |
# Calls latex-package_rehash to ensure the TeX installation is consistent with |
100 |
# the kpathsea database |
101 |
latex-package_pkg_postinst() { |
102 |
- debug-print function $FUNCNAME $* |
103 |
+ debug-print-function "${FUNCNAME}" "$@" |
104 |
latex-package_rehash |
105 |
} |
106 |
|
107 |
@@ -230,7 +240,7 @@ latex-package_pkg_postinst() { |
108 |
# Calls latex-package_rehash to ensure the TeX installation is consistent with |
109 |
# the kpathsea database |
110 |
latex-package_pkg_postrm() { |
111 |
- debug-print function $FUNCNAME $* |
112 |
+ debug-print-function "${FUNCNAME}" "$@" |
113 |
latex-package_rehash |
114 |
} |
115 |
|
116 |
@@ -238,10 +248,10 @@ latex-package_pkg_postrm() { |
117 |
# @DESCRIPTION: |
118 |
# Rehashes the kpathsea database, according to the current TeX installation |
119 |
latex-package_rehash() { |
120 |
- debug-print function $FUNCNAME $* |
121 |
+ debug-print-function "${FUNCNAME}" "$@" |
122 |
texmf-update |
123 |
} |
124 |
|
125 |
-EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |
126 |
- |
127 |
fi |
128 |
+ |
129 |
+EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm |
130 |
-- |
131 |
2.35.1 |