wheel: update to version 0.41.2 (#9514)

Switch to install from .whl package.

IMO, we should do the same whenever possible for Python packages
that do not require compilation, or otherwise special needs.

It gives us some advantages:

- faster builds.
- simpler recipes.
- can get/compare SHA_256 right from PyPI download page.
  This one is also valid for tarballs's case, if we use
  pypi.io / pythonhosted.org URIs of course.
- can help avoid complex build dependencies (like `poetry`).

The last one a major one, as it can help reduce maintenance costs.
This commit is contained in:
OscarL
2023-09-24 09:07:34 -03:00
committed by GitHub
parent e1e2729072
commit 6af96fc308
2 changed files with 90 additions and 67 deletions

View File

@@ -1,67 +0,0 @@
SUMMARY="Reference implementation of PEP 427 python packaging"
DESCRIPTION="Setuptools extension for building wheels, and command line tool \
for working with wheel files."
HOMEPAGE="https://pypi.org/project/wheel"
COPYRIGHT="2012-2020 Daniel Holth, Alex Grönholm"
LICENSE="MIT"
REVISION="4"
SOURCE_URI="https://github.com/pypa/wheel/archive/$portVersion.tar.gz"
SOURCE_FILENAME="wheel-$portVersion.tar.gz"
CHECKSUM_SHA256="c31e70355935f1d47bf0d898661a1e9dd47966d935c0a785dbe5b41eedf6802a"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:sed
"
PYTHON_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\n\
cmd:wheel_$pythonVersion\n\
\"; \
REQUIRES_$pythonPackage=\"\
haiku\n\
cmd:python$pythonVersion\n\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
$python setup.py build install \
--root=/ --prefix=$prefix
mv $binDir/wheel $binDir/wheel_$pythonVersion
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir
done
}

View File

@@ -0,0 +1,90 @@
SUMMARY="A built-package format for Python"
DESCRIPTION="This library is the reference implementation of the Python wheel packaging standard, \
as defined in PEP 427.
It has two different roles:
- A setuptools extension for building wheels that provides the bdist_wheel setuptools command
- A command line tool for working with wheel files
It should be noted that wheel is not intended to be used as a library, and as such there is no \
stable, public API."
HOMEPAGE="https://pypi.org/project/wheel"
COPYRIGHT="2012 Daniel Holth and contributors"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://files.pythonhosted.org/packages/py3/${portName:0:1}/$portName/$portName-$portVersion-py3-none-any.whl#noarchive"
CHECKSUM_SHA256="75909db2664838d015e3d9139004ee16711748a52c8f336b52882266540215d8"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
# Add more versions here as necessary:
PYTHON_VERSIONS=(3.9 3.10)
# And don't forget to change this if the default Python version on Haiku changes:
defaultVersion=3.10
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
cmd:wheel_$pythonVersion
\""
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:wheel = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
installer_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
$python -m installer -p $prefix $portName-$portVersion-py3-none-any.whl
# Version suffix all the scripts
for f in $binDir/*; do
mv $f $f-$pythonVersion
done
# And provide suffix-less symlinks for the default version
if [ $pythonVersion = $defaultVersion ]; then
for f in $binDir/*; do
ln -sr $f ${f%-$pythonVersion}
done
fi
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir
done
}