Files
haikuports/dev-python/waitress/waitress-2.1.2.recipe
Oscar Lesta 0c08a0c3e1 waitress: cleanups, drop Python 3.9 support.
Also: properly suffix-version commands.
2025-07-24 01:02:28 -03:00

92 lines
2.1 KiB
Bash

SUMMARY="Python WSGI server"
DESCRIPTION="Waitress is meant to be a production-quality pure-Python WSGI \
server with very acceptable performance. It has no dependencies except ones \
which live in the Python standard library.
It supports HTTP/1.0 and HTTP/1.1."
HOMEPAGE="https://pypi.org/project/waitress/"
COPYRIGHT="2011-2017 Pylons Project"
LICENSE="ZPL v2.1"
REVISION="4"
SOURCE_URI="https://files.pythonhosted.org/packages/source/w/waitress/waitress-$portVersion.tar.gz"
CHECKSUM_SHA256="780a4082c5fbc0fde6a2fcfe5e26e6efc1e8f425730863c04085769781f51eba"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
cmd:waitress_serve_$pythonVersion = $portVersion
\""
# Provide non-suffixed cmd only for the default Python version
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:waitress_serve = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
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"
# 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
install -m 755 -d "$docDir"
install -m 644 -t "$docDir" README.rst
packageEntries $pythonPackage \
"$prefix"/lib/$python \
"$prefix"/bin \
"$docDir"
done
}