| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-util/gtk-doc/gtk-doc-1.18-r1.ebuild,v 1.9 2012/05/24 13:48:19 ssuominen Exp $ |
| 4 |
|
| 5 |
EAPI="3" |
| 6 |
GCONF_DEBUG="yes" |
| 7 |
GNOME_TARBALL_SUFFIX="xz" |
| 8 |
PYTHON_DEPEND="2" |
| 9 |
|
| 10 |
inherit eutils elisp-common gnome2 python |
| 11 |
|
| 12 |
DESCRIPTION="GTK+ Documentation Generator" |
| 13 |
HOMEPAGE="http://www.gtk.org/gtk-doc/" |
| 14 |
|
| 15 |
LICENSE="GPL-2 FDL-1.1" |
| 16 |
SLOT="0" |
| 17 |
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris" |
| 18 |
IUSE="debug doc emacs highlight vim test" |
| 19 |
|
| 20 |
# dev-tex/tex4ht blocker needed due bug #315287 |
| 21 |
RDEPEND=">=dev-libs/glib-2.6:2 |
| 22 |
>=dev-lang/perl-5.6 |
| 23 |
>=app-text/openjade-1.3.1 |
| 24 |
dev-libs/libxslt |
| 25 |
>=dev-libs/libxml2-2.3.6:2 |
| 26 |
~app-text/docbook-xml-dtd-4.3 |
| 27 |
app-text/docbook-xsl-stylesheets |
| 28 |
~app-text/docbook-sgml-dtd-3.0 |
| 29 |
>=app-text/docbook-dsssl-stylesheets-1.40 |
| 30 |
emacs? ( virtual/emacs ) |
| 31 |
highlight? ( |
| 32 |
vim? ( || ( app-editors/vim app-editors/gvim ) ) |
| 33 |
!vim? ( dev-util/source-highlight ) |
| 34 |
) |
| 35 |
!!<dev-tex/tex4ht-20090611_p1038-r1" |
| 36 |
|
| 37 |
DEPEND="${RDEPEND} |
| 38 |
~dev-util/gtk-doc-am-${PV} |
| 39 |
virtual/pkgconfig |
| 40 |
>=app-text/scrollkeeper-0.3.14 |
| 41 |
>=app-text/gnome-doc-utils-0.3.2 |
| 42 |
test? ( app-text/scrollkeeper-dtd )" |
| 43 |
|
| 44 |
pkg_setup() { |
| 45 |
SITEFILE=61${PN}-gentoo.el |
| 46 |
DOCS="AUTHORS ChangeLog MAINTAINERS NEWS README TODO" |
| 47 |
|
| 48 |
if use vim; then |
| 49 |
G2CONF="${G2CONF} $(use_with highlight highlight vim)" |
| 50 |
else |
| 51 |
G2CONF="${G2CONF} $(use_with highlight highlight source-highlight)" |
| 52 |
fi |
| 53 |
G2CONF+=" --with-xml-catalog=${EPREFIX}/etc/xml/catalog" |
| 54 |
|
| 55 |
python_set_active_version 2 |
| 56 |
} |
| 57 |
|
| 58 |
src_prepare() { |
| 59 |
gnome2_src_prepare |
| 60 |
|
| 61 |
# Always disable fop; it is unreliable enough that gtk-doc upstream |
| 62 |
# commented it out by default, and if it's autodetected, it causes build |
| 63 |
# failures in other packages, bug #403165 |
| 64 |
sed -e 's:test -n "@FOP@":test -n "":' \ |
| 65 |
-i gtkdoc-mkpdf.in || die "sed failed" |
| 66 |
|
| 67 |
# Remove global Emacs keybindings. |
| 68 |
epatch "${FILESDIR}/${PN}-1.8-emacs-keybindings.patch" |
| 69 |
} |
| 70 |
|
| 71 |
src_compile() { |
| 72 |
gnome2_src_compile |
| 73 |
|
| 74 |
use emacs && elisp-compile tools/gtk-doc.el |
| 75 |
} |
| 76 |
|
| 77 |
src_install() { |
| 78 |
gnome2_src_install |
| 79 |
|
| 80 |
python_convert_shebangs 2 "${ED}"/usr/bin/gtkdoc-depscan |
| 81 |
|
| 82 |
# Don't install those files, they are in gtk-doc-am now |
| 83 |
rm "${ED}"/usr/share/aclocal/gtk-doc.m4 || die "failed to remove gtk-doc.m4" |
| 84 |
rm "${ED}"/usr/bin/gtkdoc-rebase || die "failed to remove gtkdoc-rebase" |
| 85 |
|
| 86 |
if use doc; then |
| 87 |
docinto doc |
| 88 |
dodoc doc/* || die |
| 89 |
docinto examples |
| 90 |
dodoc examples/* || die |
| 91 |
fi |
| 92 |
|
| 93 |
if use emacs; then |
| 94 |
elisp-install ${PN} tools/gtk-doc.el* |
| 95 |
elisp-site-file-install "${FILESDIR}/${SITEFILE}" |
| 96 |
fi |
| 97 |
} |
| 98 |
|
| 99 |
pkg_postinst() { |
| 100 |
if use emacs; then |
| 101 |
elisp-site-regen |
| 102 |
elog "gtk-doc does no longer define global key bindings for Emacs." |
| 103 |
elog "You may set your own key bindings for \"gtk-doc-insert\" and" |
| 104 |
elog "\"gtk-doc-insert-section\" in your ~/.emacs file." |
| 105 |
fi |
| 106 |
} |
| 107 |
|
| 108 |
pkg_postrm() { |
| 109 |
use emacs && elisp-site-regen |
| 110 |
} |