diff options
author | psykose <alice@ayaya.dev> | 2022-04-07 11:28:09 +0000 |
---|---|---|
committer | Kevin Daudt <kdaudt@alpinelinux.org> | 2022-04-07 17:34:47 +0000 |
commit | ec8e830949fc0daa781ffa52fcd5fbd9aa1b82fe (patch) | |
tree | 8e74db4c9e709c4dd8392701e2ecff260e460021 | |
parent | 072732484887a116bb60525016b1e7ad5f503b8b (diff) |
main/py3-setuptools-stage0: new aport
for py3-setuptools bootstrap
-rw-r--r-- | main/py3-setuptools-stage0/APKBUILD | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/main/py3-setuptools-stage0/APKBUILD b/main/py3-setuptools-stage0/APKBUILD new file mode 100644 index 00000000000..5206b65e01f --- /dev/null +++ b/main/py3-setuptools-stage0/APKBUILD @@ -0,0 +1,71 @@ +# Maintainer: psykose <alice@ayaya.dev> +pkgname=py3-setuptools-stage0 +_pkgname=setuptools +pkgver=52.0.0 +pkgrel=0 +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=" + py3-appdirs + py3-ordered-set + py3-packaging + py3-parsing + python3 + " +source="$_pkgname-$pkgver.tar.gz::https://github.com/pypa/$_pkgname/archive/v$pkgver.tar.gz" +builddir="$srcdir"/$_pkgname-$pkgver + +# provides bootstrap for main/py3-setuptools +provides="py3-setuptools-bootstrap" +provider_priority=1 # lowest + +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' \ + -i setup.cfg + + python3 bootstrap.py +} + +build() { + python3 setup.py build +} + +package() { + # Otherwise it complains that build/scripts-3.9 cannot be found + # no other changes noted + mkdir -p build/scripts-3.9 + + python3 setup.py install --root="$pkgdir" --skip-build +} + +sha512sums=" +f397181a94d1bd3afbf2d1279554df9d448af963886c53ab391eeb6482a4fc6baf9434b5c6a8da36ae0e1d8f5274c93cb2b37d996112880cb2bad8c7767ac1b1 setuptools-52.0.0.tar.gz +" |