net-irc/limnoria: use HTTPS for GitHub and HOMEPAGE
[gentoo.git] / eclass / gnome-python-common-r1.eclass
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: gnome-python-common-r1.eclass
5 # @MAINTAINER:
6 # GNOME team <gnome@gentoo.org>
7 # @AUTHOR:
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
12 # @DESCRIPTION:
13 # This eclass provides python-r1 support for the GNOME2 library Python
14 # bindings.
15
16 : ${GNOME_ORG_MODULE:=gnome-python}
17 : ${GNOME_TARBALL_SUFFIX:=bz2}
18 : ${GNOME2_LA_PUNT:=yes}
19 : ${GCONF_DEBUG:=no}
20
21 # @ECLASS-VARIABLE: G_PY_BINDINGS
22 # @DESCRIPTION:
23 # The actual '--enable-<binding>' name. If multiple bindings are to
24 # be enabled, must be an array.
25 : ${G_PY_BINDINGS:=${PN%-python}}
26
27 # @ECLASS-VARIABLE: EXAMPLES
28 # @DEFAULT_UNSET
29 # @DESCRIPTION:
30 # The set of example files to be installed if the 'examples' USE flag
31 # is set.
32
33 case "${EAPI:-0}" in
34         0|1|2|3|4)
35                 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
36                 ;;
37         5)
38                 ;;
39         *)
40                 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
41                 ;;
42 esac
43
44 inherit eutils gnome2 python-r1
45
46 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
47
48 HOMEPAGE="http://pygtk.org/"
49
50 RESTRICT="${RESTRICT} test"
51
52 DOCS="AUTHORS ChangeLog NEWS README"
53
54 if [[ ${GNOME_ORG_MODULE} != "gnome-python" ]]; then
55         DOCS="${DOCS} MAINTAINERS"
56 fi
57
58 RDEPEND="~dev-python/${GNOME_ORG_MODULE}-base-${PV}
59         ${PYTHON_DEPS}"
60 DEPEND="${RDEPEND}
61         virtual/pkgconfig"
62
63 REQUIRED_USE=${PYTHON_REQUIRED_USE}
64
65 gnome-python-common-r1_src_prepare() {
66         gnome2_src_prepare
67
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"
71 #
72 #       python_copy_sources
73 }
74
75 gnome-python-common-r1_src_configure() {
76         local myconf=(
77                 --disable-allbindings
78                 "${G_PY_BINDINGS[@]/#/--enable-}"
79         )
80
81         ECONF_SOURCE=${S} \
82         python_foreach_impl \
83                 gnome2_src_configure "${myconf[@]}" "${@}"
84 }
85
86 gnome-python-common-r1_src_compile() {
87         python_foreach_impl default
88 }
89
90 gnome-python-common-r1_src_test() {
91         python_foreach_impl default
92 }
93
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
97 # example, foo/bar/)
98 gnome-python-common-r1_src_install() {
99         python_foreach_impl gnome2_src_install
100
101         if in_iuse examples && use examples; then
102                 docinto examples
103                 dodoc -r "${EXAMPLES[@]}"
104         fi
105 }