mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
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.
91 lines
2.2 KiB
Bash
91 lines
2.2 KiB
Bash
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
|
|
}
|