Skip to content

Commit

Permalink
latex-package: remove old EAPIs support
Browse files Browse the repository at this point in the history
Signed-off-by: Mikle Kolyada <[email protected]>
  • Loading branch information
Zlogene committed Jan 20, 2020
1 parent 045e67c commit 487a775
Showing 1 changed file with 20 additions and 35 deletions.
55 changes: 20 additions & 35 deletions eclass/latex-package.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# @AUTHOR:
# Matthew Turk <[email protected]>
# Martin Ehmsen <[email protected]>
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
# @SUPPORTED_EAPIS: 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
Expand Down Expand Up @@ -53,18 +53,15 @@
#
# 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) ;;
7) BDEPEND="${DEPEND}"; DEPEND="" ;;
*) die "${ECLASS}: Unknown EAPI ${EAPI}" ;;
*) die "${EAPI} is not supported" ;;
esac

HOMEPAGE="http://www.tug.org/"
TEXMF="/usr/share/texmf-site"

Expand All @@ -81,14 +78,6 @@ 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:
Expand All @@ -105,34 +94,31 @@ 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 || die "doins $i failed"
doins ${i}
done
;;
"dvi" | "ps" | "pdf")
for i in `find . -maxdepth 1 -type f -name "*.${1}"`
do
insinto /usr/share/doc/${PF}
doins $i || die "doins $i failed"
doins ${i}
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
Expand All @@ -141,13 +127,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
Expand All @@ -156,28 +142,27 @@ latex-package_src_doinstall() {
for i in `find . -maxdepth 1 -type f -name "*.${1}"`
do
insinto ${TEXMF}/fonts/${1}/${SUPPLIER}/${PN}
doins $i || die "doins $i failed"
doins ${i}
done
;;
"pfb")
for i in `find . -maxdepth 1 -type f -name "*.pfb"`
do
insinto ${TEXMF}/fonts/type1/${SUPPLIER}/${PN}
doins $i || die "doins $i failed"
done
doins ${i}
;;
"ttf")
for i in `find . -maxdepth 1 -type f -name "*.ttf"`
do
insinto ${TEXMF}/fonts/truetype/${SUPPLIER}/${PN}
doins $i || die "doins $i failed"
doins ${i}
done
;;
"bst")
for i in `find . -maxdepth 1 -type f -name "*.bst"`
do
insinto ${TEXMF}/bibtex/bst/${PN}
doins $i || die "doins $i failed"
doins ${i}
done
;;
"styles")
Expand Down Expand Up @@ -208,8 +193,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
}

Expand All @@ -219,7 +204,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
}
Expand Down

0 comments on commit 487a775

Please sign in to comment.