Files
haikuports/dev-python/pip/pip-23.2.1.recipe
Oscar Lesta 8f0aa87c19 pip: drop support for all but current "default Python".
IMO, this recipe should be just dropped, but sadly, we still have
a few recipes using pip :-(. I consider using pip on recipes a
big NO NO, and I think we should avoid it.

Besides that...

`pip` moves too fast for us to properly keep up, and installing
pip for whatever Python version is as simple as doing:

> python3.xx -m ensurepip --altinstall
> python3.xx -m pip install --upgrade pip

(replace .xx accordingly, of course)

And then users can just update their pip whenever they like.
2025-09-20 02:00:39 -03:00

82 lines
1.8 KiB
Bash

SUMMARY="The PyPA recommended tool for installing Python packages"
DESCRIPTION="Install Python packages, replacement for easy_install"
HOMEPAGE="https://pypi.python.org/pypi/pip"
COPYRIGHT="2006-2023 Python Packaging Authority"
LICENSE="Python"
REVISION="4"
SOURCE_URI="https://pypi.io/packages/source/p/pip/pip-$portVersion.tar.gz"
CHECKSUM_SHA256="fb0bd5435b3200c602b5bf61d2d43c2f13c02e29c1707567ae7fbc514eb9faf2"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
PYTHON_VERSIONS=(3.10)
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
cmd:pip$pythonVersion
\""
# Provide non-suffixed cmd only for the default Python version
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:pip = $portVersion
cmd:pip3 = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
setuptools_$pythonPackage
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
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
# Remove non-version suffixed commands, except for the default python version.
if [ $pythonVersion != $defaultVersion ]; then
rm $binDir/{pip,pip3}
fi
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir
done
}