python: update to 3.11.0 (#12551)

This commit is contained in:
Ansh Dadwal 2022-10-30 03:16:27 +05:30 committed by GitHub
parent 22d94dac91
commit 9a396657b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 44 deletions

View File

@ -2,10 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://python.org/
TERMUX_PKG_DESCRIPTION="Python 3 programming language intended to enable clear programs"
TERMUX_PKG_LICENSE="PythonPL"
TERMUX_PKG_MAINTAINER="@termux"
_MAJOR_VERSION=3.10
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.8
_MAJOR_VERSION=3.11
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.0
TERMUX_PKG_SRCURL=https://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=6a30ecde59c47048013eb5a658c9b5dec277203d2793667f578df7671f7f03f3
TERMUX_PKG_SHA256=a57dc82d77358617ba65b9841cee1e3b441f386c3789ddc0676eca077f2951c3
TERMUX_PKG_DEPENDS="gdbm, libandroid-posix-semaphore, libandroid-support, libbz2, libcrypt, libexpat, libffi, liblzma, libsqlite, ncurses, ncurses-ui-libs, openssl, readline, zlib"
TERMUX_PKG_RECOMMENDS="clang, make, pkg-config"
TERMUX_PKG_SUGGESTS="python-tkinter"
@ -63,6 +63,8 @@ termux_step_pre_configure() {
# Fatal: you must define __ANDROID_API__
# if __ANDROID_API__ is not defined.
CPPFLAGS+=" -D__ANDROID_API__=$(getprop ro.build.version.sdk)"
else
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-build-python=python$_MAJOR_VERSION"
fi
}
@ -98,6 +100,7 @@ termux_step_create_debscripts() {
rm -Rf ${TERMUX_PREFIX}/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info
fi
cd ${TERMUX_PREFIX}
${TERMUX_PREFIX}/bin/python3 -m ensurepip --upgrade --default-pip
exit 0

View File

@ -1,7 +1,6 @@
diff -u -r ../Python-3.6.1/configure ./configure
--- ../Python-3.6.1/configure 2017-03-21 07:32:38.000000000 +0100
+++ ./configure 2017-03-23 23:42:47.210898734 +0100
@@ -5387,6 +5387,8 @@
--- Python-3.11.0/configure 2022-10-24 23:05:39.000000000 +0530
+++ Python-3.11.0.mod/configure 2022-10-25 10:25:57.074049746 +0530
@@ -6189,6 +6189,8 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multiarch" >&5
$as_echo_n "checking for multiarch... " >&6; }
case $ac_sys_system in #(
@ -10,21 +9,20 @@ diff -u -r ../Python-3.6.1/configure ./configure
Darwin*) :
MULTIARCH="" ;; #(
FreeBSD*) :
@@ -9295,7 +9295,7 @@
@@ -10796,7 +10798,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux-android*) ;;
+ Linux-android*) CCSHARED="-fPIC";;
Linux*|GNU*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
@@ -11293,8 +11293,6 @@
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
Emscripten*|WASI*)
if test "x$enable_wasm_dynamic_linking" = xyes; then :
@@ -15099,7 +15101,6 @@
$as_echo "$ac_cv_func_link" >&6; }
if test "x$ac_cv_func_link" = xyes; then :
-$as_echo "#define HAVE_LINK 1" >>confdefs.h
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
fi

View File

@ -119,22 +119,3 @@ diff -uNr Python-3.10.1/Modules/_multiprocessing/posix-shm-extension.c Python-3.
+ return unlink(name);
+}
diff -uNr Python-3.10.1/setup.py Python-3.10.1.mod/setup.py
--- Python-3.10.1/setup.py 2021-12-07 02:23:39.000000000 +0800
+++ Python-3.10.1.mod/setup.py 2022-02-10 17:26:38.314970000 +0800
@@ -1846,12 +1846,14 @@
sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
multiprocessing_srcs.append('_multiprocessing/semaphore.c')
self.add(Extension('_multiprocessing', multiprocessing_srcs,
+ libraries=["android-posix-semaphore"],
include_dirs=["Modules/_multiprocessing"]))
if (not MS_WINDOWS and
sysconfig.get_config_var('HAVE_SHM_OPEN') and
sysconfig.get_config_var('HAVE_SHM_UNLINK')):
- posixshmem_srcs = ['_multiprocessing/posixshmem.c']
+ posixshmem_srcs = ['_multiprocessing/posixshmem.c',
+ '_multiprocessing/posix-shm-extension.c']
libs = []
if sysconfig.get_config_var('SHM_NEEDS_LIBRT'):
# need to link with librt to get shm_open()

View File

@ -1,13 +1,23 @@
diff -uNr Python-3.8.0/setup.py Python-3.8.0.mod/setup.py
--- Python-3.8.0/setup.py 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0.mod/setup.py 2019-11-17 21:16:46.524157731 +0200
@@ -824,7 +824,8 @@
--- Python-3.11.0/setup.py 2022-10-24 23:05:39.000000000 +0530
+++ Python-3.11.0.mod/setup.py 2022-10-25 19:23:59.154046267 +0530
@@ -981,7 +981,8 @@
# Lance Ellinghaus's syslog module
# syslog daemon interface
- self.add(Extension('syslog', ['syslogmodule.c']))
+ # Termux: Add 'log' android library since we use android logging:
+ self.add(Extension('syslog', ['syslogmodule.c'], libraries=['log']))
- self.addext(Extension('syslog', ['syslogmodule.c']))
+ # Termux: Add 'log' android library since we use android logging
+ self.addext(Extension('syslog', ['syslogmodule.c'], libraries=['log']))
# Python interface to subinterpreter C-API.
self.add(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c']))
self.addext(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c']))
@@ -1328,8 +1329,8 @@
sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')
):
multiprocessing_srcs.append('_multiprocessing/semaphore.c')
- self.addext(Extension('_multiprocessing', multiprocessing_srcs))
- self.addext(Extension('_posixshmem', ['_multiprocessing/posixshmem.c']))
+ self.addext(Extension('_multiprocessing', multiprocessing_srcs, libraries=["android-posix-semaphore"]))
+ self.addext(Extension('_posixshmem', ['_multiprocessing/posixshmem.c','_multiprocessing/posix-shm-extension.c']))
def detect_uuid(self):
# Build the _uuid module if possible