diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2010-05-31 21:01:47 +0000 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2010-05-31 21:01:47 +0000 |
commit | 8997a5b6bc41ec1395011f4363524dc086f7ced4 (patch) | |
tree | 4ec078cb1a88c8f0d1dab4694fce96ca7df6066b /eclass | |
parent | Clean up old revisions. (diff) | |
download | gentoo-2-8997a5b6bc41ec1395011f4363524dc086f7ced4.tar.gz gentoo-2-8997a5b6bc41ec1395011f4363524dc086f7ced4.tar.bz2 gentoo-2-8997a5b6bc41ec1395011f4363524dc086f7ced4.zip |
Support for multiple python ABIs, bug #309039.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/gnome-python-common.eclass | 66 |
1 files changed, 47 insertions, 19 deletions
diff --git a/eclass/gnome-python-common.eclass b/eclass/gnome-python-common.eclass index e45082bdb469..0a2b5370e49b 100644 --- a/eclass/gnome-python-common.eclass +++ b/eclass/gnome-python-common.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2008 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.9 2010/02/09 10:06:36 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gnome-python-common.eclass,v 1.10 2010/05/31 21:01:47 eva Exp $ # Original Author: Arun Raghavan <ford_prefect@gentoo.org> (based on the # gnome-python-desktop eclass by Jim Ramsay <lack@gentoo.org>) @@ -25,7 +25,20 @@ # So, for example, with the bonobo bindings, the original package is libbonobo # and the packages is named dev-python/libbonobo-python -inherit versionator python autotools gnome2 +SUPPORT_PYTHON_ABIS="1" +PYTHON_DEPEND="2" +RESTRICT_PYTHON_ABIS="3.*" + +inherit autotools gnome2 python versionator + +case "${EAPI:-0}" in + 0|1) + EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm + ;; + *) + EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst pkg_postrm + ;; +esac G_PY_PN=${G_PY_PN:-gnome-python} G_PY_BINDINGS=${G_PY_BINDINGS:-${PN%-python}} @@ -56,6 +69,8 @@ DEPEND="${RDEPEND} # Enable the required bindings as specified by the G_PY_BINDINGS variable gnome-python-common_pkg_setup() { + python_pkg_setup + G2CONF="${G2CONF} --disable-allbindings" for binding in ${G_PY_BINDINGS}; do G2CONF="${G2CONF} --enable-${binding}" @@ -65,11 +80,36 @@ gnome-python-common_pkg_setup() { gnome-python-common_src_unpack() { gnome2_src_unpack + has ${EAPI:-0} 0 1 && gnome-python-common_src_prepare +} + +gnome-python-common_src_prepare() { + gnome2_src_prepare + # disable pyc compiling if [[ -f py-compile ]]; then rm py-compile ln -s $(type -P true) py-compile fi + + # The .pc file is installed by respective gnome-python*-base package + sed -i '/^pkgconfig_DATA/d' Makefile.in || die "sed failed" + sed -i '/^pkgconfigdir/d' Makefile.in || die "sed failed" + + python_copy_sources +} + +gnome-python-common_src_configure() { + python_execute_function -s gnome2_src_configure "$@" +} + +gnome-python-common_src_compile() { + has ${EAPI:-0} 0 1 && gnome-python-common_src_configure "$@" + python_src_compile "$@" +} + +gnome-python-common_src_test() { + python_src_test "$@" } # Do a regular gnome2 src_install and then install examples if required. @@ -77,11 +117,8 @@ gnome-python-common_src_unpack() { # (to install a directory recursively, specify it with a trailing '/' - for # example, foo/bar/) gnome-python-common_src_install() { - # The .pc file is installed by respective gnome-python*-base package - sed -i '/^pkgconfig_DATA/d' Makefile || die "sed failed" - sed -i '/^pkgconfigdir/d' Makefile || die "sed failed" - - gnome2_src_install + python_execute_function -s gnome2_src_install "$@" + python_clean_installation_image if hasq examples ${IUSE} && use examples; then insinto /usr/share/doc/${PF}/examples @@ -94,21 +131,12 @@ gnome-python-common_src_install() { fi done fi - - # Python does not need these, bug #299243 - find "${D%/}${EPREFIX}$(python_get_sitedir)" -name "*.la" -delete \ - || die "failed to remove la files" - } gnome-python-common_pkg_postinst() { - python_version - python_need_rebuild - python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/gtk-2.0 + python_mod_optimize gtk-2.0 } gnome-python-common_pkg_postrm() { - python_mod_cleanup + python_mod_cleanup gtk-2.0 } - -EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm |