1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: gnome-python-common-r1.eclass
6 # GNOME team <gnome@gentoo.org>
8 # Author: Michał Górny <mgorny@gentoo.org>
9 # Based on the work of: Arun raghaven <ford_prefect@gentoo.org>
10 # which in turn was based on the work of Jim Ramsay <lack@gentoo.org>
11 # @BLURB: Common functionality for building gnome-python* bindings
13 # This eclass provides python-r1 support for the GNOME2 library Python
16 : ${GNOME_ORG_MODULE:=gnome-python}
17 : ${GNOME_TARBALL_SUFFIX:=bz2}
18 : ${GNOME2_LA_PUNT:=yes}
21 # @ECLASS-VARIABLE: G_PY_BINDINGS
23 # The actual '--enable-<binding>' name. If multiple bindings are to
24 # be enabled, must be an array.
25 : ${G_PY_BINDINGS:=${PN%-python}}
27 # @ECLASS-VARIABLE: EXAMPLES
30 # The set of example files to be installed if the 'examples' USE flag
35 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
40 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
44 inherit eutils gnome2 python-r1
46 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
48 HOMEPAGE="http://pygtk.org/"
50 RESTRICT="${RESTRICT} test"
52 DOCS="AUTHORS ChangeLog NEWS README"
54 if [[ ${GNOME_ORG_MODULE} != "gnome-python" ]]; then
55 DOCS="${DOCS} MAINTAINERS"
58 RDEPEND="~dev-python/${GNOME_ORG_MODULE}-base-${PV}
63 REQUIRED_USE=${PYTHON_REQUIRED_USE}
65 gnome-python-common-r1_src_prepare() {
68 # The .pc file is installed by respective gnome-python*-base package
69 sed -i '/^pkgconfig_DATA/d' Makefile.in || die "sed failed"
70 sed -i '/^pkgconfigdir/d' Makefile.in || die "sed failed"
75 gnome-python-common-r1_src_configure() {
78 "${G_PY_BINDINGS[@]/#/--enable-}"
83 gnome2_src_configure "${myconf[@]}" "${@}"
86 gnome-python-common-r1_src_compile() {
87 python_foreach_impl default
90 gnome-python-common-r1_src_test() {
91 python_foreach_impl default
94 # Do a regular gnome2 src_install and then install examples if required.
95 # Set the variable EXAMPLES to provide the set of examples to be installed.
96 # (to install a directory recursively, specify it with a trailing '/' - for
98 gnome-python-common-r1_src_install() {
99 python_foreach_impl gnome2_src_install
101 if in_iuse examples && use examples; then
103 dodoc -r "${EXAMPLES[@]}"