summaryrefslogtreecommitdiff
blob: f6f4f9251a1983e47cc56bcbdfb0277ce100824c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils autotools

DESCRIPTION="A fast, free, high-quality, multi-platform XSL formatter"
HOMEPAGE="http://xmlroff.org/"
SRC_URI="http://xmlroff.org/download/${P}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="cairo debug doc svg truetype"

# at least ciaro or gnome-print is required (as backend)

RDEPEND="x11-libs/gtk+
	x11-libs/pango
	dev-libs/glib:2
	dev-libs/libxml2
	dev-libs/libxslt
	cairo? ( x11-libs/cairo[svg?] )
	!cairo? ( gnome-base/libgnomeprint )
	svg? ( gnome-base/librsvg )
	truetype? ( media-libs/freetype )"
DEPEND="${RDEPEND}
	dev-util/pkgconfig"

src_prepare() {
	epatch "${FILESDIR}/automagic.patch"

	eautoreconf
}

src_configure() {
	local myconf

	use debug && myconf="--enable-libfo-debug"

	econf \
		$(use_enable cairo) \
		$(use_enable !cairo gp) \
		$(use_with svg) \
		$(use_with truetype freetype) \
		${myconf}
}

src_install() {
	local docdir="/usr/share/doc/${PF}"

	emake DESTDIR="${D}" HTML_DIR="${docdir}" install || die "emake install failed"

	if use doc; then
		mv "${D}/${docdir}/${PN}" "${D}/${docdir}/html" || die
	else
		rm -r "${D}/${docdir}/${PN}" || die
	fi

	dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed"
}