aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-02-29 06:27:12 -0300
committerLeo <thinkabit.ukim@gmail.com>2020-02-29 06:27:12 -0300
commit33ea734e2d28d88a3d545500c96b4c72b3e78432 (patch)
treedcbcda79640e374892d0c750211d8d7a942e699e
parent52ee5092c510657e9b1e8b4ae0104d405c9eac99 (diff)
downloadaports-33ea734e2d28d88a3d545500c96b4c72b3e78432.tar.gz
aports-33ea734e2d28d88a3d545500c96b4c72b3e78432.tar.bz2
aports-33ea734e2d28d88a3d545500c96b4c72b3e78432.tar.xz
main/py3-setuptools: use system components
-rw-r--r--main/py3-setuptools/APKBUILD23
1 files changed, 21 insertions, 2 deletions
diff --git a/main/py3-setuptools/APKBUILD b/main/py3-setuptools/APKBUILD
index c9866eb687..02abb62d36 100644
--- a/main/py3-setuptools/APKBUILD
+++ b/main/py3-setuptools/APKBUILD
@@ -5,13 +5,13 @@
pkgname=py3-setuptools
_pkgname=${pkgname#py3-}
pkgver=45.2.0
-pkgrel=0
+pkgrel=1
pkgdesc="Collection of enhancements to the Python3 distutils"
options="!check" # Tests require packages out of main/
url="https://pypi.python.org/pypi/setuptools"
arch="noarch"
license="MIT"
-depends="python3"
+depends="python3 py3-ordered-set py3-appdirs py3-packaging"
source="$_pkgname-$pkgver.tar.gz::https://github.com/pypa/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver
@@ -23,6 +23,25 @@ export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
prepare() {
default_prepare
+ # Unbundle
+ rm -rf pkg_resources/extern pkg_resources/_vendor \
+ setuptools/extern setuptools/_vendor
+
+ # Upstream devendoring logic is badly broken, see:
+ # https://bugs.archlinux.org/task/58670
+ # https://github.com/pypa/pip/issues/5429
+ # https://github.com/pypa/setuptools/issues/1383
+ # The simplest fix is to simply rewrite import paths to use the canonical
+ # location in the first place
+ for _module in setuptools pkg_resources '' ; do
+ find . -name \*.py -exec sed -i \
+ -e 's/from '$_module.extern' import/import/' \
+ -e 's/from '$_module.extern'./from /' \
+ -e 's/import '$_module.extern'./import /' \
+ -e "s/__import__('$_module.extern./__import__('/" \
+ {} +
+ done
+
# Fix post-release tag
sed -e '/tag_build = .post/d' \
-e '/tag_date = 1/d' \