/[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.9 - (hide annotations) (download)
Tue Feb 9 10:06:36 2010 UTC (9 years, 9 months ago) by grobian
Branch: MAIN
Changes since 1.8: +2 -2 lines
Make gnome-python-common.eclass Prefix aware, bug #303707

1 ford_prefect 1.1 # Copyright 1999-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 grobian 1.9 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.8 2010/01/29 00:30:13 eva Exp $
4 ford_prefect 1.1
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 jer 1.3 # Purpose: Provides common functionality required for building the gnome-python*
9 ford_prefect 1.1 # 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 maekke 1.7 inherit versionator python autotools gnome2
29 ford_prefect 1.1
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 eva 1.6 GCONF_DEBUG="no"
40 ford_prefect 1.1 DOCS="AUTHORS ChangeLog NEWS README"
41 eva 1.6
42 ford_prefect 1.1 if [[ ${G_PY_PN} != "gnome-python" ]]; then
43     DOCS="${DOCS} MAINTAINERS"
44     fi
45    
46     S="${WORKDIR}/${G_PY_PN}-${PV}"
47    
48 remi 1.4 # add blockers, we can probably remove them later on
49 remi 1.5 if [[ ${G_PY_PN} == "gnome-python-extras" ]]; then
50 remi 1.4 RDEPEND="!<=dev-python/gnome-python-extras-2.19.1-r2"
51     fi
52    
53     RDEPEND="${RDEPEND} ~dev-python/${G_PY_PN}-base-${PV}"
54 ford_prefect 1.1 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 ford_prefect 1.2 gnome2_src_unpack
67 ford_prefect 1.1
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 eva 1.8
98     # Python does not need these, bug #299243
99 grobian 1.9 find "${D%/}${EPREFIX}$(python_get_sitedir)" -name "*.la" -delete \
100 eva 1.8 || die "failed to remove la files"
101    
102 ford_prefect 1.1 }
103    
104     gnome-python-common_pkg_postinst() {
105     python_version
106 eva 1.6 python_need_rebuild
107 ford_prefect 1.1 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
108     }
109    
110     gnome-python-common_pkg_postrm() {
111     python_mod_cleanup
112     }
113    
114     EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20