commit:     cafa64a947b51070d0fe3869818bf2231c072f47
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 16 14:34:21 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb 16 15:08:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cafa64a9

dev-python/pypy-bin: Restore Gentoo path patch

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pypy-bin/files/7.0.0-gentoo-path.patch  | 52 ++++++++++++++++++++++
 ...y-bin-7.0.0.ebuild => pypy-bin-7.0.0-r1.ebuild} |  4 ++
 2 files changed, 56 insertions(+)

diff --git a/dev-python/pypy-bin/files/7.0.0-gentoo-path.patch 
b/dev-python/pypy-bin/files/7.0.0-gentoo-path.patch
new file mode 100644
index 00000000000..9be52cd0b75
--- /dev/null
+++ b/dev-python/pypy-bin/files/7.0.0-gentoo-path.patch
@@ -0,0 +1,52 @@
+From 959e2aafbe6cabd4e6860f842bce9b8644f627ca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Fri, 27 Nov 2015 17:02:42 +0100
+Subject: [PATCH] Gentoo: override paths for system-wide install based on
+ sys.prefix
+
+Override all default distutils install paths to ones suitable for
+system-wide install when sys.prefix indicates we're running the Gentoo
+system-wide install of PyPy with no prefix overrides (e.g. virtualenv).
+
+Fixes: https://bugs.gentoo.org/462306
+Fixes: https://bugs.gentoo.org/465546
+
+[updated for 7.0.0]
+---
+ lib-python/2.7/distutils/command/install.py | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/lib-python/2.7/distutils/command/install.py 
b/lib-python/2.7/distutils/command/install.py
+index fc43951da0..c2564188cb 100644
+--- a/lib-python/2.7/distutils/command/install.py
++++ b/lib-python/2.7/distutils/command/install.py
+@@ -90,6 +90,13 @@ INSTALL_SCHEMES = {
+         'scripts': '$base/bin',
+         'data'   : '$base',
+         },
++    'gentoo': {
++        'purelib': '$base/site-packages',
++        'platlib': '$base/site-packages',
++        'headers': '$base/include',
++        'scripts': '@EPREFIX@/usr/bin',
++        'data'   : '@EPREFIX@/usr',
++        },
+     }
+ 
+ # The keys to an installation scheme; if any new types of files are to be
+@@ -476,7 +483,11 @@ class install (Command):
+         # it's the caller's problem if they supply a bad name!
+         if (hasattr(sys, 'pypy_version_info') and
+             not name.endswith(('_user', '_home'))):
+-            name = 'pypy'
++            if self.install_base == 
os.path.normpath('@EPREFIX@/usr/lib/pypy2.7'):
++                # override paths for system-wide install
++                name = 'gentoo'
++            else:
++                name = 'pypy'
+         scheme = INSTALL_SCHEMES[name]
+         for key in SCHEME_KEYS:
+             attrname = 'install_' + key
+-- 
+2.21.0.rc1
+

diff --git a/dev-python/pypy-bin/pypy-bin-7.0.0.ebuild 
b/dev-python/pypy-bin/pypy-bin-7.0.0-r1.ebuild
similarity index 97%
rename from dev-python/pypy-bin/pypy-bin-7.0.0.ebuild
rename to dev-python/pypy-bin/pypy-bin-7.0.0-r1.ebuild
index 3793bd49daa..eff1516e978 100644
--- a/dev-python/pypy-bin/pypy-bin-7.0.0.ebuild
+++ b/dev-python/pypy-bin/pypy-bin-7.0.0-r1.ebuild
@@ -82,8 +82,12 @@ QA_PREBUILT="
        usr/lib*/pypy/libpypy-c.so"
 
 src_prepare() {
+       eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
        eapply 
"${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
 
+       sed -e "s^@EPREFIX@^${EPREFIX}^" \
+               -i lib-python/2.7/distutils/command/install.py || die
+
        # apply CPython stdlib patches
        pushd lib-python/2.7 > /dev/null || die
        # TODO: cpy turkish locale patch now fixes C code

Reply via email to