1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
9 inherit autotools eutils gnome2 python-r1 virtualx
11 DESCRIPTION="GLib's GObject library bindings for Python"
12 HOMEPAGE="http://www.pygtk.org/"
16 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 ~x64-solaris ~x86-solaris"
17 IUSE="examples libffi test"
18 RESTRICT="!test? ( test )"
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
21 COMMON_DEPEND=">=dev-libs/glib-2.24.0:2
22 dev-lang/python-exec:2
23 libffi? ( virtual/libffi:= )
26 DEPEND="${COMMON_DEPEND}
30 media-fonts/font-cursor-misc
31 media-fonts/font-misc-misc )
33 RDEPEND="${COMMON_DEPEND}
34 !<dev-python/pygtk-2.23"
37 # Fix FHS compliance, see upstream bug #535524
38 epatch "${FILESDIR}/${PN}-2.28.3-fix-codegen-location.patch"
40 # Do not build tests if unneeded, bug #226345
41 epatch "${FILESDIR}/${PN}-2.28.3-make_check.patch"
43 # Support installation for multiple Python versions, upstream bug #648292
44 epatch "${FILESDIR}/${PN}-2.28.3-support_multiple_python_versions.patch"
46 # Disable tests that fail
47 epatch "${FILESDIR}/${P}-disable-failing-tests.patch"
49 # Disable introspection tests when we build with --disable-introspection
50 epatch "${FILESDIR}/${P}-tests-no-introspection.patch"
53 epatch "${FILESDIR}/${P}-set_qdata.patch"
54 epatch "${FILESDIR}/${P}-gio-types-2.32.patch"
56 # Fix glib-2.36 compatibility, bug #486602
57 epatch "${FILESDIR}/${P}-glib-2.36-class_init.patch"
60 -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
61 -e 's:AM_PROG_CC_STDC:AC_PROG_CC:' \
70 # Make a backup with unconverted shebangs to keep python_doscript happy
71 cp codegen/codegen.py pygobject-codegen-2.0
72 sed -e "s%#! \?/usr/bin/env python%#!${PYTHON}%" \
73 -i codegen/*.py || die "shebang convertion failed"
75 python_foreach_impl run_in_build_dir prepare_shebangs
79 DOCS="AUTHORS ChangeLog* NEWS README"
80 # --disable-introspection and --disable-cairo because we use pygobject:3
81 # for introspection support
83 --disable-introspection
85 $(use_with libffi ffi)"
87 python_foreach_impl run_in_build_dir gnome2_src_configure
91 python_foreach_impl run_in_build_dir gnome2_src_compile
94 # FIXME: With python multiple ABI support, tests return 1 even when they pass
96 unset DBUS_SESSION_BUS_ADDRESS
97 export GIO_USE_VFS="local" # prevents odd issues with deleting ${T}/.gvfs
100 export XDG_CACHE_HOME="${T}/${EPYTHON}"
101 run_in_build_dir Xemake -j1 check
104 python_foreach_impl testing
110 local f prefixed_sitedir
114 python_doscript pygobject-codegen-2.0
116 # Don't keep multiple copies of pygobject-codegen-2.0 script
117 prefixed_sitedir=$(python_get_sitedir)
118 dosym "${prefixed_sitedir#${EPREFIX}}/gtk-2.0/codegen/codegen.py" "/usr/lib/python-exec/${EPYTHON}/pygobject-codegen-2.0"
120 python_foreach_impl run_in_build_dir installing
122 if use examples; then
123 insinto /usr/share/doc/${PF}
129 pushd "${BUILD_DIR}" > /dev/null || die