mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-16 08:40:06 +02:00
psutil: move to Python 3.9, add TEST(). (#8172)
Package is non-functional: on both 3.7 and 3.9 it gives an error when trying to "import psutil". The patchset is WIP, so attempting to update to psutil 5.9.4 won't do much. Still, moving away from 3.7 makes sense.
This commit is contained in:
@@ -33,24 +33,31 @@ BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python3)
|
||||
PYTHON_VERSIONS=(3.7)
|
||||
PYTHON_PACKAGES=(python39)
|
||||
PYTHON_VERSIONS=(3.9)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
eval "PROVIDES_${pythonPackage}=\"\
|
||||
${portName}_$pythonPackage = $portVersion\
|
||||
\"; \
|
||||
REQUIRES_$pythonPackage=\"\
|
||||
haiku$secondaryArchSuffix\n\
|
||||
cmd:python$pythonVersion\
|
||||
\""
|
||||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||||
setuptools_$pythonPackage"
|
||||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||||
cmd:python$pythonVersion"
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
eval "PROVIDES_${pythonPackage}=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
\""
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku$secondaryArchSuffix
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
BUILD_REQUIRES+="
|
||||
setuptools_$pythonPackage
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:python$pythonVersion
|
||||
"
|
||||
TEST_REQUIRES+="
|
||||
cmd:make
|
||||
"
|
||||
done
|
||||
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
@@ -60,8 +67,10 @@ INSTALL()
|
||||
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
|
||||
|
||||
@@ -69,3 +78,18 @@ INSTALL()
|
||||
$prefix/lib/python*
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
TEST()
|
||||
{
|
||||
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
|
||||
|
||||
make test PYTHON=$python
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user