diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2021-10-31 22:29:39 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2021-10-31 22:32:56 +0200 |
commit | 30135c0cba46171bb19dda992b075a8ed1c6b00c (patch) | |
tree | 46d6491b8fd67ed8e17970f48eb95b1ef27097c8 /dev-python/setuptools | |
parent | dev-python/curtsies: Remove old (diff) | |
download | gentoo-30135c0cba46171bb19dda992b075a8ed1c6b00c.tar.gz gentoo-30135c0cba46171bb19dda992b075a8ed1c6b00c.tar.bz2 gentoo-30135c0cba46171bb19dda992b075a8ed1c6b00c.zip |
dev-python/setuptools: fix pypy3.8 install location
When on pypy3.8, and package forces to use setuptools's bundled
distutils, it installs into "/usr/lib/python3.8" directory, which is
wrong.
Using this patch, we fix the install locations, so it installs
correctly for all targets (tested).
Closes: https://bugs.gentoo.org/821112
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/setuptools')
-rw-r--r-- | dev-python/setuptools/files/setuptools-58.2.0-fix-pypy3.8-install.patch | 78 | ||||
-rw-r--r-- | dev-python/setuptools/setuptools-58.2.0-r1.ebuild (renamed from dev-python/setuptools/setuptools-58.2.0.ebuild) | 5 |
2 files changed, 83 insertions, 0 deletions
diff --git a/dev-python/setuptools/files/setuptools-58.2.0-fix-pypy3.8-install.patch b/dev-python/setuptools/files/setuptools-58.2.0-fix-pypy3.8-install.patch new file mode 100644 index 000000000000..238bc47d3328 --- /dev/null +++ b/dev-python/setuptools/files/setuptools-58.2.0-fix-pypy3.8-install.patch @@ -0,0 +1,78 @@ +From 987edfa3265187a47b8688119943e7d96712d859 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando <isuruf@gmail.com> +Date: Tue, 21 Sep 2021 13:45:50 -0700 +Subject: [PATCH] Fix PyPy3.8 install locations + +--- + setuptools/_distutils/command/install.py | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +diff --git a/setuptools/_distutils/command/install.py b/setuptools/_distutils/command/install.py +index 866e2d5..e98f049 100644 +--- a/setuptools/_distutils/command/install.py ++++ b/setuptools/_distutils/command/install.py +@@ -29,16 +29,16 @@ + + INSTALL_SCHEMES = { + 'unix_prefix': { +- 'purelib': '$base/lib/python$py_version_short/site-packages', +- 'platlib': '$platbase/$platlibdir/python$py_version_short/site-packages', +- 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', ++ 'purelib': '$base/lib/$implementation_lower$py_version_short/site-packages', ++ 'platlib': '$platbase/$platlibdir/$implementation_lower$py_version_short/site-packages', ++ 'headers': '$base/include/$implementation_lower$py_version_short$abiflags/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', + }, + 'unix_home': { +- 'purelib': '$base/lib/python', +- 'platlib': '$base/$platlibdir/python', +- 'headers': '$base/include/python/$dist_name', ++ 'purelib': '$base/lib/$implementation_lower', ++ 'platlib': '$base/$platlibdir/$implementation_lower', ++ 'headers': '$base/include/$implementation_lower/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', + }, +@@ -64,8 +64,8 @@ + INSTALL_SCHEMES['nt_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', +- 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', +- 'scripts': '$userbase/Python$py_version_nodot/Scripts', ++ 'headers': '$userbase/$implementation$py_version_nodot/Include/$dist_name', ++ 'scripts': '$userbase/$implementation$py_version_nodot/Scripts', + 'data' : '$userbase', + } + +@@ -73,7 +73,7 @@ + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': +- '$userbase/include/python$py_version_short$abiflags/$dist_name', ++ '$userbase/include/$implementation_lower$py_version_short$abiflags/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } +@@ -83,6 +83,12 @@ + # and to SCHEME_KEYS here. + SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data') + ++def _get_implementation(): ++ if hasattr(sys, 'pypy_version_info'): ++ return 'PyPy' ++ else: ++ return 'Python' ++ + + class install(Command): + +@@ -313,6 +319,8 @@ def finalize_options(self): + 'exec_prefix': exec_prefix, + 'abiflags': abiflags, + 'platlibdir': getattr(sys, 'platlibdir', 'lib'), ++ 'implementation_lower': _get_implementation().lower(), ++ 'implementation': _get_implementation(), + } + + if HAS_USER_SITE:
\ No newline at end of file diff --git a/dev-python/setuptools/setuptools-58.2.0.ebuild b/dev-python/setuptools/setuptools-58.2.0-r1.ebuild index 13e77de865de..2d78feac9fde 100644 --- a/dev-python/setuptools/setuptools-58.2.0.ebuild +++ b/dev-python/setuptools/setuptools-58.2.0-r1.ebuild @@ -49,6 +49,11 @@ DISTUTILS_IN_SOURCE_BUILD=1 DOCS=( {CHANGES,README}.rst ) +PATCHES=( + # https://github.com/pypa/distutils/pull/58 + "${FILESDIR}/${P}-fix-pypy3.8-install.patch" +) + src_prepare() { # apply distutils patches to the bundled distutils pushd setuptools/_distutils >/dev/null || die |