commit:     44612bbe9361896c3b165e9a97fc0e5217e9fdc3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  8 09:56:11 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov  8 09:56:11 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44612bbe

dev-lang/python: Replace python3.x executables with symlinks

Replace python3.X executables (duplicate to python3.Xm) installed by
the build system with symlinks to the ABIFLAGS-enabled variants.

 dev-lang/python/python-3.3.5-r3.ebuild | 8 ++++++++
 dev-lang/python/python-3.4.3-r3.ebuild | 8 ++++++++
 dev-lang/python/python-3.5.0-r2.ebuild | 8 ++++++++
 3 files changed, 24 insertions(+)

diff --git a/dev-lang/python/python-3.3.5-r3.ebuild 
b/dev-lang/python/python-3.3.5-r3.ebuild
index f8a120c..e5e6291 100644
--- a/dev-lang/python/python-3.3.5-r3.ebuild
+++ b/dev-lang/python/python-3.3.5-r3.ebuild
@@ -249,6 +249,14 @@ src_install() {
        # Fix collisions between different slots of Python.
        rm -f "${ED}usr/$(get_libdir)/libpython3.so"
 
+       # Cheap hack to get version with ABIFLAGS
+       local abiver=$(cd "${ED}usr/include"; echo python*)
+       # Replace python3.X with a symlink if appropriate
+       if [[ ${abiver} != python${SLOT} ]]; then
+               rm "${ED}usr/bin/python${SLOT}" || die
+               dosym "${abiver}" "/usr/bin/python${SLOT}"
+       fi
+
        if use build; then
                rm -fr "${ED}usr/bin/idle${SLOT}" 
"${libdir}/"{idlelib,sqlite3,test,tkinter}
        else

diff --git a/dev-lang/python/python-3.4.3-r3.ebuild 
b/dev-lang/python/python-3.4.3-r3.ebuild
index 3020fc8..fad0059 100644
--- a/dev-lang/python/python-3.4.3-r3.ebuild
+++ b/dev-lang/python/python-3.4.3-r3.ebuild
@@ -234,6 +234,14 @@ src_install() {
        # Fix collisions between different slots of Python.
        rm -f "${ED}usr/$(get_libdir)/libpython3.so"
 
+       # Cheap hack to get version with ABIFLAGS
+       local abiver=$(cd "${ED}usr/include"; echo python*)
+       # Replace python3.X with a symlink if appropriate
+       if [[ ${abiver} != python${SLOT} ]]; then
+               rm "${ED}usr/bin/python${SLOT}" || die
+               dosym "${abiver}" "/usr/bin/python${SLOT}"
+       fi
+
                use elibc_uclibc && rm -fr "${libdir}/test"
                use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
                use tk || rm -fr "${ED}usr/bin/idle${SLOT}" 
"${libdir}/"{idlelib,tkinter,test/test_tk*}

diff --git a/dev-lang/python/python-3.5.0-r2.ebuild 
b/dev-lang/python/python-3.5.0-r2.ebuild
index 5c4addf..18aa6cb 100644
--- a/dev-lang/python/python-3.5.0-r2.ebuild
+++ b/dev-lang/python/python-3.5.0-r2.ebuild
@@ -240,6 +240,14 @@ src_install() {
        # Fix collisions between different slots of Python.
        rm -f "${ED}usr/$(get_libdir)/libpython3.so"
 
+       # Cheap hack to get version with ABIFLAGS
+       local abiver=$(cd "${ED}usr/include"; echo python*)
+       # Replace python3.X with a symlink if appropriate
+       if [[ ${abiver} != python${SLOT} ]]; then
+               rm "${ED}usr/bin/python${SLOT}" || die
+               dosym "${abiver}" "/usr/bin/python${SLOT}"
+       fi
+
        use elibc_uclibc && rm -fr "${libdir}/test"
        use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
        use tk || rm -fr "${ED}usr/bin/idle${SLOT}" 
"${libdir}/"{idlelib,tkinter,test/test_tk*}

Reply via email to