Lines 1-4
Link Here
|
1 |
# Copyright 1999-2008 Gentoo Foundation |
1 |
# Copyright 1999-2010 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
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.9 2010/02/09 10:06:36 grobian Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.9 2010/02/09 10:06:36 grobian Exp $ |
4 |
|
4 |
|
Lines 25-31
Link Here
|
25 |
# So, for example, with the bonobo bindings, the original package is libbonobo |
25 |
# So, for example, with the bonobo bindings, the original package is libbonobo |
26 |
# and the packages is named dev-python/libbonobo-python |
26 |
# and the packages is named dev-python/libbonobo-python |
27 |
|
27 |
|
28 |
inherit versionator python autotools gnome2 |
28 |
inherit autotools gnome2 python versionator |
29 |
|
29 |
|
30 |
G_PY_PN=${G_PY_PN:-gnome-python} |
30 |
G_PY_PN=${G_PY_PN:-gnome-python} |
31 |
G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}} |
31 |
G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}} |
Lines 56-75
Link Here
|
56 |
|
56 |
|
57 |
# Enable the required bindings as specified by the G_PY_BINDINGS variable |
57 |
# Enable the required bindings as specified by the G_PY_BINDINGS variable |
58 |
gnome-python-common_pkg_setup() { |
58 |
gnome-python-common_pkg_setup() { |
59 |
G2CONF="${G2CONF} --disable-allbindings" |
59 |
G2CONF+=" --disable-allbindings" |
60 |
for binding in ${G_PY_BINDINGS}; do |
60 |
for binding in ${G_PY_BINDINGS}; do |
61 |
G2CONF="${G2CONF} --enable-${binding}" |
61 |
G2CONF+=" --enable-${binding}" |
62 |
done |
62 |
done |
63 |
} |
63 |
} |
64 |
|
64 |
|
65 |
gnome-python-common_src_unpack() { |
65 |
gnome-python-common_src_unpack() { |
|
|
66 |
if ! has "${EAPI:-0}" 0 1 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
67 |
die "${FUNCNAME}() cannot be used in this EAPI" |
68 |
fi |
69 |
|
66 |
gnome2_src_unpack |
70 |
gnome2_src_unpack |
|
|
71 |
has "${EAPI:-0}" 0 1 && gnome-python-common_src_prepare |
72 |
} |
73 |
|
74 |
# gnome-python-common_src_prepare() must be called at the end of src_prepare(). |
75 |
gnome-python-common_src_prepare() { |
76 |
gnome2_src_prepare |
67 |
|
77 |
|
68 |
# disable pyc compiling |
78 |
# disable pyc compiling |
69 |
if [[ -f py-compile ]]; then |
79 |
if [[ -f py-compile ]]; then |
70 |
rm py-compile |
80 |
rm py-compile |
71 |
ln -s $(type -P true) py-compile |
81 |
ln -s $(type -P true) py-compile |
72 |
fi |
82 |
fi |
|
|
83 |
|
84 |
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
85 |
python_copy_sources |
86 |
fi |
87 |
} |
88 |
|
89 |
gnome-python-common_src_configure() { |
90 |
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
91 |
python_execute_function -s gnome2_src_configure |
92 |
else |
93 |
gnome2_src_configure |
94 |
fi |
95 |
} |
96 |
|
97 |
gnome-python-common_src_compile() { |
98 |
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
99 |
python_src_compile |
100 |
else |
101 |
default |
102 |
fi |
73 |
} |
103 |
} |
74 |
|
104 |
|
75 |
# Do a regular gnome2 src_install and then install examples if required. |
105 |
# Do a regular gnome2 src_install and then install examples if required. |
Lines 77-87
Link Here
|
77 |
# (to install a directory recursively, specify it with a trailing '/' - for |
107 |
# (to install a directory recursively, specify it with a trailing '/' - for |
78 |
# example, foo/bar/) |
108 |
# example, foo/bar/) |
79 |
gnome-python-common_src_install() { |
109 |
gnome-python-common_src_install() { |
80 |
# The .pc file is installed by respective gnome-python*-base package |
110 |
gnome-python-common_installation() { |
81 |
sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed" |
111 |
# The .pc file is installed by respective gnome-python*-base package |
82 |
sed -i '/^pkgconfigdir/d' Makefile || die "sed failed" |
112 |
sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed" |
83 |
|
113 |
sed -i '/^pkgconfigdir/d' Makefile || die "sed failed" |
84 |
gnome2_src_install |
114 |
|
|
|
115 |
gnome2_src_install |
116 |
} |
117 |
|
118 |
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
119 |
python_execute_function -s gnome-python-common_installation |
120 |
else |
121 |
gnome-python-common_installation |
122 |
fi |
85 |
|
123 |
|
86 |
if hasq examples ${IUSE} && use examples; then |
124 |
if hasq examples ${IUSE} && use examples; then |
87 |
insinto /usr/share/doc/${PF}/examples |
125 |
insinto /usr/share/doc/${PF}/examples |
Lines 95-114
Link Here
|
95 |
done |
133 |
done |
96 |
fi |
134 |
fi |
97 |
|
135 |
|
98 |
# Python does not need these, bug #299243 |
136 |
python_clean_sitedirs |
99 |
find "${D%/}${EPREFIX}$(python_get_sitedir)" -name "*.la" -delete \ |
|
|
100 |
|| die "failed to remove la files" |
101 |
|
102 |
} |
137 |
} |
103 |
|
138 |
|
104 |
gnome-python-common_pkg_postinst() { |
139 |
gnome-python-common_pkg_postinst() { |
105 |
python_version |
140 |
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
106 |
python_need_rebuild |
141 |
python_mod_optimize gtk-2.0 |
107 |
python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0 |
142 |
else |
|
|
143 |
python_need_rebuild |
144 |
python_mod_optimize $(python_get_sitedir)/gtk-2.0 |
145 |
fi |
108 |
} |
146 |
} |
109 |
|
147 |
|
110 |
gnome-python-common_pkg_postrm() { |
148 |
gnome-python-common_pkg_postrm() { |
111 |
python_mod_cleanup |
149 |
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
|
|
150 |
python_mod_cleanup gtk-2.0 |
151 |
else |
152 |
python_mod_cleanup $(python_get_sitedir)/gtk-2.0 |
153 |
fi |
112 |
} |
154 |
} |
113 |
|
155 |
|
114 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm |
156 |
case "${EAPI:-0}" in |
|
|
157 |
0|1) |
158 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm |
159 |
;; |
160 |
*) |
161 |
EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst pkg_postrm |
162 |
;; |
163 |
esac |