1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: gnome-python-common-r1.eclass
7 # GNOME team <gnome@gentoo.org>
9 # Author: Michał Górny <mgorny@gentoo.org>
10 # Based on the work of: Arun raghaven <ford_prefect@gentoo.org>
11 # which in turn was based on the work of Jim Ramsay <lack@gentoo.org>
12 # @BLURB: Common functionality for building gnome-python* bindings
14 # This eclass provides python-r1 support for the GNOME2 library Python
17 : ${GNOME_ORG_MODULE:=gnome-python}
18 : ${GNOME_TARBALL_SUFFIX:=bz2}
19 : ${GNOME2_LA_PUNT:=yes}
22 # @ECLASS-VARIABLE: G_PY_BINDINGS
24 # The actual '--enable-<binding>' name. If multiple bindings are to
25 # be enabled, must be an array.
26 : ${G_PY_BINDINGS:=${PN%-python}}
28 # @ECLASS-VARIABLE: EXAMPLES
31 # The set of example files to be installed if the 'examples' USE flag
36 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
41 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
45 inherit eutils gnome2 python-r1
47 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
49 HOMEPAGE="http://pygtk.org/"
51 RESTRICT="${RESTRICT} test"
53 DOCS="AUTHORS ChangeLog NEWS README"
55 if [[ ${GNOME_ORG_MODULE} != "gnome-python" ]]; then
56 DOCS="${DOCS} MAINTAINERS"
59 RDEPEND="~dev-python/${GNOME_ORG_MODULE}-base-${PV}
64 REQUIRED_USE=${PYTHON_REQUIRED_USE}
66 gnome-python-common-r1_src_prepare() {
69 # The .pc file is installed by respective gnome-python*-base package
70 sed -i '/^pkgconfig_DATA/d' Makefile.in || die "sed failed"
71 sed -i '/^pkgconfigdir/d' Makefile.in || die "sed failed"
76 gnome-python-common-r1_src_configure() {
79 "${G_PY_BINDINGS[@]/#/--enable-}"
83 python_parallel_foreach_impl \
84 gnome2_src_configure "${myconf[@]}" "${@}"
87 gnome-python-common-r1_src_compile() {
88 python_foreach_impl default
91 gnome-python-common-r1_src_test() {
92 python_foreach_impl default
95 # Do a regular gnome2 src_install and then install examples if required.
96 # Set the variable EXAMPLES to provide the set of examples to be installed.
97 # (to install a directory recursively, specify it with a trailing '/' - for
99 gnome-python-common-r1_src_install() {
100 python_foreach_impl gnome2_src_install
102 if in_iuse examples && use examples; then
104 dodoc -r "${EXAMPLES[@]}"