|
Line 0
Link Here
|
| 0 |
- |
1 |
# Copyright 1999-2021 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
|
| 4 |
EAPI=7 |
| 5 |
|
| 6 |
DESCRIPTION="Convertor written in Perl that converts LaTeX documents to HTML" |
| 7 |
HOMEPAGE="https://www.latex2html.org/" |
| 8 |
SRC_URI="https://github.com/latex2html/latex2html/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
| 9 |
|
| 10 |
LICENSE="GPL-2" |
| 11 |
SLOT="0" |
| 12 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
| 13 |
IUSE="gif png svg" |
| 14 |
|
| 15 |
DEPEND=" |
| 16 |
app-text/ghostscript-gpl |
| 17 |
virtual/latex-base |
| 18 |
>=media-libs/netpbm-10.86.24 |
| 19 |
dev-lang/perl |
| 20 |
gif? ( media-libs/giflib ) |
| 21 |
png? ( media-libs/libpng:0 ) |
| 22 |
svg? ( app-text/poppler[cairo] )" |
| 23 |
RDEPEND="${DEPEND}" |
| 24 |
|
| 25 |
PATCHES=( |
| 26 |
"${FILESDIR}"/${PN}-2021.2-fix-PNMCROPOPT.patch |
| 27 |
"${FILESDIR}"/${PN}-2021.2-respect-DESTDIR.patch |
| 28 |
) |
| 29 |
|
| 30 |
src_prepare() { |
| 31 |
default |
| 32 |
|
| 33 |
sed -i -e 's%@PERL@%'"${EPREFIX}"'/usr/bin/perl%g' wrapper/unix.pin || die |
| 34 |
} |
| 35 |
|
| 36 |
src_configure() { |
| 37 |
local myconf |
| 38 |
|
| 39 |
use gif || use png || myconf+=" --disable-images" |
| 40 |
|
| 41 |
econf \ |
| 42 |
--libdir="${EPREFIX}"/usr/$(get_libdir)/latex2html \ |
| 43 |
--shlibdir="${EPREFIX}"/usr/$(get_libdir)/latex2html \ |
| 44 |
--enable-pk \ |
| 45 |
--enable-eps \ |
| 46 |
--enable-reverse \ |
| 47 |
--enable-pipes \ |
| 48 |
--enable-paths \ |
| 49 |
--enable-wrapper \ |
| 50 |
--with-texpath="${EPREFIX}"/usr/share/texmf-site/tex/latex/html \ |
| 51 |
--without-mktexlsr \ |
| 52 |
$(use_enable gif) \ |
| 53 |
$(use_enable png) \ |
| 54 |
${myconf} |
| 55 |
} |
| 56 |
|
| 57 |
src_install() { |
| 58 |
emake DESTDIR="${D}" install |
| 59 |
|
| 60 |
# make /usr/share/latex2html sticky |
| 61 |
keepdir /usr/share/latex2html |
| 62 |
|
| 63 |
# clean the perl scripts up to remove references to the sandbox |
| 64 |
local dir="${ED}/usr/$(get_libdir)/latex2html" |
| 65 |
if use png || use gif; then |
| 66 |
# pstoimg isn't built unless gif or png useflags are enabled |
| 67 |
sed -i -e "s:${T}:/tmp:g" "${dir}"/pstoimg.pl || die |
| 68 |
fi |
| 69 |
|
| 70 |
sed -i -e "s:${S}::g" "${dir}"/latex2html.pl || die |
| 71 |
sed -i -e "s:${T}:/tmp:g" "${dir}"/cfgcache.pm || die |
| 72 |
sed -i -e "s:${T}:/tmp:g" "${dir}"/l2hconf.pm || die |
| 73 |
|
| 74 |
dodoc BUGS Changes FAQ MANIFEST README.md TODO |
| 75 |
} |
| 76 |
|
| 77 |
pkg_postinst() { |
| 78 |
"${EROOT}"/usr/bin/mktexlsr |
| 79 |
} |
| 80 |
|
| 81 |
pkg_postrm() { |
| 82 |
"${EROOT}"/usr/bin/mktexlsr |
| 83 |
} |