commit:     9483c233c49989f12e192847b5248055f896a0a2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 23 17:42:51 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Dec 23 18:07:40 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9483c233

dev-lang/python: Install a wrapper to fix python-config paths, #569506

 .../python/{python-3.3.5-r6.ebuild => python-3.3.5-r7.ebuild}    | 9 +++++++--
 .../python/{python-3.4.3-r6.ebuild => python-3.4.3-r7.ebuild}    | 9 +++++++--
 .../python/{python-3.5.1-r1.ebuild => python-3.5.1-r2.ebuild}    | 9 +++++++--
 3 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/dev-lang/python/python-3.3.5-r6.ebuild 
b/dev-lang/python/python-3.3.5-r7.ebuild
similarity index 97%
rename from dev-lang/python/python-3.3.5-r6.ebuild
rename to dev-lang/python/python-3.3.5-r7.ebuild
index a85ba3c..877112f 100644
--- a/dev-lang/python/python-3.3.5-r6.ebuild
+++ b/dev-lang/python/python-3.3.5-r7.ebuild
@@ -318,8 +318,13 @@ src_install() {
        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
+       # note: we need to create a wrapper rather than symlinking it due
+       # to some random dirname(argv[0]) magic performed by python-config
+       cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
+               #!/bin/sh
+               exec "${abiver}-config" "\${@}"
+       EOF
+       chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
        ln -s "python${pymajor}-config" \
                "${D}${PYTHON_SCRIPTDIR}/python-config" || die
        # 2to3, pydoc, pyvenv

diff --git a/dev-lang/python/python-3.4.3-r6.ebuild 
b/dev-lang/python/python-3.4.3-r7.ebuild
similarity index 96%
rename from dev-lang/python/python-3.4.3-r6.ebuild
rename to dev-lang/python/python-3.4.3-r7.ebuild
index 98549fa..f599fd9 100644
--- a/dev-lang/python/python-3.4.3-r6.ebuild
+++ b/dev-lang/python/python-3.4.3-r7.ebuild
@@ -301,8 +301,13 @@ src_install() {
        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
+       # note: we need to create a wrapper rather than symlinking it due
+       # to some random dirname(argv[0]) magic performed by python-config
+       cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
+               #!/bin/sh
+               exec "${abiver}-config" "\${@}"
+       EOF
+       chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
        ln -s "python${pymajor}-config" \
                "${D}${PYTHON_SCRIPTDIR}/python-config" || die
        # 2to3, pydoc, pyvenv

diff --git a/dev-lang/python/python-3.5.1-r1.ebuild 
b/dev-lang/python/python-3.5.1-r2.ebuild
similarity index 96%
rename from dev-lang/python/python-3.5.1-r1.ebuild
rename to dev-lang/python/python-3.5.1-r2.ebuild
index ef7c58e..bf753fa 100644
--- a/dev-lang/python/python-3.5.1-r1.ebuild
+++ b/dev-lang/python/python-3.5.1-r2.ebuild
@@ -304,8 +304,13 @@ src_install() {
        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
+       # note: we need to create a wrapper rather than symlinking it due
+       # to some random dirname(argv[0]) magic performed by python-config
+       cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
+               #!/bin/sh
+               exec "${abiver}-config" "\${@}"
+       EOF
+       chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
        ln -s "python${pymajor}-config" \
                "${D}${PYTHON_SCRIPTDIR}/python-config" || die
        # 2to3, pydoc, pyvenv

Reply via email to