2017-12-20 04:14:40 +03:00
|
|
|
# Copyright 1999-2017 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=6
|
2017-12-22 06:21:23 +03:00
|
|
|
inherit toolchain-funcs xdg-utils eutils
|
2017-12-20 04:14:40 +03:00
|
|
|
|
|
|
|
DESCRIPTION="Convert HTML pages into a PDF document"
|
|
|
|
HOMEPAGE="https://michaelrsweet.github.io/htmldoc/"
|
|
|
|
SRC_URI="https://github.com/michaelrsweet/${PN}/releases/download/v${PV}/${P}-source.tar.gz"
|
2017-12-30 07:25:48 +03:00
|
|
|
IUSE="fltk cyrillic-fonts"
|
2017-12-20 04:14:40 +03:00
|
|
|
SLOT="0"
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
KEYWORDS="alpha amd64 ~arm ~hppa ia64 ppc ppc64 sparc x86"
|
2017-12-30 06:36:13 +03:00
|
|
|
RESTRICT="strip" # Not sure
|
2017-12-20 04:14:40 +03:00
|
|
|
|
|
|
|
DEPEND=">=media-libs/libpng-1.4:0=
|
|
|
|
virtual/jpeg:0
|
|
|
|
fltk? ( x11-libs/fltk:1 )"
|
|
|
|
RDEPEND="${DEPEND}"
|
|
|
|
|
|
|
|
S="${WORKDIR}"
|
|
|
|
|
2017-12-30 07:25:48 +03:00
|
|
|
|
2017-12-20 04:14:40 +03:00
|
|
|
src_prepare() {
|
|
|
|
default
|
2017-12-30 07:25:48 +03:00
|
|
|
|
|
|
|
if use cyrillic-fonts; then
|
|
|
|
# Taken already prepared fonts, created from GPL Cyrillic fonts available at ftp://ftp.gnome.ru/fonts/ by Sergei Kolodka (sergei@kolodka.com).
|
|
|
|
cp ${FILESDIR}/fonts/* fonts
|
|
|
|
fi
|
|
|
|
|
2017-12-30 06:36:13 +03:00
|
|
|
# Patch .desktop file to remove Appllication declaration, that is incorrect.
|
|
|
|
sed -i -e 's/Application;//' desktop/htmldoc.desktop || die 'failed to patch .desktop file'
|
2017-12-22 06:21:23 +03:00
|
|
|
|
2017-12-20 04:14:40 +03:00
|
|
|
# make sure not to use the libs htmldoc ships with
|
|
|
|
rm -r jpeg png zlib || die 'failed to unbundle jpeg, png, and zlib'
|
|
|
|
|
|
|
|
# Fix the documentation path in a few places. Some Makefiles aren't
|
|
|
|
# autotoolized =(
|
|
|
|
for file in configure doc/Makefile doc/htmldoc.man; do
|
|
|
|
sed -i "${file}" \
|
|
|
|
-e "s:/doc/htmldoc:/doc/${PF}/html:g" \
|
|
|
|
|| die "failed to fix documentation path in ${file}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
CC=$(tc-getCC) CXX=$(tc-getCXX) DSTROOT="${D}" econf $(use_with fltk gui)
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
emake DSTROOT="${D}" install
|
|
|
|
}
|
2017-12-22 06:21:23 +03:00
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
xdg_mimeinfo_database_update
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postrm() {
|
|
|
|
xdg_mimeinfo_database_update
|
|
|
|
}
|