diff --git a/gpkg/python-pip/build.sh b/gpkg/python-pip/build.sh new file mode 100644 index 000000000..18f914c71 --- /dev/null +++ b/gpkg/python-pip/build.sh @@ -0,0 +1,53 @@ +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-pacman" +TERMUX_PKG_VERSION="23.3.1" +TERMUX_PKG_SRCURL=https://github.com/pypa/pip/archive/$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=4192f1ed5f8f1e01557d8c02ffd845c64d4a4567e0864ca78b74b0b5456c0f62 +TERMUX_PKG_DEPENDS="gcc-glibc, make-glibc, pkgconf-glibc, python-glibc (>= 3.11.1-1)" +TERMUX_PKG_ANTI_BUILD_DEPENDS="gcc-glibc" +TERMUX_PKG_BREAKS="python-glibc (<< 3.11.1-1)" +TERMUX_PKG_PLATFORM_INDEPENDENT=true +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_PYTHON_COMMON_DEPS="wheel, docutils, myst_parser, sphinx_copybutton, sphinx_inline_tabs, sphinxcontrib.towncrier, completion" + +termux_step_post_make_install() { + ( # 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 +} diff --git a/gpkg/python-pip/conf.py.patch b/gpkg/python-pip/conf.py.patch new file mode 100644 index 000000000..2b1a4ea5c --- /dev/null +++ b/gpkg/python-pip/conf.py.patch @@ -0,0 +1,14 @@ +--- pip-22.3.1/docs/html/conf.py 2022-11-05 18:25:43.000000000 +0300 ++++ pip-22.3.1/docs/html/conf.py.patch 2022-12-01 18:27:35.429357992 +0300 +@@ -21,11 +21,6 @@ + "sphinx.ext.intersphinx", + # our extensions + "pip_sphinxext", +- # third-party extensions +- "myst_parser", +- "sphinx_copybutton", +- "sphinx_inline_tabs", +- "sphinxcontrib.towncrier", + ] + + # General information about the project. diff --git a/gpkg/python-pip/fix-hardcoded-paths.patch b/gpkg/python-pip/fix-hardcoded-paths.patch new file mode 100644 index 000000000..9cfafd5a9 --- /dev/null +++ b/gpkg/python-pip/fix-hardcoded-paths.patch @@ -0,0 +1,19 @@ +--- pip-22.3.1/src/pip/_internal/utils/appdirs.py ++++ pip-22.3.1/src/pip/_internal/utils/appdirs.py +@@ -49,4 +49,4 @@ def site_config_dirs(appname: str) -> List[str]: + return [dirval] + + # Unix-y system. Look in /etc as well. +- return dirval.split(os.pathsep) + ["/etc"] ++ return dirval.split(os.pathsep) + ["@TERMUX_PREFIX@/etc"] +--- pip-22.3.1/src/pip/_vendor/platformdirs/unix.py ++++ pip-22.3.1/src/pip/_vendor/platformdirs/unix.py +@@ -79,7 +79,7 @@ def site_config_dir(self) -> str: + # XDG default for $XDG_CONFIG_DIRS only first, if multipath is False + path = os.environ.get("XDG_CONFIG_DIRS", "") + if not path.strip(): +- path = "/etc/xdg" ++ path = "@TERMUX_PREFIX@/etc/xdg" + return self._with_multi_path(path) + + @property diff --git a/gpkg/python-pip/install_py_preventing_pip_from_installing.patch b/gpkg/python-pip/install_py_preventing_pip_from_installing.patch new file mode 100644 index 000000000..a9d26e2c1 --- /dev/null +++ b/gpkg/python-pip/install_py_preventing_pip_from_installing.patch @@ -0,0 +1,23 @@ +--- pip-23.1/src/pip/_internal/commands/install.py 2023-04-16 00:05:42.665257200 +0100 ++++ pip-23.1.mod/src/pip/_internal/commands/install.py 2023-04-16 00:09:42.989257317 +0100 +@@ -342,6 +342,20 @@ + reqs = self.get_requirements(args, options, finder, session) + check_legacy_setup_py_options(options, reqs) + ++ reqs_list = [req.name for req in reqs] ++ while reqs_list.count("pip") != 0: ++ reqs_index = reqs_list.index("pip") ++ if len(reqs)-reqs_list.count("pip") == 0: ++ raise CommandError( ++ "Installing pip is forbidden, this will break the python-pip package (termux)." ++ ) ++ elif reqs_list.count("pip") == 1: ++ logger.warning( ++ "Skip installing pip, this will break the python-pip package (termux)." ++ ) ++ del reqs_list[reqs_index] ++ del reqs[reqs_index] ++ + wheel_cache = WheelCache(options.cache_dir) + + # Only when installing is it permitted to use PEP 660. diff --git a/gpkg-disabled/python/build.sh b/gpkg/python/build.sh similarity index 90% rename from gpkg-disabled/python/build.sh rename to gpkg/python/build.sh index 1ba405072..86dc5a1a7 100644 --- a/gpkg-disabled/python/build.sh +++ b/gpkg/python/build.sh @@ -3,12 +3,12 @@ TERMUX_PKG_DESCRIPTION="The Python programming language" TERMUX_PKG_LICENSE="custom" TERMUX_PKG_LICENSE_FILE="LICENSE" TERMUX_PKG_MAINTAINER="@termux-pacman" -TERMUX_PKG_VERSION=3.11.5 +TERMUX_PKG_VERSION=3.11.6 _MAJOR_VERSION="${TERMUX_PKG_VERSION%.*}" TERMUX_PKG_SRCURL=https://www.python.org/ftp/python/${TERMUX_PKG_VERSION%rc*}/Python-${TERMUX_PKG_VERSION}.tar.xz -TERMUX_PKG_SHA256=85cd12e9cf1d6d5a45f17f7afe1cebe7ee628d3282281c492e86adf636defa3f +TERMUX_PKG_SHA256=0fab78fa7f133f4f38210c6260d90d7c0d5c7198446419ce057ec7ac2e6f5f38 TERMUX_PKG_DEPENDS="libbz2-glibc, libexpat-glibc, gdbm-glibc, libffi-glibc, libnsl-glibc, libxcrypt-glibc, openssl-glibc, zlib-glibc" -TERMUX_PKG_BUILD_DEPENDS="sqlite-glibc, mpdecimal-glibc" +TERMUX_PKG_BUILD_DEPENDS="sqlite-glibc, mpdecimal-glibc, llvm-glibc" TERMUX_PKG_PROVIDES="python3-glibc" TERMUX_PKG_BUILD_IN_SRC=true diff --git a/gpkg-disabled/python/setdirs.patch b/gpkg/python/setdirs.patch similarity index 100% rename from gpkg-disabled/python/setdirs.patch rename to gpkg/python/setdirs.patch diff --git a/gpkg-disabled/xcb-proto/python-xcbgen.subpackage.sh b/gpkg/xcb-proto/python-xcbgen.subpackage.sh similarity index 100% rename from gpkg-disabled/xcb-proto/python-xcbgen.subpackage.sh rename to gpkg/xcb-proto/python-xcbgen.subpackage.sh