1 |
eva 10/05/31 21:01:47 |
2 |
|
3 |
Modified: gnome-python-common.eclass |
4 |
Log: |
5 |
Support for multiple python ABIs, bug #309039. |
6 |
|
7 |
Revision Changes Path |
8 |
1.10 eclass/gnome-python-common.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/gnome-python-common.eclass?rev=1.10&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/gnome-python-common.eclass?rev=1.10&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/gnome-python-common.eclass?r1=1.9&r2=1.10 |
13 |
|
14 |
Index: gnome-python-common.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v |
17 |
retrieving revision 1.9 |
18 |
retrieving revision 1.10 |
19 |
diff -u -r1.9 -r1.10 |
20 |
--- gnome-python-common.eclass 9 Feb 2010 10:06:36 -0000 1.9 |
21 |
+++ gnome-python-common.eclass 31 May 2010 21:01:47 -0000 1.10 |
22 |
@@ -1,6 +1,6 @@ |
23 |
-# Copyright 1999-2008 Gentoo Foundation |
24 |
+# Copyright 1999-2010 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.9 2010/02/09 10:06:36 grobian Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.10 2010/05/31 21:01:47 eva Exp $ |
28 |
|
29 |
# Original Author: Arun Raghavan <ford_prefect@g.o> (based on the |
30 |
# gnome-python-desktop eclass by Jim Ramsay <lack@g.o>) |
31 |
@@ -25,7 +25,20 @@ |
32 |
# So, for example, with the bonobo bindings, the original package is libbonobo |
33 |
# and the packages is named dev-python/libbonobo-python |
34 |
|
35 |
-inherit versionator python autotools gnome2 |
36 |
+SUPPORT_PYTHON_ABIS="1" |
37 |
+PYTHON_DEPEND="2" |
38 |
+RESTRICT_PYTHON_ABIS="3.*" |
39 |
+ |
40 |
+inherit autotools gnome2 python versionator |
41 |
+ |
42 |
+case "${EAPI:-0}" in |
43 |
+ 0|1) |
44 |
+ EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm |
45 |
+ ;; |
46 |
+ *) |
47 |
+ EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst pkg_postrm |
48 |
+ ;; |
49 |
+esac |
50 |
|
51 |
G_PY_PN=${G_PY_PN:-gnome-python} |
52 |
G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}} |
53 |
@@ -56,6 +69,8 @@ |
54 |
|
55 |
# Enable the required bindings as specified by the G_PY_BINDINGS variable |
56 |
gnome-python-common_pkg_setup() { |
57 |
+ python_pkg_setup |
58 |
+ |
59 |
G2CONF="${G2CONF} --disable-allbindings" |
60 |
for binding in ${G_PY_BINDINGS}; do |
61 |
G2CONF="${G2CONF} --enable-${binding}" |
62 |
@@ -65,11 +80,36 @@ |
63 |
gnome-python-common_src_unpack() { |
64 |
gnome2_src_unpack |
65 |
|
66 |
+ has ${EAPI:-0} 0 1 && gnome-python-common_src_prepare |
67 |
+} |
68 |
+ |
69 |
+gnome-python-common_src_prepare() { |
70 |
+ gnome2_src_prepare |
71 |
+ |
72 |
# disable pyc compiling |
73 |
if [[ -f py-compile ]]; then |
74 |
rm py-compile |
75 |
ln -s $(type -P true) py-compile |
76 |
fi |
77 |
+ |
78 |
+ # The .pc file is installed by respective gnome-python*-base package |
79 |
+ sed -i '/^pkgconfig_DATA/d' Makefile.in || die "sed failed" |
80 |
+ sed -i '/^pkgconfigdir/d' Makefile.in || die "sed failed" |
81 |
+ |
82 |
+ python_copy_sources |
83 |
+} |
84 |
+ |
85 |
+gnome-python-common_src_configure() { |
86 |
+ python_execute_function -s gnome2_src_configure "$@" |
87 |
+} |
88 |
+ |
89 |
+gnome-python-common_src_compile() { |
90 |
+ has ${EAPI:-0} 0 1 && gnome-python-common_src_configure "$@" |
91 |
+ python_src_compile "$@" |
92 |
+} |
93 |
+ |
94 |
+gnome-python-common_src_test() { |
95 |
+ python_src_test "$@" |
96 |
} |
97 |
|
98 |
# Do a regular gnome2 src_install and then install examples if required. |
99 |
@@ -77,11 +117,8 @@ |
100 |
# (to install a directory recursively, specify it with a trailing '/' - for |
101 |
# example, foo/bar/) |
102 |
gnome-python-common_src_install() { |
103 |
- # The .pc file is installed by respective gnome-python*-base package |
104 |
- sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed" |
105 |
- sed -i '/^pkgconfigdir/d' Makefile || die "sed failed" |
106 |
- |
107 |
- gnome2_src_install |
108 |
+ python_execute_function -s gnome2_src_install "$@" |
109 |
+ python_clean_installation_image |
110 |
|
111 |
if hasq examples ${IUSE} && use examples; then |
112 |
insinto /usr/share/doc/${PF}/examples |
113 |
@@ -94,21 +131,12 @@ |
114 |
fi |
115 |
done |
116 |
fi |
117 |
- |
118 |
- # Python does not need these, bug #299243 |
119 |
- find "${D%/}${EPREFIX}$(python_get_sitedir)" -name "*.la" -delete \ |
120 |
- || die "failed to remove la files" |
121 |
- |
122 |
} |
123 |
|
124 |
gnome-python-common_pkg_postinst() { |
125 |
- python_version |
126 |
- python_need_rebuild |
127 |
- python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0 |
128 |
+ python_mod_optimize gtk-2.0 |
129 |
} |
130 |
|
131 |
gnome-python-common_pkg_postrm() { |
132 |
- python_mod_cleanup |
133 |
+ python_mod_cleanup gtk-2.0 |
134 |
} |
135 |
- |
136 |
-EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm |