mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-19 18:20:07 +02:00
- Switch to "any" arch (as this is pure Python code). - Added support for Python 3.10. - Added bash completion file for the default "cmd:tqdm". - Install the man page.
100 lines
2.5 KiB
Bash
100 lines
2.5 KiB
Bash
SUMMARY="Add a progress meter to your loops in a second"
|
|
DESCRIPTION="tqdm derives from the Arabic word *taqaddum* (تقدّم) which can mean *progress*, and \
|
|
is an abbreviation for *I love you so much* in Spanish *te quiero demasiado*.
|
|
Instantly make your loops show a smart progress meter - just wrap any iterable with \
|
|
``tqdm(iterable)``, and you're done!"
|
|
HOMEPAGE="https://github.com/tqdm/tqdm"
|
|
COPYRIGHT="2015-2023 tqdm contributors"
|
|
LICENSE="MIT
|
|
MPL v2.0"
|
|
REVISION="1"
|
|
SOURCE_URI="$HOMEPAGE/archive/refs/tags/v$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="d06536be27d945bea1b3e3b0fc9bdabcf44e7262fae4027955a2b30c2ad8ff8e"
|
|
|
|
ARCHITECTURES="any"
|
|
|
|
PROVIDES="
|
|
$portName = $portVersion
|
|
"
|
|
REQUIRES="
|
|
haiku
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku_devel
|
|
"
|
|
|
|
PYTHON_PACKAGES=(python38 python39 python310)
|
|
PYTHON_VERSIONS=(3.8 3.9 3.10)
|
|
defaultVersion=3.9
|
|
for i in "${!PYTHON_PACKAGES[@]}"; do
|
|
pythonPackage=${PYTHON_PACKAGES[i]}
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
|
|
eval "PROVIDES_$pythonPackage=\"
|
|
${portName}_$pythonPackage = $portVersion
|
|
cmd:tqdm_$pythonVersion = $portVersion
|
|
\""
|
|
# Provide non-suffixed command for the default version
|
|
if [ $pythonVersion = $defaultVersion ]; then
|
|
eval "PROVIDES_${pythonPackage}+=\"
|
|
cmd:tqdm = $portVersion
|
|
\""
|
|
fi
|
|
|
|
eval "REQUIRES_$pythonPackage=\"
|
|
haiku
|
|
cmd:python$pythonVersion
|
|
\""
|
|
BUILD_REQUIRES+="
|
|
setuptools_scm_$pythonPackage
|
|
"
|
|
BUILD_PREREQUIRES+="
|
|
cmd:python$pythonVersion
|
|
"
|
|
done
|
|
|
|
|
|
INSTALL()
|
|
{
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion
|
|
|
|
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
|
|
|
|
# For non default versions, only provide suffixed commands
|
|
mv "$binDir"/tqdm "$binDir"/tqdm-$pythonVersion
|
|
if [ $pythonVersion = $defaultVersion ]; then
|
|
ln -s "$binDir"/tqdm-$pythonVersion "$binDir"/tqdm
|
|
fi
|
|
|
|
install -m 755 -d $manDir/man1
|
|
install -m 644 -t $manDir/man1 tqdm/tqdm.1
|
|
|
|
packageEntries $pythonPackage \
|
|
$binDir \
|
|
$prefix/lib/python* \
|
|
$manDir
|
|
|
|
# Bash completion file only works for the default "tqdm" name
|
|
if [ $pythonVersion = $defaultVersion ]; then
|
|
install -m 755 -d "$dataDir"/bash-completion/completions
|
|
install -m 644 tqdm/completion.sh "$dataDir"/bash-completion/completions/tqdm
|
|
|
|
packageEntries $pythonPackage \
|
|
$dataDir
|
|
fi
|
|
done
|
|
}
|