core/python3-setuptools/Pkgfile
Tim Biermann a4ce8cb873 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
2023-11-05 11:45:10 +01:00

27 lines
826 B
Plaintext

# Description: Easily download, build, install, upgrade, and uninstall Python packages
# URL: https://pypi.python.org/pypi/setuptools
# Maintainer: CRUX System Team, core-ports at crux dot nu
# Depends on: python3
name=python3-setuptools
version=68.2.2
release=1
source=(https://files.pythonhosted.org/packages/source/${name:8:1}/${name#*-}/${name#*-}-$version.tar.gz)
build() {
cd ${name#*-}-$version
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
## 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
$SRC/temp/usr/bin/pip3 install --isolate \
--root=$PKG \
--ignore-installed \
--no-deps .
}