100 lines
2.4 KiB
Bash
100 lines
2.4 KiB
Bash
SUMMARY="World timezone definitions for Python"
|
|
DESCRIPTION="pytz brings the Olson tz database into Python. \
|
|
It allows accurate and cross platform timezone calculations. \
|
|
It also solves the issue of ambiguous times at the end of daylight saving time."
|
|
HOMEPAGE="https://pythonhosted.org/pytz/
|
|
https://pypi.org/project/pytz/"
|
|
COPYRIGHT="2013-2018 Stuart Bishop"
|
|
LICENSE="MIT"
|
|
REVISION="1"
|
|
SOURCE_URI="https://pypi.io/packages/source/${portName:0:1}/$portName/$portName-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="180befebb1927b16f6b57101720075a984c019ac16b1b7575673bea42c6c3da5"
|
|
|
|
ARCHITECTURES="any"
|
|
|
|
PROVIDES="
|
|
pytz = $portVersion
|
|
"
|
|
REQUIRES="
|
|
haiku
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku_devel
|
|
"
|
|
|
|
PYTHON_PACKAGES=(python python3 python38 python39)
|
|
PYTHON_VERSIONS=(2.7 3.7 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_$pythonPackage"
|
|
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
|
cmd:python$pythonVersion"
|
|
done
|
|
|
|
BUILD()
|
|
{
|
|
for i in "${!PYTHON_PACKAGES[@]}"; do
|
|
pythonPackage=${PYTHON_PACKAGES[i]}
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
|
|
rm -rf "$sourceDir"-$pythonPackage
|
|
cp -a "$sourceDir" "$sourceDir"-$pythonPackage
|
|
cd "$sourceDir"-$pythonPackage
|
|
|
|
python=python$pythonVersion
|
|
$python setup.py build
|
|
done
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
myLicensesDir=$dataDir/licenses/packages/p/pytz
|
|
|
|
for i in "${!PYTHON_PACKAGES[@]}"; do
|
|
pythonPackage=${PYTHON_PACKAGES[i]}
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
|
|
cd "$sourceDir"-$pythonPackage
|
|
|
|
python=python$pythonVersion
|
|
installLocation=$prefix/lib/$python/vendor-packages/
|
|
export PYTHONPATH=$installLocation
|
|
mkdir -p "$installLocation"
|
|
$python setup.py install --root=/ --prefix="$prefix"
|
|
|
|
install -m 755 -d "$myLicensesDir"
|
|
install -m 644 -t "$myLicensesDir" LICENSE.txt
|
|
|
|
packageEntries $pythonPackage \
|
|
"$dataDir" \
|
|
"$prefix"/lib/$python
|
|
done
|
|
|
|
install -m 755 -d "$myLicensesDir" "$docDir"
|
|
install -m 644 -t "$myLicensesDir" LICENSE.txt
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
for i in "${!PYTHON_PACKAGES[@]}"; do
|
|
pythonPackage=${PYTHON_PACKAGES[i]}
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
|
|
cd "$sourceDir"-$pythonPackage/pytz/tests
|
|
|
|
python=python$pythonVersion
|
|
$python test_tzinfo.py
|
|
done
|
|
}
|