/[gentoo-x86]/eclass/gnome-python-common.eclass
Gentoo

Contents of /eclass/gnome-python-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Mon Dec 1 14:29:06 2008 UTC (12 years ago) by eva
Branch: MAIN
Changes since 1.5: +4 -1 lines
Add python_need_rebuild and GCONF_DEBUG call to the gnome-python-common eclass

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.5 2008/10/25 13:27:18 remi Exp $
4
5 # Original Author: Arun Raghavan <ford_prefect@gentoo.org> (based on the
6 # gnome-python-desktop eclass by Jim Ramsay <lack@gentoo.org>)
7 #
8 # Purpose: Provides common functionality required for building the gnome-python*
9 # bindings
10 #
11 # Important environment variables:
12 #
13 # G_PY_PN: Which gnome-python* package bindings we're working with. Defaults to
14 # gnome-python if unset.
15 #
16 # G_PY_BINDINGS: The actual '--enable-<binding>' name, which by default is ${PN}
17 # excluding the -python at the end. May be overridden if necessary.
18 #
19 # EXAMPLES: The set of example files to be installed if the 'examples' USE flag
20 # is set.
21 #
22 # The naming convention for all bindings is as follows:
23 # dev-python/<original-${PN}-for-which-this-is-the-binding>-python
24 #
25 # So, for example, with the bonobo bindings, the original package is libbonobo
26 # and the packages is named dev-python/libbonobo-python
27
28 inherit versionator python autotools gnome2
29
30 G_PY_PN=${G_PY_PN:-gnome-python}
31 G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}}
32
33 PVP="$(get_version_component_range 1-2)"
34 SRC_URI="mirror://gnome/sources/${G_PY_PN}/${PVP}/${G_PY_PN}-${PV}.tar.bz2"
35 HOMEPAGE="http://pygtk.org/"
36
37 RESTRICT="${RESTRICT} test"
38
39 GCONF_DEBUG="no"
40 DOCS="AUTHORS ChangeLog NEWS README"
41
42 if [[ ${G_PY_PN} != "gnome-python" ]]; then
43 DOCS="${DOCS} MAINTAINERS"
44 fi
45
46 S="${WORKDIR}/${G_PY_PN}-${PV}"
47
48 # add blockers, we can probably remove them later on
49 if [[ ${G_PY_PN} == "gnome-python-extras" ]]; then
50 RDEPEND="!<=dev-python/gnome-python-extras-2.19.1-r2"
51 fi
52
53 RDEPEND="${RDEPEND} ~dev-python/${G_PY_PN}-base-${PV}"
54 DEPEND="${RDEPEND}
55 dev-util/pkgconfig"
56
57 # Enable the required bindings as specified by the G_PY_BINDINGS variable
58 gnome-python-common_pkg_setup() {
59 G2CONF="${G2CONF} --disable-allbindings"
60 for binding in ${G_PY_BINDINGS}; do
61 G2CONF="${G2CONF} --enable-${binding}"
62 done
63 }
64
65 gnome-python-common_src_unpack() {
66 gnome2_src_unpack
67
68 # disable pyc compiling
69 if [[ -f py-compile ]]; then
70 rm py-compile
71 ln -s $(type -P true) py-compile
72 fi
73 }
74
75 # Do a regular gnome2 src_install and then install examples if required.
76 # Set the variable EXAMPLES to provide the set of examples to be installed.
77 # (to install a directory recursively, specify it with a trailing '/' - for
78 # example, foo/bar/)
79 gnome-python-common_src_install() {
80 # The .pc file is installed by respective gnome-python*-base package
81 sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed"
82 sed -i '/^pkgconfigdir/d' Makefile || die "sed failed"
83
84 gnome2_src_install
85
86 if hasq examples ${IUSE} && use examples; then
87 insinto /usr/share/doc/${PF}/examples
88
89 for example in ${EXAMPLES}; do
90 if [[ ${example: -1} = "/" ]]; then
91 doins -r ${example}
92 else
93 doins ${example}
94 fi
95 done
96 fi
97 }
98
99 gnome-python-common_pkg_postinst() {
100 python_version
101 python_need_rebuild
102 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
103 }
104
105 gnome-python-common_pkg_postrm() {
106 python_mod_cleanup
107 }
108
109 EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20