tqdm: update to version 4.65.0 (#8161)

- 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.
This commit is contained in:
OscarL
2023-03-31 07:32:30 -03:00
committed by GitHub
parent 830ba164e7
commit 4daeb7c253
2 changed files with 99 additions and 78 deletions

View File

@@ -1,78 +0,0 @@
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-2021 tqdm contributors"
LICENSE="MIT
MPL v2.0"
REVISION="2"
SOURCE_URI="$HOMEPAGE/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="c6c0bace914d9e7aab60b46a83f4943e0f136e572f98ab8193f98ce9cbf4ce65"
SOURCE_FILENAME="tqdm-$portVersion.tar.gz"
ARCHITECTURES="all"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_PACKAGES=(python38 python39)
PYTHON_VERSIONS=(3.8 3.9)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_scm_$pythonPackage
pip_$pythonPackage
wheel_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done
PROVIDES_python38+="
cmd:tqdm38
"
PROVIDES_python39+="
cmd:tqdm
"
export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion
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
if [ "$pythonPackage" = python38 ]; then
mv "$binDir"/tqdm "$binDir"/tqdm38
fi
packageEntries $pythonPackage \
$binDir \
$prefix/lib/python*
done
}

View File

@@ -0,0 +1,99 @@
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
}