Files
haikuports/dev-python/chardet/chardet-4.0.0.recipe
OscarL 0922e64579 *_python*: clean up around commands suffixes. Drop Python3.9 support. (#12591)
Plus general recipe clean ups, while we're at it.

----

Tested locally only for mutagen. Will fix if something breaks.

`requests_python39` will pop up in in the reports due to missing `chardet_python39`.
Nothing requires `requests_python39` on tree, so will remove that at some point.
2025-07-14 20:48:47 -03:00

86 lines
1.9 KiB
Bash

SUMMARY="Universal Character Encoding Detector"
DESCRIPTION="Python module for character encoding auto-detection."
HOMEPAGE="https://github.com/chardet/chardet"
COPYRIGHT="2011-2022 Mark Pilgrim, Dan Blanchard"
LICENSE="GNU LGPL v2.1"
REVISION="6"
SOURCE_URI="https://pypi.io/packages/source/${portName:0:1}/$portName/${portName}-$portVersion.tar.gz"
CHECKSUM_SHA256="0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"
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:chardetect_$pythonVersion = $portVersion
\""
# Provide non-suffixed cmd only for the default Python version
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:chardetect = $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
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir
done
}