commit:     6c2f9e9f117072625ea850d2c8f6f79b6b6a2401
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 12 16:26:15 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 17 20:39:09 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c2f9e9f

dev-lang/python: Add symlinks for python-exec wrapping of execs

Add symlinks to make it possible to wrap Python executable aliases
(python, python-config, pydoc...) via python-exec.

 ...on-2.7.10-r3.ebuild => python-2.7.10-r4.ebuild} | 21 +++++++++++++++++++-
 ...thon-3.3.5-r3.ebuild => python-3.3.5-r4.ebuild} | 23 +++++++++++++++++++++-
 ...thon-3.4.3-r3.ebuild => python-3.4.3-r4.ebuild} | 23 +++++++++++++++++++++-
 ...thon-3.5.0-r2.ebuild => python-3.5.0-r3.ebuild} | 23 +++++++++++++++++++++-
 profiles/package.mask                              |  9 +++++----
 5 files changed, 91 insertions(+), 8 deletions(-)

diff --git a/dev-lang/python/python-2.7.10-r3.ebuild 
b/dev-lang/python/python-2.7.10-r4.ebuild
similarity index 93%
rename from dev-lang/python/python-2.7.10-r3.ebuild
rename to dev-lang/python/python-2.7.10-r4.ebuild
index 4fae1b5..2158a54 100644
--- a/dev-lang/python/python-2.7.10-r3.ebuild
+++ b/dev-lang/python/python-2.7.10-r4.ebuild
@@ -304,7 +304,7 @@ src_install() {
                -i "${ED}etc/conf.d/pydoc-${SLOT}" 
"${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
 
        # for python-exec
-       local vars=( EPYTHON PYTHON_SITEDIR )
+       local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
 
        # if not using a cross-compiler, use the fresh binary
        if ! tc-is-cross-compiler; then
@@ -317,6 +317,25 @@ src_install() {
        python_export "python${SLOT}" "${vars[@]}"
        echo "EPYTHON='${EPYTHON}'" > epython.py || die
        python_domodule epython.py
+
+       # python-exec wrapping support
+       local pymajor=${SLOT%.*}
+       mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+       # python and pythonX
+       ln -s "../../../bin/python${SLOT}" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+       ln -s "python${pymajor}" \
+               "${D}${PYTHON_SCRIPTDIR}/python" || die
+       # python-config and pythonX-config
+       ln -s "../../../bin/python${SLOT}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+       ln -s "python${pymajor}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python-config" || die
+       # 2to3, pydoc, pyvenv
+       ln -s "../../../bin/2to3-${SLOT}" \
+               "${D}${PYTHON_SCRIPTDIR}/2to3" || die
+       ln -s "../../../bin/pydoc${SLOT}" \
+               "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
 }
 
 pkg_preinst() {

diff --git a/dev-lang/python/python-3.3.5-r3.ebuild 
b/dev-lang/python/python-3.3.5-r4.ebuild
similarity index 92%
rename from dev-lang/python/python-3.3.5-r3.ebuild
rename to dev-lang/python/python-3.3.5-r4.ebuild
index 3049ce1..9b0e261 100644
--- a/dev-lang/python/python-3.3.5-r3.ebuild
+++ b/dev-lang/python/python-3.3.5-r4.ebuild
@@ -291,7 +291,7 @@ src_install() {
                -i "${ED}etc/conf.d/pydoc-${PYVER}" 
"${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
 
        # for python-exec
-       local vars=( EPYTHON PYTHON_SITEDIR )
+       local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
 
        # if not using a cross-compiler, use the fresh binary
        if ! tc-is-cross-compiler; then
@@ -304,6 +304,27 @@ src_install() {
        python_export "python${PYVER}" "${vars[@]}"
        echo "EPYTHON='${EPYTHON}'" > epython.py || die
        python_domodule epython.py
+
+       # python-exec wrapping support
+       local pymajor=${PYVER%.*}
+       mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+       # python and pythonX
+       ln -s "../../../bin/${abiver}" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+       ln -s "python${pymajor}" \
+               "${D}${PYTHON_SCRIPTDIR}/python" || die
+       # python-config and pythonX-config
+       ln -s "../../../bin/${abiver}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+       ln -s "python${pymajor}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python-config" || die
+       # 2to3, pydoc, pyvenv
+       ln -s "../../../bin/2to3-${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/2to3" || die
+       ln -s "../../../bin/pydoc${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+       ln -s "../../../bin/pyvenv-${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
 }
 
 pkg_preinst() {

diff --git a/dev-lang/python/python-3.4.3-r3.ebuild 
b/dev-lang/python/python-3.4.3-r4.ebuild
similarity index 91%
rename from dev-lang/python/python-3.4.3-r3.ebuild
rename to dev-lang/python/python-3.4.3-r4.ebuild
index aaaa72a..526233a 100644
--- a/dev-lang/python/python-3.4.3-r3.ebuild
+++ b/dev-lang/python/python-3.4.3-r4.ebuild
@@ -274,7 +274,7 @@ src_install() {
                -i "${ED}etc/conf.d/pydoc-${PYVER}" 
"${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
 
        # for python-exec
-       local vars=( EPYTHON PYTHON_SITEDIR )
+       local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
 
        # if not using a cross-compiler, use the fresh binary
        if ! tc-is-cross-compiler; then
@@ -287,6 +287,27 @@ src_install() {
        python_export "python${PYVER}" "${vars[@]}"
        echo "EPYTHON='${EPYTHON}'" > epython.py || die
        python_domodule epython.py
+
+       # python-exec wrapping support
+       local pymajor=${PYVER%.*}
+       mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+       # python and pythonX
+       ln -s "../../../bin/${abiver}" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+       ln -s "python${pymajor}" \
+               "${D}${PYTHON_SCRIPTDIR}/python" || die
+       # python-config and pythonX-config
+       ln -s "../../../bin/${abiver}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+       ln -s "python${pymajor}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python-config" || die
+       # 2to3, pydoc, pyvenv
+       ln -s "../../../bin/2to3-${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/2to3" || die
+       ln -s "../../../bin/pydoc${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+       ln -s "../../../bin/pyvenv-${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
 }
 
 pkg_preinst() {

diff --git a/dev-lang/python/python-3.5.0-r2.ebuild 
b/dev-lang/python/python-3.5.0-r3.ebuild
similarity index 91%
rename from dev-lang/python/python-3.5.0-r2.ebuild
rename to dev-lang/python/python-3.5.0-r3.ebuild
index caa9e35..b2b50a1 100644
--- a/dev-lang/python/python-3.5.0-r2.ebuild
+++ b/dev-lang/python/python-3.5.0-r3.ebuild
@@ -277,7 +277,7 @@ src_install() {
                -i "${ED}etc/conf.d/pydoc-${PYVER}" 
"${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
 
        # for python-exec
-       local vars=( EPYTHON PYTHON_SITEDIR )
+       local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
 
        # if not using a cross-compiler, use the fresh binary
        if ! tc-is-cross-compiler; then
@@ -290,6 +290,27 @@ src_install() {
        python_export "python${PYVER}" "${vars[@]}"
        echo "EPYTHON='${EPYTHON}'" > epython.py || die
        python_domodule epython.py
+
+       # python-exec wrapping support
+       local pymajor=${PYVER%.*}
+       mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+       # python and pythonX
+       ln -s "../../../bin/${abiver}" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+       ln -s "python${pymajor}" \
+               "${D}${PYTHON_SCRIPTDIR}/python" || die
+       # python-config and pythonX-config
+       ln -s "../../../bin/${abiver}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+       ln -s "python${pymajor}-config" \
+               "${D}${PYTHON_SCRIPTDIR}/python-config" || die
+       # 2to3, pydoc, pyvenv
+       ln -s "../../../bin/2to3-${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/2to3" || die
+       ln -s "../../../bin/pydoc${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+       ln -s "../../../bin/pyvenv-${PYVER}" \
+               "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
 }
 
 pkg_preinst() {

diff --git a/profiles/package.mask b/profiles/package.mask
index 21421f8..2745f98 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -68,13 +68,14 @@ sci-chemistry/pymol-apbs-plugin
 # Michał Górny <[email protected]> (11 Nov 2015)
 # Cleaned up Python versions masked for testing:
 # - python-config-X.Y compatibility removed,
+# - python-exec symlinks added (to replace eselect-python's wrapper),
 # - ABIFLAGS reintroduced for 3.3+.
 # Resulting API/ABI change can break reverse dependencies, especially
 # if upstream hardcodes paths or library names.
-=dev-lang/python-2.7.10-r3
-=dev-lang/python-3.3.5-r3
-=dev-lang/python-3.4.3-r3
-=dev-lang/python-3.5.0-r2
+=dev-lang/python-2.7.10-r4
+=dev-lang/python-3.3.5-r4
+=dev-lang/python-3.4.3-r4
+=dev-lang/python-3.5.0-r3
 
 # Justin Lecher <[email protected]> (10 Nov 2015)
 # Vulnerable package CVE-2014-{1932,1933}

Reply via email to