dev-libs/libnfc: bump
[gentoo.git] / dev-libs / gobject-introspection / gobject-introspection-1.60.2-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_{6,7,8} )
7 PYTHON_REQ_USE="xml"
8 inherit gnome2 python-single-r1 toolchain-funcs
9
10 DESCRIPTION="Introspection system for GObject-based libraries"
11 HOMEPAGE="https://wiki.gnome.org/Projects/GObjectIntrospection"
12
13 LICENSE="LGPL-2+ GPL-2+"
14 SLOT="0"
15 IUSE="cairo doctool test"
16 RESTRICT="!test? ( test )"
17 REQUIRED_USE="
18         ${PYTHON_REQUIRED_USE}
19         test? ( cairo )
20 "
21 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
22
23 # virtual/pkgconfig needed at runtime, bug #505408
24 RDEPEND="
25         >=dev-libs/gobject-introspection-common-${PV}
26         >=dev-libs/glib-2.58.0:2
27         doctool? (
28                 $(python_gen_cond_dep '
29                         dev-python/mako[${PYTHON_MULTI_USEDEP}]
30                         dev-python/markdown[${PYTHON_MULTI_USEDEP}]
31                 ')
32         )
33         virtual/libffi:=
34         virtual/pkgconfig
35         !<dev-lang/vala-0.20.0
36         ${PYTHON_DEPS}
37 "
38 # Wants real bison, not virtual/yacc
39 DEPEND="${RDEPEND}
40         >=dev-util/gtk-doc-am-1.19
41         sys-devel/bison
42         sys-devel/flex
43         test? (
44                 x11-libs/cairo[glib]
45                 $(python_gen_cond_dep '
46                         dev-python/markdown[${PYTHON_MULTI_USEDEP}]
47                 ')
48         )
49 " # autoreconf needs autoconf-archive
50 # PDEPEND to avoid circular dependencies, bug #391213; but needed for tests, thus test DEPEND as well
51 PDEPEND="cairo? ( x11-libs/cairo[glib] )"
52
53 pkg_setup() {
54         python-single-r1_pkg_setup
55 }
56
57 src_configure() {
58         if ! has_version "x11-libs/cairo[glib]"; then
59                 # Bug #391213: enable cairo-gobject support even if it's not installed
60                 # We only PDEPEND on cairo to avoid circular dependencies
61                 export CAIRO_LIBS="-lcairo -lcairo-gobject"
62                 export CAIRO_CFLAGS="-I${EPREFIX}/usr/include/cairo"
63         fi
64
65         # To prevent crosscompiling problems, bug #414105
66         gnome2_src_configure \
67                 --disable-static \
68                 CC="$(tc-getCC)" \
69                 YACC="$(type -p yacc)" \
70                 $(use_with cairo) \
71                 $(use_enable doctool)
72 }
73
74 src_install() {
75         gnome2_src_install
76
77         # Prevent collision with gobject-introspection-common
78         rm -v "${ED}"usr/share/aclocal/introspection.m4 \
79                 "${ED}"usr/share/gobject-introspection-1.0/Makefile.introspection || die
80         rmdir "${ED}"usr/share/aclocal || die
81 }