mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
coverage: update to version 7.2.2. (#8148)
- Drop support for Python 2.7 and 3.7. - Add it for 3.9 and 3.10. - Include man page and README.html files.
This commit is contained in:
@@ -4,14 +4,14 @@ HOMEPAGE="https://github.com/nedbat/coveragepy
|
||||
https://coverage.readthedocs.io/
|
||||
https://pypi.org/project/coverage/"
|
||||
COPYRIGHT="2001 Gareth Rees
|
||||
2004-2019 Ned Batchelder"
|
||||
2004-2023 Ned Batchelder"
|
||||
LICENSE="Apache v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/nedbat/coveragepy/archive/coverage-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="2234feba7b3cbfe71ed54c6b752b50fd365f4c6c49301b1fb1ad490aaaf4faad"
|
||||
SOURCE_DIR="coveragepy-coverage-$portVersion"
|
||||
pypiVersion="54/8a/db9d9cd24f96bb872eea151bb0d5c8cb6a96825b70a0cfaf07bceab2884d"
|
||||
SOURCE_URI="https://files.pythonhosted.org/packages/$pypiVersion/coverage-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="36dd42da34fe94ed98c39887b86db9d06777b1c8f860520e21126a75507024f2"
|
||||
|
||||
ARCHITECTURES="all"
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
@@ -26,63 +26,56 @@ BUILD_REQUIRES="
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:rst2html.py
|
||||
cmd:rst2man.py
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=()
|
||||
PYTHON_VERSIONS=()
|
||||
PYTHON_LIBSUFFIXES=()
|
||||
# We don't have python2 for secondaryArch
|
||||
if [ -z "$secondaryArchSuffix" ]; then
|
||||
PYTHON_PACKAGES+=(python)
|
||||
PYTHON_VERSIONS+=(2.7)
|
||||
PYTHON_LIBSUFFIXES+=("")
|
||||
BUILD_REQUIRES+="
|
||||
setuptools_python
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:python2
|
||||
"
|
||||
fi
|
||||
# gcc2 does not support the flags passed by python3
|
||||
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
|
||||
PYTHON_PACKAGES+=(python3)
|
||||
PYTHON_VERSIONS+=(3.7)
|
||||
PYTHON_LIBSUFFIXES+=(m)
|
||||
BUILD_REQUIRES+="
|
||||
setuptools_python3
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:python3
|
||||
"
|
||||
fi
|
||||
if [ "$targetArchitecture" = x86_gcc2 -a -n "$secondaryArchSuffix" ]; then
|
||||
PROVIDES_python3="
|
||||
coverage_python3 = $portVersion
|
||||
"
|
||||
fi
|
||||
PYTHON_PACKAGES=(python39 python310)
|
||||
PYTHON_VERSIONS=(3.9 3.10)
|
||||
defaultVersion=3.9
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
pythonLibSuffix=${PYTHON_LIBSUFFIXES[$i]}
|
||||
|
||||
eval "PROVIDES_$pythonPackage+=\"
|
||||
eval "PROVIDES_$pythonPackage=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
cmd:coverage${pythonVersion%.*}
|
||||
cmd:coverage_$pythonVersion
|
||||
cmd:coverage_$pythonVersion = $portVersion
|
||||
\""
|
||||
if [ $pythonPackage = python3 ]; then
|
||||
PROVIDES_python3+="
|
||||
cmd:coverage
|
||||
"
|
||||
|
||||
# Provide coverage and coverage3 for the default version
|
||||
if [ "$pythonVersion" = "$defaultVersion" ]; then
|
||||
eval "PROVIDES_${pythonPackage}+=\"
|
||||
cmd:coverage = $portVersion
|
||||
cmd:coverage${pythonVersion%.*} = $portVersion
|
||||
\""
|
||||
fi
|
||||
|
||||
# Also provide "non _x86" package on x86 32 bits
|
||||
if [ "$targetArchitecture" = "x86_gcc2" ]; then
|
||||
eval "PROVIDES_${pythonPackage}+=\"
|
||||
coverage_$pythonPackage = $portVersion
|
||||
\""
|
||||
fi
|
||||
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix
|
||||
lib:libpython$pythonVersion$secondaryArchSuffix
|
||||
\""
|
||||
eval "BUILD_REQUIRES+=\"
|
||||
setuptools_$pythonPackage
|
||||
\""
|
||||
eval "BUILD_PREREQUIRES+=\"
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
done
|
||||
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# Build the man page and README.html
|
||||
rst2man.py < doc/python-coverage.1.txt > coverage.1
|
||||
rst2html.py < README.rst > README.html
|
||||
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
@@ -107,22 +100,28 @@ INSTALL()
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
export PYTHONPATH=$installLocation
|
||||
|
||||
mkdir -p "$installLocation"
|
||||
mkdir -p $manDir/man1
|
||||
|
||||
$python setup.py install \
|
||||
--optimize=1 \
|
||||
--root=/ --prefix="$prefix"
|
||||
|
||||
if [ $pythonPackage = python ]; then
|
||||
rm "$prefix"/bin/coverage
|
||||
# For non default versions, only leave "coverage-$pythonVersion"
|
||||
if [ $pythonVersion != $defaultVersion ]; then
|
||||
rm $prefix/bin/coverage
|
||||
rm $prefix/bin/coverage3
|
||||
fi
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
"$prefix"/bin \
|
||||
"$prefix"/lib/$python
|
||||
done
|
||||
|
||||
if [ -z "$secondaryArchSuffix" ]; then
|
||||
install -m 755 -d "$docDir"
|
||||
install -m 644 -t "$docDir" README.rst
|
||||
fi
|
||||
install -m 644 -t "$docDir" README.html
|
||||
cp coverage.1 $manDir/man1
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/bin \
|
||||
$prefix/lib/$python \
|
||||
$docDir \
|
||||
$manDir
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user