0
0
Fork 0
haikuports/dev-python/chardet/chardet-3.0.4.recipe

91 lines
1.9 KiB
Bash
Raw Permalink Normal View History

2017-11-11 16:02:22 +00:00
SUMMARY="Universal Character Encoding Detector"
DESCRIPTION="Python module for character encoding auto-detection."
HOMEPAGE="https://github.com/chardet/chardet"
COPYRIGHT="2011-2017 Mark Pilgrim, Dan Blanchard"
LICENSE="GNU LGPL v2.1"
2021-01-25 20:15:36 +00:00
REVISION="3"
2017-11-11 16:02:22 +00:00
SOURCE_URI="https://pypi.io/packages/source/c/chardet/chardet-$portVersion.tar.gz"
CHECKSUM_SHA256="84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
2021-01-25 20:15:36 +00:00
PYTHON_PACKAGES=(python python3 python38 python39)
PYTHON_VERSIONS=(2.7 3.7 3.8 3.9)
2017-11-11 16:02:22 +00:00
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\
\"; \
REQUIRES_$pythonPackage=\"\
haiku\n\
cmd:python$pythonVersion\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done
PROVIDES_python="$PROVIDES_python
cmd:chardetect
"
PROVIDES_python3="$PROVIDES_python3
cmd:chardetect3
"
2021-01-25 20:15:36 +00:00
PROVIDES_python38="$PROVIDES_python38
cmd:chardetect3.8
"
PROVIDES_python39="$PROVIDES_python39
cmd:chardetect3.9
2019-09-29 08:52:14 +00:00
"
2017-11-11 16:02:22 +00:00
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
2019-09-29 08:52:14 +00:00
if [ $pythonPackage = python3 ]; then
2017-11-11 16:02:22 +00:00
for f in $binDir/*; do
mv $f ${f}3
done
fi
2021-01-25 20:15:36 +00:00
if [ $pythonPackage = python38 ]; then
for f in $binDir/*; do
mv $f ${f}3.8
done
fi
if [ $pythonPackage = python39 ]; then
2019-09-29 08:52:14 +00:00
for f in $binDir/*; do
2021-01-25 20:15:36 +00:00
mv $f ${f}3.9
2019-09-29 08:52:14 +00:00
done
fi
2017-11-11 16:02:22 +00:00
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir
done
}