/[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.14 - (hide annotations) (download)
Tue Jan 3 12:18:17 2012 UTC (8 years, 11 months ago) by nirbheek
Branch: MAIN
Changes since 1.13: +4 -3 lines
New automake uses $(SHELL) py-compile, which fails if py-compile is a symlink to /bin/true. Make it an executable empty file instead.

1 nirbheek 1.14 # Copyright 1999-2012 Gentoo Foundation
2 ford_prefect 1.1 # Distributed under the terms of the GNU General Public License v2
3 nirbheek 1.14 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.13 2011/12/27 17:55:12 fauli 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 eva 1.10 SUPPORT_PYTHON_ABIS="1"
29     PYTHON_DEPEND="2"
30     RESTRICT_PYTHON_ABIS="3.*"
31    
32     inherit autotools gnome2 python versionator
33    
34     case "${EAPI:-0}" in
35     0|1)
36     EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm
37     ;;
38     *)
39     EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst pkg_postrm
40     ;;
41     esac
42 ford_prefect 1.1
43     G_PY_PN=${G_PY_PN:-gnome-python}
44     G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}}
45    
46     PVP="$(get_version_component_range 1-2)"
47     SRC_URI="mirror://gnome/sources/${G_PY_PN}/${PVP}/${G_PY_PN}-${PV}.tar.bz2"
48     HOMEPAGE="http://pygtk.org/"
49    
50     RESTRICT="${RESTRICT} test"
51    
52 eva 1.6 GCONF_DEBUG="no"
53 ford_prefect 1.1 DOCS="AUTHORS ChangeLog NEWS README"
54 eva 1.6
55 ford_prefect 1.1 if [[ ${G_PY_PN} != "gnome-python" ]]; then
56     DOCS="${DOCS} MAINTAINERS"
57     fi
58    
59     S="${WORKDIR}/${G_PY_PN}-${PV}"
60    
61 remi 1.4 # add blockers, we can probably remove them later on
62 remi 1.5 if [[ ${G_PY_PN} == "gnome-python-extras" ]]; then
63 remi 1.4 RDEPEND="!<=dev-python/gnome-python-extras-2.19.1-r2"
64     fi
65    
66     RDEPEND="${RDEPEND} ~dev-python/${G_PY_PN}-base-${PV}"
67 ford_prefect 1.1 DEPEND="${RDEPEND}
68     dev-util/pkgconfig"
69    
70     # Enable the required bindings as specified by the G_PY_BINDINGS variable
71     gnome-python-common_pkg_setup() {
72 eva 1.10 python_pkg_setup
73    
74 ford_prefect 1.1 G2CONF="${G2CONF} --disable-allbindings"
75     for binding in ${G_PY_BINDINGS}; do
76     G2CONF="${G2CONF} --enable-${binding}"
77     done
78     }
79    
80     gnome-python-common_src_unpack() {
81 ford_prefect 1.2 gnome2_src_unpack
82 ford_prefect 1.1
83 eva 1.10 has ${EAPI:-0} 0 1 && gnome-python-common_src_prepare
84     }
85    
86     gnome-python-common_src_prepare() {
87     gnome2_src_prepare
88    
89 ford_prefect 1.1 # disable pyc compiling
90     if [[ -f py-compile ]]; then
91     rm py-compile
92 nirbheek 1.14 echo > py-compile
93     chmod +x py-compile
94 ford_prefect 1.1 fi
95 eva 1.10
96     # The .pc file is installed by respective gnome-python*-base package
97     sed -i '/^pkgconfig_DATA/d' Makefile.in || die "sed failed"
98     sed -i '/^pkgconfigdir/d' Makefile.in || die "sed failed"
99    
100     python_copy_sources
101     }
102    
103     gnome-python-common_src_configure() {
104     python_execute_function -s gnome2_src_configure "$@"
105     }
106    
107     gnome-python-common_src_compile() {
108 pacho 1.11 if has ${EAPI:-0} 0 1; then
109     gnome-python-common_src_configure "$@"
110     building() {
111     emake "$@"
112     }
113     python_execute_function -s building "$@"
114     else
115     python_src_compile "$@"
116     fi
117 eva 1.10 }
118    
119     gnome-python-common_src_test() {
120 pacho 1.11 if has ${EAPI:-0} 0 1; then
121     testing() {
122     if emake -j1 -n check &> /dev/null; then
123     emake -j1 check "$@"
124     elif emake -j1 -n test &> /dev/null; then
125     emake -j1 test "$@"
126     fi
127     }
128     python_execute_function -s testing "$@"
129     else
130     python_src_test "$@"
131     fi
132 ford_prefect 1.1 }
133    
134     # Do a regular gnome2 src_install and then install examples if required.
135     # Set the variable EXAMPLES to provide the set of examples to be installed.
136     # (to install a directory recursively, specify it with a trailing '/' - for
137     # example, foo/bar/)
138     gnome-python-common_src_install() {
139 eva 1.10 python_execute_function -s gnome2_src_install "$@"
140     python_clean_installation_image
141 ford_prefect 1.1
142 ssuominen 1.12 if has examples ${IUSE} && use examples; then
143 ford_prefect 1.1 insinto /usr/share/doc/${PF}/examples
144    
145     for example in ${EXAMPLES}; do
146     if [[ ${example: -1} = "/" ]]; then
147     doins -r ${example}
148     else
149     doins ${example}
150     fi
151     done
152     fi
153     }
154    
155     gnome-python-common_pkg_postinst() {
156 eva 1.10 python_mod_optimize gtk-2.0
157 ford_prefect 1.1 }
158    
159     gnome-python-common_pkg_postrm() {
160 eva 1.10 python_mod_cleanup gtk-2.0
161 ford_prefect 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20