python3: bump to version 3.10.0lilik-openwrt-22.03
@ -0,0 +1,17 @@ | |||||
# | |||||
# Copyright (C) 2021 Alexandru Ardelean <ardeleanalex@gmail.com> | |||||
# | |||||
# This is free software, licensed under the GNU General Public License v2. | |||||
# See /LICENSE for more information. | |||||
# | |||||
define Package/python3-uuid | |||||
$(call Package/python3/Default) | |||||
TITLE:=Python $(PYTHON3_VERSION) UUID module | |||||
DEPENDS:=+python3-light +libuuid | |||||
endef | |||||
$(eval $(call Py3BasePackage,python3-uuid, \ | |||||
/usr/lib/python$(PYTHON3_VERSION)/uuid.py \ | |||||
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_uuid.$(PYTHON3_SO_SUFFIX) \ | |||||
)) |
@ -1,16 +0,0 @@ | |||||
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848136 | |||||
https://sources.debian.org/patches/python-setuptools/40.8.0-1/reproducible.diff/ | |||||
Index: b/setuptools/command/easy_install.py | |||||
=================================================================== | |||||
--- a/setuptools/command/easy_install.py | |||||
+++ b/setuptools/command/easy_install.py | |||||
@@ -423,7 +423,7 @@ class easy_install(Command): | |||||
for spec in self.args: | |||||
self.easy_install(spec, not self.no_deps) | |||||
if self.record: | |||||
- outputs = self.outputs | |||||
+ outputs = list(sorted(self.outputs)) | |||||
if self.root: # strip any package prefix | |||||
root_len = len(self.root) | |||||
for counter in range(len(outputs)): |
@ -1,16 +0,0 @@ | |||||
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804249 | |||||
https://sources.debian.org/patches/python-setuptools/40.8.0-1/sorted-requires.diff/ | |||||
Index: b/setuptools/command/egg_info.py | |||||
=================================================================== | |||||
--- a/setuptools/command/egg_info.py | |||||
+++ b/setuptools/command/egg_info.py | |||||
@@ -641,7 +641,7 @@ def _write_requirements(stream, reqs): | |||||
def append_cr(line): | |||||
return line + '\n' | |||||
- lines = map(append_cr, lines) | |||||
+ lines = map(append_cr, sorted(lines)) | |||||
stream.writelines(lines) | |||||
@ -1,14 +0,0 @@ | |||||
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894215 | |||||
https://sources.debian.org/patches/python-setuptools/40.8.0-1/PKG-INFO-output-reproducible.diff/ | |||||
--- a/setuptools/dist.py | |||||
+++ b/setuptools/dist.py | |||||
@@ -193,7 +193,7 @@ def write_pkg_file(self, file): | |||||
self.long_description_content_type | |||||
) | |||||
if self.provides_extras: | |||||
- for extra in self.provides_extras: | |||||
+ for extra in sorted(self.provides_extras): | |||||
write_field('Provides-Extra', extra) | |||||
@ -1,18 +0,0 @@ | |||||
--- a/Makefile.pre.in | |||||
+++ b/Makefile.pre.in | |||||
@@ -1546,6 +1546,7 @@ libinstall: build_all $(srcdir)/Modules/ | |||||
$(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \ | |||||
$(DESTDIR)$(LIBDEST); \ | |||||
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt | |||||
+ifeq (@COMPILE_ALL_TESTS@,yes) | |||||
if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ | |||||
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ | |||||
$(DESTDIR)$(LIBDEST)/distutils/tests ; \ | |||||
@@ -1581,6 +1582,7 @@ libinstall: build_all $(srcdir)/Modules/ | |||||
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt | |||||
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | |||||
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt | |||||
+endif | |||||
# bpo-21536: Misc/python-config.sh is generated in the build directory | |||||
# from $(srcdir)Misc/python-config.sh.in. |
@ -1,13 +0,0 @@ | |||||
--- a/setup.py | |||||
+++ b/setup.py | |||||
@@ -714,8 +714,9 @@ class PyBuildExt(build_ext): | |||||
# directly since an inconsistently reproducible issue comes up where | |||||
# the environment variable is not set even though the value were passed | |||||
# into configure and stored in the Makefile (issue found on OS X 10.3). | |||||
+ rt_lib_dirs = [] if CROSS_COMPILING else self.compiler.runtime_library_dirs | |||||
for env_var, arg_name, dir_list in ( | |||||
- ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), | |||||
+ ('LDFLAGS', '-R', rt_lib_dirs), | |||||
('LDFLAGS', '-L', self.compiler.library_dirs), | |||||
('CPPFLAGS', '-I', self.compiler.include_dirs)): | |||||
env_val = sysconfig.get_config_var(env_var) |
@ -1,28 +0,0 @@ | |||||
--- a/Makefile.pre.in | |||||
+++ b/Makefile.pre.in | |||||
@@ -774,6 +774,16 @@ regen-all: regen-opcode regen-opcode-tar | |||||
############################################################################ | |||||
# Special rules for object files | |||||
+DATE_FMT = %b %d %Y | |||||
+TIME_FMT = %H:%M:%S | |||||
+ifdef SOURCE_DATE_EPOCH | |||||
+ BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)") | |||||
+ BUILD_TIME ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)" 2>/dev/null || date -u "+$(TIME_FMT)") | |||||
+else | |||||
+ BUILD_DATE ?= $(shell date "+$(DATE_FMT)") | |||||
+ BUILD_TIME ?= $(shell date "+$(TIME_FMT)") | |||||
+endif | |||||
+ | |||||
Modules/getbuildinfo.o: $(PARSER_OBJS) \ | |||||
$(OBJECT_OBJS) \ | |||||
$(PYTHON_OBJS) \ | |||||
@@ -782,6 +792,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ | |||||
$(DTRACE_OBJS) \ | |||||
$(srcdir)/Modules/getbuildinfo.c | |||||
$(CC) -c $(PY_CORE_CFLAGS) \ | |||||
+ -DDATE="\"$(BUILD_DATE)\"" \ | |||||
+ -DTIME="\"$(BUILD_TIME)\"" \ | |||||
-DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \ | |||||
-DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \ | |||||
-DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \ |
@ -1,10 +0,0 @@ | |||||
--- a/setup.py | |||||
+++ b/setup.py | |||||
@@ -521,6 +521,7 @@ class PyBuildExt(build_ext): | |||||
print("Failed to build these modules:") | |||||
print_three_column(failed) | |||||
print() | |||||
+ if CROSS_COMPILING: sys.exit(1) | |||||
if self.failed_on_import: | |||||
failed = self.failed_on_import[:] |
@ -0,0 +1,12 @@ | |||||
--- a/Modules/_hashopenssl.c | |||||
+++ b/Modules/_hashopenssl.c | |||||
@@ -43,7 +43,9 @@ | |||||
#define PY_OPENSSL_HAS_SCRYPT 1 | |||||
#define PY_OPENSSL_HAS_SHA3 1 | |||||
#define PY_OPENSSL_HAS_SHAKE 1 | |||||
+#ifndef OPENSSL_NO_BLAKE2 | |||||
#define PY_OPENSSL_HAS_BLAKE2 1 | |||||
+#endif | |||||
static PyModuleDef _hashlibmodule; | |||||
@ -0,0 +1,151 @@ | |||||
From bab9f2f21b6b27563fe53ae30ba4bf05934ed6f9 Mon Sep 17 00:00:00 2001 | |||||
From: Christian Heimes <christian@python.org> | |||||
Date: Mon, 1 Nov 2021 12:52:04 +0100 | |||||
Subject: [PATCH] bpo-43158: Use configure values for building _uuid extension | |||||
Signed-off-by: Christian Heimes <christian@python.org> | |||||
--- | |||||
.../2021-11-01-12-51-46.bpo-43158.fghS6w.rst | 2 + | |||||
configure | 69 +++++++++++++++++++ | |||||
configure.ac | 7 +- | |||||
pyconfig.h.in | 3 + | |||||
setup.py | 12 ++-- | |||||
5 files changed, 86 insertions(+), 7 deletions(-) | |||||
create mode 100644 Misc/NEWS.d/next/Build/2021-11-01-12-51-46.bpo-43158.fghS6w.rst | |||||
--- /dev/null | |||||
+++ b/Misc/NEWS.d/next/Build/2021-11-01-12-51-46.bpo-43158.fghS6w.rst | |||||
@@ -0,0 +1,2 @@ | |||||
+``setup.py`` now uses values from configure script to build the ``_uuid`` | |||||
+extension module. Configure now detects util-linux's ``libuuid``, too. | |||||
--- a/configure | |||||
+++ b/configure | |||||
@@ -10038,6 +10038,75 @@ $as_echo "no" >&6; } | |||||
fi | |||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |||||
+save_LIBS=$LIBS | |||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate_time_safe" >&5 | |||||
+$as_echo_n "checking for library containing uuid_generate_time_safe... " >&6; } | |||||
+if ${ac_cv_search_uuid_generate_time_safe+:} false; then : | |||||
+ $as_echo_n "(cached) " >&6 | |||||
+else | |||||
+ ac_func_search_save_LIBS=$LIBS | |||||
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |||||
+/* end confdefs.h. */ | |||||
+ | |||||
+/* Override any GCC internal prototype to avoid an error. | |||||
+ Use char because int might match the return type of a GCC | |||||
+ builtin and then its argument prototype would still apply. */ | |||||
+#ifdef __cplusplus | |||||
+extern "C" | |||||
+#endif | |||||
+char uuid_generate_time_safe (); | |||||
+int | |||||
+main () | |||||
+{ | |||||
+return uuid_generate_time_safe (); | |||||
+ ; | |||||
+ return 0; | |||||
+} | |||||
+_ACEOF | |||||
+for ac_lib in '' uuid; do | |||||
+ if test -z "$ac_lib"; then | |||||
+ ac_res="none required" | |||||
+ else | |||||
+ ac_res=-l$ac_lib | |||||
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |||||
+ fi | |||||
+ if ac_fn_c_try_link "$LINENO"; then : | |||||
+ ac_cv_search_uuid_generate_time_safe=$ac_res | |||||
+fi | |||||
+rm -f core conftest.err conftest.$ac_objext \ | |||||
+ conftest$ac_exeext | |||||
+ if ${ac_cv_search_uuid_generate_time_safe+:} false; then : | |||||
+ break | |||||
+fi | |||||
+done | |||||
+if ${ac_cv_search_uuid_generate_time_safe+:} false; then : | |||||
+ | |||||
+else | |||||
+ ac_cv_search_uuid_generate_time_safe=no | |||||
+fi | |||||
+rm conftest.$ac_ext | |||||
+LIBS=$ac_func_search_save_LIBS | |||||
+fi | |||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate_time_safe" >&5 | |||||
+$as_echo "$ac_cv_search_uuid_generate_time_safe" >&6; } | |||||
+ac_res=$ac_cv_search_uuid_generate_time_safe | |||||
+if test "$ac_res" != no; then : | |||||
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |||||
+ | |||||
+ | |||||
+$as_echo "#define HAVE_LIBUUID 1" >>confdefs.h | |||||
+, | |||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |||||
+$as_echo "yes" >&6; } | |||||
+ | |||||
+else | |||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |||||
+$as_echo "no" >&6; } | |||||
+ | |||||
+fi | |||||
+ | |||||
+LIBS=$save_LIBS | |||||
+ | |||||
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007) | |||||
# FreeBSD and OpenBSD provides support as well | |||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5 | |||||
--- a/configure.ac | |||||
+++ b/configure.ac | |||||
@@ -2859,8 +2859,13 @@ void *x = uuid_generate_time_safe | |||||
[AC_MSG_RESULT(no)] | |||||
) | |||||
+# check for libuuid from util-linux | |||||
+save_LIBS=$LIBS | |||||
+AC_CHECK_LIB([uuid], [uuid_generate_time]) | |||||
+LIBS=$save_LIBS | |||||
+ | |||||
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007) | |||||
-# FreeBSD and OpenBSD provides support as well | |||||
+# FreeBSD and OpenBSD provides support in libc as well. | |||||
AC_MSG_CHECKING(for uuid_create) | |||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[ | |||||
#ifndef uuid_create | |||||
--- a/pyconfig.h.in | |||||
+++ b/pyconfig.h.in | |||||
@@ -628,6 +628,9 @@ | |||||
/* Define to 1 if you have the <libutil.h> header file. */ | |||||
#undef HAVE_LIBUTIL_H | |||||
+/* Define you have libuuid. */ | |||||
+#undef HAVE_LIBUUID | |||||
+ | |||||
/* Define if you have the 'link' function. */ | |||||
#undef HAVE_LINK | |||||
--- a/setup.py | |||||
+++ b/setup.py | |||||
@@ -1850,15 +1850,15 @@ class PyBuildExt(build_ext): | |||||
def detect_uuid(self): | |||||
# Build the _uuid module if possible | |||||
- uuid_incs = find_file("uuid.h", self.inc_dirs, ["/usr/include/uuid"]) | |||||
- if uuid_incs is not None: | |||||
- if self.compiler.find_library_file(self.lib_dirs, 'uuid'): | |||||
- uuid_libs = ['uuid'] | |||||
+ uuid_h = sysconfig.get_config_var("HAVE_UUID_H") | |||||
+ uuid_uuid_h = sysconfig.get_config_var("HAVE_UUID_UUID_H") | |||||
+ if uuid_h or uuid_uuid_h: | |||||
+ if sysconfig.get_config_var("HAVE_LIBUUID"): | |||||
+ uuid_libs = ["uuid"] | |||||
else: | |||||
uuid_libs = [] | |||||
self.add(Extension('_uuid', ['_uuidmodule.c'], | |||||
- libraries=uuid_libs, | |||||
- include_dirs=uuid_incs)) | |||||
+ libraries=uuid_libs)) | |||||
else: | |||||
self.missing.append('_uuid') | |||||
@ -0,0 +1,117 @@ | |||||
--- a/Modules/_ssl.c | |||||
+++ b/Modules/_ssl.c | |||||
@@ -67,7 +67,18 @@ | |||||
# error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL" | |||||
#endif | |||||
+#ifdef OPENWRT_HOST_BUILD | |||||
+#undef TLS1_3_VERSION | |||||
+static STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s) | |||||
+{ | |||||
+ return NULL; | |||||
+} | |||||
+static int SSL_CTX_get_security_level(const SSL_CTX *ctx) | |||||
+{ | |||||
+ return 0; | |||||
+} | |||||
+#endif | |||||
struct py_ssl_error_code { | |||||
const char *mnemonic; | |||||
@@ -291,8 +302,10 @@ typedef struct { | |||||
int post_handshake_auth; | |||||
#endif | |||||
PyObject *msg_cb; | |||||
+#ifndef OPENWRT_HOST_BUILD | |||||
PyObject *keylog_filename; | |||||
BIO *keylog_bio; | |||||
+#endif | |||||
/* Cached module state, also used in SSLSocket and SSLSession code. */ | |||||
_sslmodulestate *state; | |||||
} PySSLContext; | |||||
@@ -2346,8 +2359,14 @@ _ssl__SSLSocket_write_impl(PySSLSocket * | |||||
do { | |||||
PySSL_BEGIN_ALLOW_THREADS | |||||
+#ifdef OPENWRT_HOST_BUILD | |||||
+ retval = SSL_write(self->ssl, b->buf, (int)b->len); | |||||
+ if (retval > 0) count = retval; | |||||
+ err = _PySSL_errno(retval <= 0, self->ssl, retval); | |||||
+#else | |||||
retval = SSL_write_ex(self->ssl, b->buf, (size_t)b->len, &count); | |||||
err = _PySSL_errno(retval == 0, self->ssl, retval); | |||||
+#endif | |||||
PySSL_END_ALLOW_THREADS | |||||
self->err = err; | |||||
@@ -2498,8 +2517,14 @@ _ssl__SSLSocket_read_impl(PySSLSocket *s | |||||
do { | |||||
PySSL_BEGIN_ALLOW_THREADS | |||||
+#ifdef OPENWRT_HOST_BUILD | |||||
+ retval = SSL_read(self->ssl, mem, len); | |||||
+ if (retval > 0) count = retval; | |||||
+ err = _PySSL_errno(retval <= 0, self->ssl, retval); | |||||
+#else | |||||
retval = SSL_read_ex(self->ssl, mem, (size_t)len, &count); | |||||
err = _PySSL_errno(retval == 0, self->ssl, retval); | |||||
+#endif | |||||
PySSL_END_ALLOW_THREADS | |||||
self->err = err; | |||||
@@ -3062,8 +3087,10 @@ _ssl__SSLContext_impl(PyTypeObject *type | |||||
self->hostflags = X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS; | |||||
self->protocol = proto_version; | |||||
self->msg_cb = NULL; | |||||
+#ifndef OPENWRT_HOST_BUILD | |||||
self->keylog_filename = NULL; | |||||
self->keylog_bio = NULL; | |||||
+#endif | |||||
self->alpn_protocols = NULL; | |||||
self->set_sni_cb = NULL; | |||||
self->state = get_ssl_state(module); | |||||
@@ -3187,6 +3214,7 @@ context_clear(PySSLContext *self) | |||||
{ | |||||
Py_CLEAR(self->set_sni_cb); | |||||
Py_CLEAR(self->msg_cb); | |||||
+#ifndef OPENWRT_HOST_BUILD | |||||
Py_CLEAR(self->keylog_filename); | |||||
if (self->keylog_bio != NULL) { | |||||
PySSL_BEGIN_ALLOW_THREADS | |||||
@@ -3194,6 +3222,7 @@ context_clear(PySSLContext *self) | |||||
PySSL_END_ALLOW_THREADS | |||||
self->keylog_bio = NULL; | |||||
} | |||||
+#endif | |||||
return 0; | |||||
} | |||||
@@ -4603,8 +4632,10 @@ static PyGetSetDef context_getsetlist[] | |||||
(setter) set_minimum_version, NULL}, | |||||
{"maximum_version", (getter) get_maximum_version, | |||||
(setter) set_maximum_version, NULL}, | |||||
+#ifndef OPENWRT_HOST_BUILD | |||||
{"keylog_filename", (getter) _PySSLContext_get_keylog_filename, | |||||
(setter) _PySSLContext_set_keylog_filename, NULL}, | |||||
+#endif | |||||
{"_msg_callback", (getter) _PySSLContext_get_msg_callback, | |||||
(setter) _PySSLContext_set_msg_callback, NULL}, | |||||
{"sni_callback", (getter) get_sni_callback, | |||||
--- a/Modules/_ssl/debughelpers.c | |||||
+++ b/Modules/_ssl/debughelpers.c | |||||
@@ -114,6 +114,8 @@ _PySSLContext_set_msg_callback(PySSLCont | |||||
return 0; | |||||
} | |||||
+#ifndef OPENWRT_HOST_BUILD | |||||
+ | |||||
static void | |||||
_PySSL_keylog_callback(const SSL *ssl, const char *line) | |||||
{ | |||||
@@ -217,3 +219,5 @@ _PySSLContext_set_keylog_filename(PySSLC | |||||
SSL_CTX_set_keylog_callback(self->ctx, _PySSL_keylog_callback); | |||||
return 0; | |||||
} | |||||
+ | |||||
+#endif |
@ -0,0 +1,10 @@ | |||||
--- a/Lib/distutils/__init__.py | |||||
+++ b/Lib/distutils/__init__.py | |||||
@@ -16,5 +16,5 @@ __version__ = sys.version[:sys.version.i | |||||
_DEPRECATION_MESSAGE = ("The distutils package is deprecated and slated for " | |||||
"removal in Python 3.12. Use setuptools or check " | |||||
"PEP 632 for potential alternatives") | |||||
-warnings.warn(_DEPRECATION_MESSAGE, | |||||
- DeprecationWarning, 2) | |||||
+#warnings.warn(_DEPRECATION_MESSAGE, | |||||
+# DeprecationWarning, 2) |