mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
pytz: new recipe.
This commit is contained in:
100
dev-python/pytz/pytz-2018.7.recipe
Normal file
100
dev-python/pytz/pytz-2018.7.recipe
Normal file
@@ -0,0 +1,100 @@
|
||||
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://files.pythonhosted.org/packages/source/p/pytz/pytz-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="31cb35c89bd7d333cd32c5f278fca91b523b0834369e757f4c5641ea252236ca"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
pytz = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
setuptools_python
|
||||
setuptools_python3
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:python
|
||||
cmd:python3
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python python3)
|
||||
PYTHON_VERSIONS=(2.7 3.6)
|
||||
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
|
||||
\""
|
||||
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()
|
||||
{
|
||||
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 "$dataDir"/licenses/packages/pytz
|
||||
install -m 644 -t "$dataDir"/licenses/packages/pytz LICENSE.txt
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
"$dataDir" \
|
||||
"$prefix"/lib/$python
|
||||
done
|
||||
|
||||
install -m 755 -d "$dataDir"/licenses/packages/pytz "$docDir"
|
||||
install -m 644 -t "$dataDir"/licenses/packages/pytz LICENSE.txt
|
||||
install -m 644 -t "$docDir" README.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
|
||||
}
|
||||
Reference in New Issue
Block a user