gtk-doc-1.32.ebuild (2167B)
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python3_{5,6,7} )
6
7 inherit eutils elisp-common gnome2 python-single-r1 readme.gentoo-r1
8
9 DESCRIPTION="GTK+ Documentation Generator"
10 HOMEPAGE="https://www.gtk.org/gtk-doc/"
11
12 LICENSE="GPL-2 FDL-1.1"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris"
15
16 IUSE="debug doc emacs pdf test"
17 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
18
19 RDEPEND="
20 ${PYTHON_DEPS}
21 dev-libs/libxslt
22 dev-libs/libxml2
23 app-text/docbook-xsl-stylesheets
24 dev-python/pygments[${PYTHON_USEDEP}]
25 doc? ( app-text/yelp-tools )
26 emacs? ( virtual/emacs )
27 pdf? (
28 || (
29 app-text/dblatex
30 dev-java/fop
31 )
32 )
33 test? ( >=dev-libs/glib-2.38.0:2 )
34 "
35 DEPEND="${RDEPEND}
36 ~dev-util/gtk-doc-am-${PV}
37 dev-util/itstool
38 virtual/pkgconfig
39 "
40
41 pkg_setup() {
42 DOC_CONTENTS="gtk-doc does no longer define global key bindings for Emacs.
43 You may set your own key bindings for \"gtk-doc-insert\" and
44 \"gtk-doc-insert-section\" in your ~/.emacs file."
45 SITEFILE=61${PN}-gentoo.el
46 python-single-r1_pkg_setup
47 }
48
49 src_prepare() {
50 # Remove global Emacs keybindings, bug #184588
51 eapply "${FILESDIR}"/${PN}-1.8-emacs-keybindings.patch
52
53 # Apply upstream commit 1baf9a6, bug #646850
54 sed -e '1,/exit 1/s/exit 1/exit $1/' \
55 -i gtkdoc-mkpdf.in || die
56
57 gnome2_src_prepare
58 }
59
60 src_configure() {
61 gnome2_src_configure \
62 $(use_enable debug)
63 }
64
65 src_compile() {
66 gnome2_src_compile
67 use emacs && elisp-compile tools/gtk-doc.el
68 }
69
70 src_install() {
71 gnome2_src_install
72
73 python_fix_shebang "${ED}"/usr/bin/
74
75 if use doc; then
76 docinto doc
77 dodoc doc/*
78 docinto examples
79 dodoc examples/*
80 fi
81
82 if use emacs; then
83 elisp-install ${PN} tools/gtk-doc.el*
84 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
85 readme.gentoo_create_doc
86 fi
87 }
88
89 src_test() {
90 emake -j1 check
91 }
92
93 pkg_postinst() {
94 gnome2_pkg_postinst
95 if use emacs; then
96 elisp-site-regen
97 readme.gentoo_print_elog
98 fi
99 }
100
101 pkg_postrm() {
102 gnome2_pkg_postrm
103 use emacs && elisp-site-regen
104 }