python3-setuptools: rebuilt for python3.12

python3.12 removed distutils from their standard library [1] after
deprecating it in 2020 with python3.10 [2].
Because of that, we are unable to run setup.py to build setuptools
if we do not have anything else (e.g. pip). [3]

To ensure compatibility with ports that did not adjust yet we can keep
setuptools as is around for a little bit longer.

To build it, we can bootstrap pip inside the build environment with
ensurepip provided by core/python3 to build setuptools itself. This will
provide a _distutils_hack wheel along with it which we can use until the
dust settled.

[1]: https://docs.python.org/3/whatsnew/3.12.html
[2]: https://peps.python.org/pep-0632/
[3]: https://github.com/pypa/setuptools/issues/3661
This commit is contained in:
Tim Biermann 2023-11-05 11:45:10 +01:00
parent e9a00f4157
commit a4ce8cb873
3 changed files with 515 additions and 725 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/core.pub
RWRJc1FUaeVeqoWeCI8TWEpV7XkzklbIErR7tN2ca3/jyvYXigKODdTpui+tbqw/KlppSVpZhw15/kHifBPYN8GaR4JVeTaD9wc=
SHA256 (Pkgfile) = d1356482a15da87ccff31d4199dacdd41ad284f939102df1b7006218c2cc47ea
SHA256 (.footprint) = 44f6e569ea7a86e5350b831830ce12847eed938fd4e5d206aec71d847f0e71f0
RWRJc1FUaeVeqgZque8kVaGfYRMEmHsO12RLO8q5bSJy8wLCIvjt8+3t1+G8JqnrmgjLVupdelaOQM/u9MP/75YKAkEWt/KK1wE=
SHA256 (Pkgfile) = ffc71331c0005091bd4b2455e258a4d383ea545aca64db36faa53072c5b9212f
SHA256 (.footprint) = 3819b45d33e607335dd27946fb24d38db9eafce146b8932e96ae7dc6293d2156
SHA256 (setuptools-68.2.2.tar.gz) = 4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87

View File

@ -13,8 +13,14 @@ build() {
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
/usr/bin/python3 setup.py build
## Bootstrap pip to build setuptools
mkdir $SRC/temp
_pyver=$(/usr/bin/python3 -c 'import sys; print("%s.%s" % sys.version_info[:2])')
export PYTHONPATH="$SRC/temp/usr/lib/python$_pyver/site-packages"
/usr/bin/python3 -m ensurepip --root $SRC/temp
/usr/bin/python3 setup.py install \
--prefix=/usr --root=$PKG --optimize=1
$SRC/temp/usr/bin/pip3 install --isolate \
--root=$PKG \
--ignore-installed \
--no-deps .
}