/[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.5 - (show annotations) (download)
Sat Oct 25 13:27:18 2008 UTC (12 years, 1 month ago) by remi
Branch: MAIN
Changes since 1.4: +2 -2 lines
add blockers to the gnome-python-common eclass, try again...

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.4 2008/10/25 11:10:54 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 DOCS="AUTHORS ChangeLog NEWS README"
40 if [[ ${G_PY_PN} != "gnome-python" ]]; then
41 DOCS="${DOCS} MAINTAINERS"
42 fi
43
44 S="${WORKDIR}/${G_PY_PN}-${PV}"
45
46 # add blockers, we can probably remove them later on
47 if [[ ${G_PY_PN} == "gnome-python-extras" ]]; then
48 RDEPEND="!<=dev-python/gnome-python-extras-2.19.1-r2"
49 fi
50
51 RDEPEND="${RDEPEND} ~dev-python/${G_PY_PN}-base-${PV}"
52 DEPEND="${RDEPEND}
53 dev-util/pkgconfig"
54
55 # Enable the required bindings as specified by the G_PY_BINDINGS variable
56 gnome-python-common_pkg_setup() {
57 G2CONF="${G2CONF} --disable-allbindings"
58 for binding in ${G_PY_BINDINGS}; do
59 G2CONF="${G2CONF} --enable-${binding}"
60 done
61 }
62
63 gnome-python-common_src_unpack() {
64 gnome2_src_unpack
65
66 # disable pyc compiling
67 if [[ -f py-compile ]]; then
68 rm py-compile
69 ln -s $(type -P true) py-compile
70 fi
71 }
72
73 # Do a regular gnome2 src_install and then install examples if required.
74 # Set the variable EXAMPLES to provide the set of examples to be installed.
75 # (to install a directory recursively, specify it with a trailing '/' - for
76 # example, foo/bar/)
77 gnome-python-common_src_install() {
78 # The .pc file is installed by respective gnome-python*-base package
79 sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed"
80 sed -i '/^pkgconfigdir/d' Makefile || die "sed failed"
81
82 gnome2_src_install
83
84 if hasq examples ${IUSE} && use examples; then
85 insinto /usr/share/doc/${PF}/examples
86
87 for example in ${EXAMPLES}; do
88 if [[ ${example: -1} = "/" ]]; then
89 doins -r ${example}
90 else
91 doins ${example}
92 fi
93 done
94 fi
95 }
96
97 gnome-python-common_pkg_postinst() {
98 python_version
99 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
100 }
101
102 gnome-python-common_pkg_postrm() {
103 python_mod_cleanup
104 }
105
106 EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20