From 912553d65e683b32868589f1426ab81564611151 Mon Sep 17 00:00:00 2001 From: Mikle Kolyada Date: Mon, 20 Jan 2020 13:49:16 +0300 Subject: Revert "latex-package: remove old EAPIs support" This reverts commit 487a775183d1f62734c80d67e9e49a21292adab7. Signed-off-by: Mikle Kolyada --- eclass/latex-package.eclass | 55 ++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 20 deletions(-) (limited to 'eclass') diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass index 17b937683acf..1a684ef00a66 100644 --- a/eclass/latex-package.eclass +++ b/eclass/latex-package.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Matthew Turk # Martin Ehmsen -# @SUPPORTED_EAPIS: 7 +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 # @BLURB: An eclass for easy installation of LaTeX packages # @DESCRIPTION: # This eClass is designed to be easy to use and implement. The vast majority of @@ -53,15 +53,18 @@ # # It inherits base and eutils in EAPI 5 and earlier. +case ${EAPI:-0} in + 0|1|2|3|4|5) inherit base eutils ;; +esac + RDEPEND="virtual/latex-base" DEPEND="${RDEPEND} >=sys-apps/texinfo-4.2-r5" - case ${EAPI:-0} in 0|1|2|3|4|5|6) ;; - *) die "${EAPI} is not supported" ;; + 7) BDEPEND="${DEPEND}"; DEPEND="" ;; + *) die "${ECLASS}: Unknown EAPI ${EAPI}" ;; esac - HOMEPAGE="http://www.tug.org/" TEXMF="/usr/share/texmf-site" @@ -78,6 +81,14 @@ SUPPLIER="misc" # must be set after inherit, as it gets automatically cleared otherwise. LATEX_DOC_ARGUMENTS="" +# Kept for backwards compatibility +latex-package_has_tetex_3() { + case ${EAPI:-0} in + 0|1|2|3|4|5) return 0 ;; + *) die "${FUNCNAME} no longer supported in EAPI ${EAPI}" ;; + esac +} + # @FUNCTION: latex-package_src_doinstall # @USAGE: [ module ] # @DESCRIPTION: @@ -94,31 +105,34 @@ latex-package_src_doinstall() { # This actually follows the directions for a "single-user" system # at http://www.ctan.org/installationadvice/ modified for gentoo. - [[ -z $1 ]] && latex-package_src_install all + [ -z "$1" ] && latex-package_src_install all - while [[ $1 ]]; do + while [ "$1" ]; do case $1 in "sh") for i in `find . -maxdepth 1 -type f -name "*.${1}"` do - dobin ${i} || die "dobin $i failed" + dobin $i || die "dobin $i failed" done ;; "sty" | "cls" | "fd" | "clo" | "def" | "cfg") for i in `find . -maxdepth 1 -type f -name "*.${1}"` do insinto ${TEXMF}/tex/latex/${PN} - doins ${i} + doins $i || die "doins $i failed" done ;; "dvi" | "ps" | "pdf") for i in `find . -maxdepth 1 -type f -name "*.${1}"` do insinto /usr/share/doc/${PF} - doins ${i} + doins $i || die "doins $i failed" dosym /usr/share/doc/${PF}/$(basename ${i}) ${TEXMF}/doc/latex/${PN}/${i} + case "${EAPI:-0}" in + 0|1|2|3) ;; + *) # prevent compression of symlink target - docompress -x /usr/share/doc/${PF}/$(basename ${i}) + docompress -x /usr/share/doc/${PF}/$(basename ${i}) ;; esac done @@ -127,13 +141,13 @@ latex-package_src_doinstall() { if ! in_iuse doc || use doc ; then for i in `find . -maxdepth 1 -type f -name "*.${1}"` do - [[-n ${LATEX_PACKAGE_SKIP} ]] && has ${i##*/} ${LATEX_PACKAGE_SKIP} && continue - einfo "Making documentation: ${i}" + [ -n "${LATEX_PACKAGE_SKIP}" ] && has ${i##*/} ${LATEX_PACKAGE_SKIP} && continue + einfo "Making documentation: $i" if pdflatex ${LATEX_DOC_ARGUMENTS} --halt-on-error --interaction=nonstopmode $i ; then pdflatex ${LATEX_DOC_ARGUMENTS} --halt-on-error --interaction=nonstopmode $i || die else einfo "pdflatex failed, trying texi2dvi" - texi2dvi -q -c --language=latex ${i} || die + texi2dvi -q -c --language=latex $i || die fi done fi @@ -142,27 +156,28 @@ latex-package_src_doinstall() { for i in `find . -maxdepth 1 -type f -name "*.${1}"` do insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN} - doins ${i} + doins $i || die "doins $i failed" done ;; "pfb") for i in `find . -maxdepth 1 -type f -name "*.pfb"` do insinto ${TEXMF}/fonts/type1/${SUPPLIER}/${PN} - doins ${i} + doins $i || die "doins $i failed" + done ;; "ttf") for i in `find . -maxdepth 1 -type f -name "*.ttf"` do insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN} - doins ${i} + doins $i || die "doins $i failed" done ;; "bst") for i in `find . -maxdepth 1 -type f -name "*.bst"` do insinto ${TEXMF}/bibtex/bst/${PN} - doins ${i} + doins $i || die "doins $i failed" done ;; "styles") @@ -193,8 +208,8 @@ latex-package_src_compile() { debug-print function $FUNCNAME $* for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"` do - einfo "Extracting from ${i}" - latex --halt-on-error --interaction=nonstopmode ${i} || die + einfo "Extracting from $i" + latex --halt-on-error --interaction=nonstopmode $i || die done } @@ -204,7 +219,7 @@ latex-package_src_compile() { latex-package_src_install() { debug-print function $FUNCNAME $* latex-package_src_doinstall all - if [[ -n ${DOCS} ]] ; then + if [ -n "${DOCS}" ] ; then dodoc ${DOCS} fi } -- cgit v1.2.3-65-gdbad