Gentoo Archives: gentoo-dev

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