Merge branch 'xfim-master'
[gentoo.git] / dev-libs / gobject-introspection / gobject-introspection-1.44.0.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 GCONF_DEBUG="no"
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="xml"
9
10 inherit gnome2 python-single-r1 toolchain-funcs versionator
11
12 DESCRIPTION="Introspection infrastructure for generating gobject library bindings for various languages"
13 HOMEPAGE="https://wiki.gnome.org/Projects/GObjectIntrospection"
14
15 LICENSE="LGPL-2+ GPL-2+"
16 SLOT="0"
17 IUSE="cairo doctool test"
18 REQUIRED_USE="
19         ${PYTHON_REQUIRED_USE}
20         test? ( cairo )
21 "
22 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
23
24 # virtual/pkgconfig needed at runtime, bug #505408
25 # We force glib and goi to be in sync by this way as explained in bug #518424
26 RDEPEND="
27         >=dev-libs/gobject-introspection-common-${PV}
28         >=dev-libs/glib-2.$(get_version_component_range 2):2
29         doctool? ( dev-python/mako )
30         virtual/libffi:=
31         virtual/pkgconfig
32         !<dev-lang/vala-0.20.0
33         ${PYTHON_DEPS}
34 "
35 # Wants real bison, not virtual/yacc
36 DEPEND="${RDEPEND}
37         >=dev-util/gtk-doc-am-1.19
38         sys-devel/bison
39         sys-devel/flex
40 "
41 # PDEPEND to avoid circular dependencies, bug #391213
42 PDEPEND="cairo? ( x11-libs/cairo[glib] )"
43
44 pkg_setup() {
45         python-single-r1_pkg_setup
46 }
47
48 src_configure() {
49         if ! has_version "x11-libs/cairo[glib]"; then
50                 # Bug #391213: enable cairo-gobject support even if it's not installed
51                 # We only PDEPEND on cairo to avoid circular dependencies
52                 export CAIRO_LIBS="-lcairo -lcairo-gobject"
53                 export CAIRO_CFLAGS="-I${EPREFIX}/usr/include/cairo"
54         fi
55
56         # To prevent crosscompiling problems, bug #414105
57         gnome2_src_configure \
58                 --disable-static \
59                 CC="$(tc-getCC)" \
60                 YACC="$(type -p yacc)" \
61                 $(use_with cairo) \
62                 $(use_enable doctool)
63 }
64
65 src_install() {
66         DOCS="AUTHORS CONTRIBUTORS ChangeLog NEWS README TODO"
67         gnome2_src_install
68
69         # Prevent collision with gobject-introspection-common
70         rm -v "${ED}"usr/share/aclocal/introspection.m4 \
71                 "${ED}"usr/share/gobject-introspection-1.0/Makefile.introspection || die
72         rmdir "${ED}"usr/share/aclocal || die
73 }