From ba89932b2070029e720236f292055a9cfd8eebb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 18 Feb 2013 23:22:55 +0100 Subject: [PATCH 2/2] Convert to distutils-r1. --- gx86/dev-vcs/subversion/subversion-1.7.7-r1.ebuild | 144 +++++++++------------ 1 file changed, 63 insertions(+), 81 deletions(-) diff --git a/gx86/dev-vcs/subversion/subversion-1.7.7-r1.ebuild b/gx86/dev-vcs/subversion/subversion-1.7.7-r1.ebuild index eeac3e0..fb5c4c8 100644 --- a/gx86/dev-vcs/subversion/subversion-1.7.7-r1.ebuild +++ b/gx86/dev-vcs/subversion/subversion-1.7.7-r1.ebuild @@ -3,12 +3,12 @@ # $Header: /var/cvsroot/gentoo-x86/dev-vcs/subversion/subversion-1.7.7.ebuild,v 1.12 2013/01/26 17:44:46 grobian Exp $ EAPI=5 -SUPPORT_PYTHON_ABIS="1" -RESTRICT_PYTHON_ABIS="3.* *-jython *-pypy-*" +PYTHON_COMPAT=( python{2_5,2_6,2_7} ) +DISTUTILS_OPTIONAL=1 WANT_AUTOMAKE="none" MY_P="${P/_/-}" -inherit autotools bash-completion-r1 db-use depend.apache elisp-common flag-o-matic java-pkg-opt-2 libtool multilib perl-module python eutils +inherit autotools bash-completion-r1 db-use depend.apache distutils-r1 elisp-common flag-o-matic java-pkg-opt-2 libtool multilib perl-module eutils DESCRIPTION="Advanced version control system" HOMEPAGE="http://subversion.apache.org/" @@ -26,11 +26,11 @@ COMMON_DEPEND=">=dev-db/sqlite-3.4 dev-libs/expat sys-libs/zlib berkdb? ( >=sys-libs/db-4.0.14 ) - ctypes-python? ( =dev-lang/python-2* ) + ctypes-python? ( ${PYTHON_DEPS} ) gnome-keyring? ( dev-libs/glib:2 sys-apps/dbus gnome-base/gnome-keyring ) kde? ( sys-apps/dbus x11-libs/qt-core:4 x11-libs/qt-dbus:4 x11-libs/qt-gui:4 >=kde-base/kdelibs-4:4 ) perl? ( dev-lang/perl ) - python? ( =dev-lang/python-2* ) + python? ( ${PYTHON_DEPS} ) ruby? ( >=dev-lang/ruby-1.8.2:1.8 ) sasl? ( dev-libs/cyrus-sasl ) webdav-neon? ( >=net-libs/neon-0.28 ) @@ -41,7 +41,9 @@ RDEPEND="${COMMON_DEPEND} kde? ( kde-base/kwalletd ) nls? ( virtual/libintl ) perl? ( dev-perl/URI )" +# Note: ctypesgen doesn't need PYTHON_USEDEP, it's used once DEPEND="${COMMON_DEPEND} + ${PYTHON_DEPS} !!/dev/null || die + distutils-r1_python_compile + popd >/dev/null || die + fi - if use python; then - python_copy_sources subversion/bindings/swig/python - rm -fr subversion/bindings/swig/python - swig_python_bindings_building() { - rm -f subversion/bindings/swig/python - ln -s python-${PYTHON_ABI} subversion/bindings/swig/python - emake \ - PYTHON_INCLUDES="-I${EPREFIX}$(python_get_includedir)" \ - PYTHON_VERSION="$(python_get_version)" \ - swig_pydir="${EPREFIX}$(python_get_sitedir)/libsvn" \ - swig_pydir_extra="${EPREFIX}$(python_get_sitedir)/svn" \ - swig-py - } - python_execute_function \ - --action-message 'Building of Subversion SWIG Python bindings with $(python_get_implementation) $(python_get_version)' \ - --failure-message 'Building of Subversion SWIG Python bindings failed with $(python_get_implementation) $(python_get_version)' \ - swig_python_bindings_building + if use python; then + local p=subversion/bindings/swig/python + ln -fs "${BUILD_DIR}" ${p} || die + + python_export PYTHON_INCLUDEDIR + emake swig-py \ + swig_pydir="$(python_get_sitedir)/libsvn" \ + swig_pydir_extra="$(python_get_sitedir)/svn" + + rm ${p} || die + fi + } + + if use ctypes-python || use python; then + # pre-generate .py files + use ctypes-python && emake ctypes-python + # this will give us proper BUILD_DIR for symlinking + BUILD_DIR=python \ + python_foreach_impl my_py_compile fi if use perl; then @@ -269,37 +274,30 @@ src_compile() { src_install() { emake -j1 DESTDIR="${D}" local-install - if use ctypes-python; then - ctypes_python_bindings_installation() { - rm -f subversion/bindings/ctypes-python - ln -s ctypes-python-${PYTHON_ABI} subversion/bindings/ctypes-python - emake DESTDIR="${D}" install-ctypes-python - } - python_execute_function \ - --action-message 'Installation of Subversion Ctypes Python bindings with $(python_get_implementation) $(python_get_version)' \ - --failure-message 'Installation of Subversion Ctypes Python bindings failed with $(python_get_implementation) $(python_get_version)' \ - ctypes_python_bindings_installation - fi + my_py_install() { + if use ctypes-python; then + pushd subversion/bindings/ctypes-python >/dev/null || die + distutils-r1_python_install + popd >/dev/null || die + fi + + if use python; then + local p=subversion/bindings/swig/python + ln -s "${BUILD_DIR}" ${p} || die - if use python; then - swig_python_bindings_installation() { - rm -f subversion/bindings/swig/python - ln -s python-${PYTHON_ABI} subversion/bindings/swig/python emake \ DESTDIR="${D}" \ - PYTHON_VERSION="$(python_get_version)" \ - swig_pydir="${EPREFIX}$(python_get_sitedir)/libsvn" \ - swig_pydir_extra="${EPREFIX}$(python_get_sitedir)/svn" \ + swig_pydir="$(python_get_sitedir)/libsvn" \ + swig_pydir_extra="$(python_get_sitedir)/svn" \ install-swig-py - } - python_execute_function \ - --action-message 'Installation of Subversion SWIG Python bindings with $(python_get_implementation) $(python_get_version)' \ - --failure-message 'Installation of Subversion SWIG Python bindings failed with $(python_get_implementation) $(python_get_version)' \ - swig_python_bindings_installation - fi + + rm ${p} || die + fi + } if use ctypes-python || use python; then - python_clean_installation_image -q + BUILD_DIR=python \ + python_foreach_impl my_py_install fi if use perl; then @@ -369,7 +367,7 @@ EOF rm -fr tools/{buildbot,dev,diff,po} insinto /usr/share/${PN} - python_convert_shebangs -r 2 tools + find tools -name '*.py' -exec sed -i -e '1s:python:&2:' {} + || die doins -r tools fi @@ -403,14 +401,6 @@ pkg_preinst() { pkg_postinst() { use perl && perl-module_pkg_postinst - if use ctypes-python; then - python_mod_optimize csvn - fi - - if use python; then - python_mod_optimize libsvn svn - fi - if [[ -n "${CHANGED_BDB_VERSION}" ]]; then ewarn "You upgraded from an older version of Berkeley DB and may experience" ewarn "problems with your repository. Run the following commands as root to fix it:" @@ -423,14 +413,6 @@ pkg_postinst() { pkg_postrm() { use perl && perl-module_pkg_postrm - - if use ctypes-python; then - python_mod_cleanup csvn - fi - - if use python; then - python_mod_cleanup libsvn svn - fi } pkg_config() { -- 1.8.1.2