dev-lang/python: Replace python3.x executables with symlinks
authorMichał Górny <mgorny@gentoo.org>
Sun, 8 Nov 2015 09:56:11 +0000 (10:56 +0100)
committerMichał Górny <mgorny@gentoo.org>
Wed, 11 Nov 2015 10:22:43 +0000 (11:22 +0100)
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
dev-lang/python/python-3.4.3-r3.ebuild
dev-lang/python/python-3.5.0-r2.ebuild

index d4b6b034e09cc88b4d4027cfba4705a7dbe51588..7164d5a178ee855885da352f7812b5f30f9b713f 100644 (file)
@@ -252,6 +252,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
index b2b09ced1a331332c8d5349074003f7efc206241..53c39a05aadf96127d8cd824a8d33f64ce2588db 100644 (file)
@@ -237,6 +237,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*}
index 4029ec363128838d69b4a836f4996f59e6433e41..34ac46e1439494274fc0aa55bca57c7c4a707ddd 100644 (file)
@@ -243,6 +243,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*}