/[gentoo-x86]/eclass/gnome-python-common.eclass
Gentoo

Diff of /eclass/gnome-python-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.9 Revision 1.10
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/Attic/gnome-python-common.eclass,v 1.9 2010/02/09 10:06:36 grobian Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/gnome-python-common.eclass,v 1.10 2010/05/31 21:01:47 eva Exp $
4 4
5# Original Author: Arun Raghavan <ford_prefect@gentoo.org> (based on the 5# Original Author: Arun Raghavan <ford_prefect@gentoo.org> (based on the
6# gnome-python-desktop eclass by Jim Ramsay <lack@gentoo.org>) 6# gnome-python-desktop eclass by Jim Ramsay <lack@gentoo.org>)
7# 7#
8# Purpose: Provides common functionality required for building the gnome-python* 8# Purpose: Provides common functionality required for building the gnome-python*
23# dev-python/<original-${PN}-for-which-this-is-the-binding>-python 23# dev-python/<original-${PN}-for-which-this-is-the-binding>-python
24# 24#
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
28inherit versionator python autotools gnome2 28SUPPORT_PYTHON_ABIS="1"
29PYTHON_DEPEND="2"
30RESTRICT_PYTHON_ABIS="3.*"
31
32inherit autotools gnome2 python versionator
33
34case "${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 ;;
41esac
29 42
30G_PY_PN=${G_PY_PN:-gnome-python} 43G_PY_PN=${G_PY_PN:-gnome-python}
31G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}} 44G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}}
32 45
33PVP="$(get_version_component_range 1-2)" 46PVP="$(get_version_component_range 1-2)"
54DEPEND="${RDEPEND} 67DEPEND="${RDEPEND}
55 dev-util/pkgconfig" 68 dev-util/pkgconfig"
56 69
57# Enable the required bindings as specified by the G_PY_BINDINGS variable 70# Enable the required bindings as specified by the G_PY_BINDINGS variable
58gnome-python-common_pkg_setup() { 71gnome-python-common_pkg_setup() {
72 python_pkg_setup
73
59 G2CONF="${G2CONF} --disable-allbindings" 74 G2CONF="${G2CONF} --disable-allbindings"
60 for binding in ${G_PY_BINDINGS}; do 75 for binding in ${G_PY_BINDINGS}; do
61 G2CONF="${G2CONF} --enable-${binding}" 76 G2CONF="${G2CONF} --enable-${binding}"
62 done 77 done
63} 78}
64 79
65gnome-python-common_src_unpack() { 80gnome-python-common_src_unpack() {
66 gnome2_src_unpack 81 gnome2_src_unpack
67 82
83 has ${EAPI:-0} 0 1 && gnome-python-common_src_prepare
84}
85
86gnome-python-common_src_prepare() {
87 gnome2_src_prepare
88
68 # disable pyc compiling 89 # disable pyc compiling
69 if [[ -f py-compile ]]; then 90 if [[ -f py-compile ]]; then
70 rm py-compile 91 rm py-compile
71 ln -s $(type -P true) py-compile 92 ln -s $(type -P true) py-compile
72 fi 93 fi
94
95 # The .pc file is installed by respective gnome-python*-base package
96 sed -i '/^pkgconfig_DATA/d' Makefile.in || die "sed failed"
97 sed -i '/^pkgconfigdir/d' Makefile.in || die "sed failed"
98
99 python_copy_sources
100}
101
102gnome-python-common_src_configure() {
103 python_execute_function -s gnome2_src_configure "$@"
104}
105
106gnome-python-common_src_compile() {
107 has ${EAPI:-0} 0 1 && gnome-python-common_src_configure "$@"
108 python_src_compile "$@"
109}
110
111gnome-python-common_src_test() {
112 python_src_test "$@"
73} 113}
74 114
75# Do a regular gnome2 src_install and then install examples if required. 115# 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. 116# 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 117# (to install a directory recursively, specify it with a trailing '/' - for
78# example, foo/bar/) 118# example, foo/bar/)
79gnome-python-common_src_install() { 119gnome-python-common_src_install() {
80 # The .pc file is installed by respective gnome-python*-base package 120 python_execute_function -s gnome2_src_install "$@"
81 sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed" 121 python_clean_installation_image
82 sed -i '/^pkgconfigdir/d' Makefile || die "sed failed"
83
84 gnome2_src_install
85 122
86 if hasq examples ${IUSE} && use examples; then 123 if hasq examples ${IUSE} && use examples; then
87 insinto /usr/share/doc/${PF}/examples 124 insinto /usr/share/doc/${PF}/examples
88 125
89 for example in ${EXAMPLES}; do 126 for example in ${EXAMPLES}; do
92 else 129 else
93 doins ${example} 130 doins ${example}
94 fi 131 fi
95 done 132 done
96 fi 133 fi
97
98 # Python does not need these, bug #299243
99 find "${D%/}${EPREFIX}$(python_get_sitedir)" -name "*.la" -delete \
100 || die "failed to remove la files"
101
102} 134}
103 135
104gnome-python-common_pkg_postinst() { 136gnome-python-common_pkg_postinst() {
105 python_version 137 python_mod_optimize gtk-2.0
106 python_need_rebuild
107 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0
108} 138}
109 139
110gnome-python-common_pkg_postrm() { 140gnome-python-common_pkg_postrm() {
111 python_mod_cleanup 141 python_mod_cleanup gtk-2.0
112} 142}
113
114EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20