mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2025-12-25 05:00:21 +00:00
- `wheel` version 0.46+ now requires `setuptools` version 70 or newer - discussed upstream here: pypa/wheel#660 - discovered in termux-packages here: termux#24062 (comment) - Lock `wheel` version at 0.46.1 so that if a future `wheel` update causes a similar problem in the future, it doesn't immediately propagate into termux-packages without us explicitly bumping it. Recommended by Tomjo2000 here: termux#24062 (comment) - I have confirmed that this change works to fix the build of `python-lxml` **both** - **in `TERMUX_ON_DEVICE_BUILD=false` mode (broken temporarily for 1 week)**, - fixes `error: invalid command 'bdist_wheel'` - **and also in `TERMUX_ON_DEVICE_BUILD=true` mode (broken for 6 months)**. - fixes `ModuleNotFoundError: No module named 'setuptools'` - It seems appropriate to remove the `if [ "${TERMUX_PYTHON_VERSION#*.}" -lt "12" ]` block because there is no longer any `python3.11` so it does not seem like that code is reachable anymore. - `python-torchvision` needed ajustment of its custom `CFLAGS` to be `CXXFLAGS` instead, because the newer `setuptools` is now compiling it using `aarch64-linux-android-clang++` instead of `aarch64-linux-android-clang`. - `python-pip` and `python-pillow` both had locked `setuptools` in their `TERMUX_PKG_PYTHON_COMMON_DEPS` at versions slightly newer than the old global version, now that the global version is newer than either of those, they do not seem to need that anymore.
72 lines
2.5 KiB
Bash
72 lines
2.5 KiB
Bash
TERMUX_PKG_HOMEPAGE=https://pip.pypa.io/
|
|
TERMUX_PKG_DESCRIPTION="The PyPA recommended tool for installing Python packages"
|
|
TERMUX_PKG_LICENSE="MIT"
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
|
TERMUX_PKG_VERSION="25.0.1"
|
|
TERMUX_PKG_REVISION=1
|
|
TERMUX_PKG_SRCURL=https://github.com/pypa/pip/archive/$TERMUX_PKG_VERSION.tar.gz
|
|
TERMUX_PKG_SHA256=334371888f0c679c04e819ddc234562feaea81331658a76842b62dc9dc83a832
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
|
TERMUX_PKG_UPDATE_TAG_TYPE="newest-tag"
|
|
TERMUX_PKG_UPDATE_VERSION_REGEXP='^\d+\.\d+(\.\d+)?$'
|
|
TERMUX_PKG_DEPENDS="clang, make, pkg-config, python (>= 3.11.1-1)"
|
|
TERMUX_PKG_ANTI_BUILD_DEPENDS="clang"
|
|
TERMUX_PKG_BREAKS="python (<< 3.11.1-1)"
|
|
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
|
TERMUX_PKG_PYTHON_COMMON_DEPS="docutils, myst_parser, sphinx_copybutton, sphinx_inline_tabs, sphinxcontrib.towncrier, completion"
|
|
|
|
termux_pkg_auto_update() {
|
|
local tag
|
|
tag="$(termux_github_api_get_tag "${TERMUX_PKG_SRCURL}" "${TERMUX_PKG_UPDATE_TAG_TYPE}")"
|
|
|
|
if grep -oP "${TERMUX_PKG_UPDATE_VERSION_REGEXP}" <<< "${tag}"; then
|
|
termux_pkg_upgrade_version "${tag}"
|
|
else
|
|
echo "INFO: No update needed, tag '${tag}' is not a stable release."
|
|
fi
|
|
}
|
|
|
|
termux_step_post_make_install() {
|
|
if [ ! -e "$TERMUX_PYTHON_HOME/site-packages/pip-$TERMUX_PKG_VERSION.dist-info" ]; then
|
|
termux_error_exit "Package ${TERMUX_PKG_NAME} doesn't build properly."
|
|
fi
|
|
( # creating pip documentation
|
|
cd docs/
|
|
python pip_sphinxext.py
|
|
sphinx-build -b man -d build/doctrees/man man build/man -c html
|
|
)
|
|
|
|
install -vDm 644 LICENSE.txt -t "$TERMUX_PREFIX/share/licenses/python-pip/"
|
|
install -vDm 644 docs/build/man/*.1 -t "$TERMUX_PREFIX/share/man/man1/"
|
|
install -vDm 644 {NEWS,README}.rst -t "$TERMUX_PREFIX/share/doc/python-pip/"
|
|
|
|
"$TERMUX_PREFIX"/bin/pip completion --bash | install -vDm 644 /dev/stdin "$TERMUX_PREFIX"/share/bash-completion/completions/pip
|
|
"$TERMUX_PREFIX"/bin/pip completion --fish | install -vDm 644 /dev/stdin "$TERMUX_PREFIX"/share/fish/vendor_completions.d/pip.fish
|
|
}
|
|
|
|
termux_step_create_debscripts() {
|
|
# disable pip update notification
|
|
cat <<- POSTINST_EOF > ./postinst
|
|
#!$TERMUX_PREFIX/bin/bash
|
|
echo "pip setup..."
|
|
pip config set --global global.disable-pip-version-check true
|
|
exit 0
|
|
POSTINST_EOF
|
|
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ]; then
|
|
echo "post_install" > postupg
|
|
fi
|
|
|
|
# deleting conf of pip while removing it
|
|
cat <<- PRERM_EOF > ./prerm
|
|
#!$TERMUX_PREFIX/bin/bash
|
|
if [ -d $TERMUX_PREFIX/etc/pip.conf ]; then
|
|
echo "Removing the pip setting..."
|
|
rm -fr $TERMUX_PREFIX/etc/pip.conf
|
|
fi
|
|
exit 0
|
|
PRERM_EOF
|
|
|
|
chmod 0755 postinst prerm
|
|
}
|