From: Michał Górny Date: Thu, 12 Nov 2015 16:26:15 +0000 (+0100) Subject: dev-lang/python: Add symlinks for python-exec wrapping of execs X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=6c2f9e9f117072625ea850d2c8f6f79b6b6a2401;p=gentoo.git 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. --- 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 4fae1b589991..2158a5471c81 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 3049ce1f71bc..9b0e26111a7f 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 aaaa72aca152..526233a9621a 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 caa9e3531aeb..b2b50a17f0c2 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 21421f8ae144..2745f98e6333 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -68,13 +68,14 @@ sci-chemistry/pymol-apbs-plugin # Michał Górny (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 (10 Nov 2015) # Vulnerable package CVE-2014-{1932,1933}