summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2015-07-27 16:32:46 +0000
committerMichał Górny <mgorny@gentoo.org>2015-07-27 16:32:46 +0000
commit5c7792ceaf16a5dd84d61307fea921d2a120c97d (patch)
treec5f00ce50a0ee08f742fcb38b536db55f2ad0cdd /eclass
parentDrop the USE_PYTHON warning. (diff)
downloadgentoo-2-5c7792ceaf16a5dd84d61307fea921d2a120c97d.tar.gz
gentoo-2-5c7792ceaf16a5dd84d61307fea921d2a120c97d.tar.bz2
gentoo-2-5c7792ceaf16a5dd84d61307fea921d2a120c97d.zip
python_wrapper_setup(): replace symlinks with shell wrappers to avoid triggering Python 3.4+ magical prefix support.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/python-utils-r1.eclass19
2 files changed, 20 insertions, 5 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index ca5959b020de..02586cd3c335 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1728 2015/07/27 16:31:01 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1729 2015/07/27 16:32:46 mgorny Exp $
+
+ 27 Jul 2015; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass:
+ python_wrapper_setup(): replace symlinks with shell wrappers to avoid
+ triggering Python 3.4+ magical prefix support.
27 Jul 2015; Mike Gilbert <floppym@gentoo.org> python-r1.eclass:
Drop the USE_PYTHON warning.
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index a29217946f89..e3bed87d50bc 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.84 2015/07/25 10:07:36 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.85 2015/07/27 16:32:46 mgorny Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -855,14 +855,25 @@ python_wrapper_setup() {
fi
# Python interpreter
- ln -s "${PYTHON}" "${workdir}"/bin/python || die
- ln -s python "${workdir}"/bin/python${pyver} || die
+ # note: we don't use symlinks because python likes to do some
+ # symlink reading magic that breaks stuff
+ # https://bugs.gentoo.org/show_bug.cgi?id=555752
+ cat > "${workdir}/bin/python" <<-_EOF_
+ #!/bin/sh
+ exec "${PYTHON}" "\${@}"
+ _EOF_
+ cp "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die
+ chmod +x "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die
local nonsupp=()
# CPython-specific
if [[ ${EPYTHON} == python* ]]; then
- ln -s "${PYTHON}-config" "${workdir}"/bin/python-config || die
+ cat > "${workdir}/bin/python-config" <<-_EOF_
+ #!/bin/sh
+ exec "${PYTHON}-config" "\${@}"
+ _EOF_
+ chmod +x "${workdir}/bin/python-config" || die
# Python 2.6+.
ln -s "${PYTHON/python/2to3-}" "${workdir}"/bin/2to3 || die