dev-lang/python: Add symlinks for python-exec wrapping of execs
authorMichał Górny <mgorny@gentoo.org>
Thu, 12 Nov 2015 16:26:15 +0000 (17:26 +0100)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Nov 2015 20:39:09 +0000 (21:39 +0100)
Add symlinks to make it possible to wrap Python executable aliases
(python, python-config, pydoc...) via python-exec.

dev-lang/python/python-2.7.10-r4.ebuild [moved from dev-lang/python/python-2.7.10-r3.ebuild with 93% similarity]
dev-lang/python/python-3.3.5-r4.ebuild [moved from dev-lang/python/python-3.3.5-r3.ebuild with 92% similarity]
dev-lang/python/python-3.4.3-r4.ebuild [moved from dev-lang/python/python-3.4.3-r3.ebuild with 91% similarity]
dev-lang/python/python-3.5.0-r3.ebuild [moved from dev-lang/python/python-3.5.0-r2.ebuild with 91% similarity]
profiles/package.mask

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 4fae1b589991b092331dfd2ef47c18c03c148fc9..2158a5471c81056d2b9bc44a1a52cb3d328d43c6 100644 (file)
@@ -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() {
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 3049ce1f71bc1735d222c3ae4b5325cd06d0b4c8..9b0e26111a7fd09c6fb8db2dd7ef69909745c59b 100644 (file)
@@ -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() {
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 aaaa72aca1526ebede79b32adef2f0439f27fe13..526233a9621a45b7d7bc397f18cb8edc6144eee7 100644 (file)
@@ -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() {
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 caa9e3531aeb5d55b46ba8f908e9606ccea32588..b2b50a17f0c25819e4a9cf40af7dc9aca282dc4b 100644 (file)
@@ -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() {
index 21421f8ae1449aec8498cd7304f6d123df648794..2745f98e6333fa61313a36e5af68fd69dca0781a 100644 (file)
@@ -68,13 +68,14 @@ sci-chemistry/pymol-apbs-plugin
 # Michał Górny <mgorny@gentoo.org> (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 <jlec@gentoo.org> (10 Nov 2015)
 # Vulnerable package CVE-2014-{1932,1933}