summaryrefslogtreecommitdiff
path: root/lang/python/python3/patches
diff options
context:
space:
mode:
Diffstat (limited to 'lang/python/python3/patches')
-rw-r--r--lang/python/python3/patches/001-enable-zlib.patch2
-rw-r--r--lang/python/python3/patches/003-do-not-run-distutils-tests.patch18
-rw-r--r--lang/python/python3/patches/004-do-not-write-bytes-codes.patch2
-rw-r--r--lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch2
-rw-r--r--lang/python/python3/patches/008-distutils-use-python-sysroot.patch42
-rw-r--r--lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch13
-rw-r--r--lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch28
-rw-r--r--lang/python/python3/patches/014-remove-platform-so-suffix.patch4
-rw-r--r--lang/python/python3/patches/015-abort-on-failed-modules.patch10
-rw-r--r--lang/python/python3/patches/016-adjust-config-paths.patch30
-rw-r--r--lang/python/python3/patches/025-choose-python-config-version.patch2
-rw-r--r--lang/python/python3/patches/026-openssl-feature-flags.patch12
-rw-r--r--lang/python/python3/patches/027-bpo-43158-Use-configure-values-for-building-_uuid-ex.patch151
-rw-r--r--lang/python/python3/patches/028-host-python-support-ssl-with-libressl.patch117
-rw-r--r--lang/python/python3/patches/029-disable-deprecation-warning.patch10
15 files changed, 327 insertions, 116 deletions
diff --git a/lang/python/python3/patches/001-enable-zlib.patch b/lang/python/python3/patches/001-enable-zlib.patch
index 76e83087a..75766ee19 100644
--- a/lang/python/python3/patches/001-enable-zlib.patch
+++ b/lang/python/python3/patches/001-enable-zlib.patch
@@ -1,6 +1,6 @@
--- a/Modules/Setup
+++ b/Modules/Setup
-@@ -338,7 +338,7 @@ _symtable symtablemodule.c
+@@ -343,7 +343,7 @@ _symtable symtablemodule.c
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
diff --git a/lang/python/python3/patches/003-do-not-run-distutils-tests.patch b/lang/python/python3/patches/003-do-not-run-distutils-tests.patch
deleted file mode 100644
index 544fdbed8..000000000
--- a/lang/python/python3/patches/003-do-not-run-distutils-tests.patch
+++ /dev/null
@@ -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.
diff --git a/lang/python/python3/patches/004-do-not-write-bytes-codes.patch b/lang/python/python3/patches/004-do-not-write-bytes-codes.patch
index edd375ea3..eec149b3c 100644
--- a/lang/python/python3/patches/004-do-not-write-bytes-codes.patch
+++ b/lang/python/python3/patches/004-do-not-write-bytes-codes.patch
@@ -1,6 +1,6 @@
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
-@@ -158,7 +158,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo
+@@ -155,7 +155,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo
int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */
int Py_FrozenFlag = 0; /* Needed by getpath.c */
int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */
diff --git a/lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch b/lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch
index 733340fd0..76c8f8c9c 100644
--- a/lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch
+++ b/lang/python/python3/patches/006-do-not-add-multiarch-paths-when-cross-compiling.patch
@@ -1,6 +1,6 @@
--- a/setup.py
+++ b/setup.py
-@@ -737,7 +737,8 @@ class PyBuildExt(build_ext):
+@@ -816,7 +816,8 @@ class PyBuildExt(build_ext):
# only change this for cross builds for 3.3, issues on Mageia
if CROSS_COMPILING:
self.add_cross_compiling_paths()
diff --git a/lang/python/python3/patches/008-distutils-use-python-sysroot.patch b/lang/python/python3/patches/008-distutils-use-python-sysroot.patch
index f218c46d5..26f22d7df 100644
--- a/lang/python/python3/patches/008-distutils-use-python-sysroot.patch
+++ b/lang/python/python3/patches/008-distutils-use-python-sysroot.patch
@@ -17,7 +17,7 @@ third-party Python modules.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Lib/distutils/command/build_ext.py | 5 ++++-
- Lib/distutils/sysconfig.py | 15 +++++++++++----
+ Lib/sysconfig.py | 15 +++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
--- a/Lib/distutils/command/build_ext.py
@@ -34,27 +34,27 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
else:
# building python standard extensions
self.library_dirs.append('.')
---- a/Lib/distutils/sysconfig.py
-+++ b/Lib/distutils/sysconfig.py
-@@ -17,10 +17,17 @@ import sys
- from .errors import DistutilsPlatformError
-
- # These are needed in a couple of spots, so just compute them once.
--PREFIX = os.path.normpath(sys.prefix)
--EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
--BASE_PREFIX = os.path.normpath(sys.base_prefix)
--BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -123,10 +123,17 @@ _SCHEME_KEYS = ('stdlib', 'platstdlib',
+ _PY_VERSION = sys.version.split()[0]
+ _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}'
+ _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}'
+-_PREFIX = os.path.normpath(sys.prefix)
+-_BASE_PREFIX = os.path.normpath(sys.base_prefix)
+-_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+-_BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
+if "_python_sysroot" in os.environ:
+ _sysroot=os.environ.get('_python_sysroot')
-+ PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
-+ EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix'))
-+ BASE_PREFIX = PREFIX
-+ BASE_EXEC_PREFIX = EXEC_PREFIX
++ _PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
++ _EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix'))
++ _BASE_PREFIX = _PREFIX
++ _BASE_EXEC_PREFIX = _EXEC_PREFIX
+else:
-+ PREFIX = os.path.normpath(sys.prefix)
-+ EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
-+ BASE_PREFIX = os.path.normpath(sys.base_prefix)
-+ BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
++ _PREFIX = os.path.normpath(sys.prefix)
++ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++ _BASE_PREFIX = os.path.normpath(sys.base_prefix)
++ _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
+ _CONFIG_VARS = None
+ _USER_BASE = None
- # Path to the base directory of the project. On Windows the binary may
- # live in project/PCbuild/win32 or project/PCbuild/amd64.
diff --git a/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
deleted file mode 100644
index ee0c8124e..000000000
--- a/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
+++ /dev/null
@@ -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)
diff --git a/lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch b/lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch
deleted file mode 100644
index 0a987d6b4..000000000
--- a/lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch
+++ /dev/null
@@ -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)`\"" \
diff --git a/lang/python/python3/patches/014-remove-platform-so-suffix.patch b/lang/python/python3/patches/014-remove-platform-so-suffix.patch
index 39166073f..db9c3f399 100644
--- a/lang/python/python3/patches/014-remove-platform-so-suffix.patch
+++ b/lang/python/python3/patches/014-remove-platform-so-suffix.patch
@@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
-@@ -15390,7 +15390,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
+@@ -15407,7 +15407,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
$as_echo "$ABIFLAGS" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
$as_echo_n "checking SOABI... " >&6; }
@@ -11,7 +11,7 @@
--- a/configure.ac
+++ b/configure.ac
-@@ -4800,7 +4800,7 @@ AC_SUBST(SOABI)
+@@ -4798,7 +4798,7 @@ AC_SUBST(SOABI)
AC_MSG_CHECKING(ABIFLAGS)
AC_MSG_RESULT($ABIFLAGS)
AC_MSG_CHECKING(SOABI)
diff --git a/lang/python/python3/patches/015-abort-on-failed-modules.patch b/lang/python/python3/patches/015-abort-on-failed-modules.patch
deleted file mode 100644
index bd367a0a7..000000000
--- a/lang/python/python3/patches/015-abort-on-failed-modules.patch
+++ /dev/null
@@ -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[:]
diff --git a/lang/python/python3/patches/016-adjust-config-paths.patch b/lang/python/python3/patches/016-adjust-config-paths.patch
index 338892d88..c6583bea9 100644
--- a/lang/python/python3/patches/016-adjust-config-paths.patch
+++ b/lang/python/python3/patches/016-adjust-config-paths.patch
@@ -1,26 +1,16 @@
---- a/Lib/distutils/sysconfig.py
-+++ b/Lib/distutils/sysconfig.py
-@@ -451,6 +451,7 @@ def _init_posix():
- platform=sys.platform,
- multiarch=getattr(sys.implementation, '_multiarch', ''),
- ))
-+ name = '_sysconfigdata'
- _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
- build_time_vars = _temp.build_time_vars
- global _config_vars
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
-@@ -352,6 +352,7 @@ def get_makefile_filename():
+@@ -407,6 +407,7 @@ def get_makefile_filename():
def _get_sysconfigdata_name():
+ return '_sysconfigdata'
- return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
- '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
- abi=sys.abiflags,
+ multiarch = getattr(sys.implementation, '_multiarch', '')
+ return os.environ.get(
+ '_PYTHON_SYSCONFIGDATA_NAME',
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1555,7 +1555,7 @@ libinstall: build_all $(srcdir)/Modules/
+@@ -1594,7 +1594,7 @@ libinstall: build_all $(srcdir)/Modules/
esac; \
done; \
done
@@ -28,8 +18,8 @@
+ $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
$(DESTDIR)$(LIBDEST); \
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- ifeq (@COMPILE_ALL_TESTS@,yes)
-@@ -1713,7 +1713,7 @@ sharedinstall: sharedmods
+ if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+@@ -1752,7 +1752,7 @@ sharedinstall: sharedmods
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
--root=$(DESTDIR)/
@@ -40,7 +30,7 @@
# Here are a couple of targets for MacOSX again, to install a full
--- a/configure
+++ b/configure
-@@ -2979,7 +2979,7 @@ $as_echo_n "checking for python interpre
+@@ -3009,7 +3009,7 @@ $as_echo_n "checking for python interpre
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
$as_echo "$interp" >&6; }
@@ -49,7 +39,7 @@
fi
elif test "$cross_compiling" = maybe; then
as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
-@@ -15460,7 +15460,7 @@ fi
+@@ -15477,7 +15477,7 @@ fi
@@ -69,7 +59,7 @@
fi
elif test "$cross_compiling" = maybe; then
AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
-@@ -4858,7 +4858,7 @@ fi],
+@@ -4856,7 +4856,7 @@ fi],
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
AC_SUBST(PY_ENABLE_SHARED)
diff --git a/lang/python/python3/patches/025-choose-python-config-version.patch b/lang/python/python3/patches/025-choose-python-config-version.patch
index cfca3236f..7b9ee1e6b 100644
--- a/lang/python/python3/patches/025-choose-python-config-version.patch
+++ b/lang/python/python3/patches/025-choose-python-config-version.patch
@@ -1,6 +1,6 @@
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1607,7 +1607,7 @@ python-config: $(srcdir)/Misc/python-con
+@@ -1644,7 +1644,7 @@ python-config: $(srcdir)/Misc/python-con
@ # On Darwin, always use the python version of the script, the shell
@ # version doesn't use the compiler customizations that are provided
@ # in python (_osx_support.py).
diff --git a/lang/python/python3/patches/026-openssl-feature-flags.patch b/lang/python/python3/patches/026-openssl-feature-flags.patch
new file mode 100644
index 000000000..398012ae4
--- /dev/null
+++ b/lang/python/python3/patches/026-openssl-feature-flags.patch
@@ -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;
+
diff --git a/lang/python/python3/patches/027-bpo-43158-Use-configure-values-for-building-_uuid-ex.patch b/lang/python/python3/patches/027-bpo-43158-Use-configure-values-for-building-_uuid-ex.patch
new file mode 100644
index 000000000..c58e10537
--- /dev/null
+++ b/lang/python/python3/patches/027-bpo-43158-Use-configure-values-for-building-_uuid-ex.patch
@@ -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')
+
diff --git a/lang/python/python3/patches/028-host-python-support-ssl-with-libressl.patch b/lang/python/python3/patches/028-host-python-support-ssl-with-libressl.patch
new file mode 100644
index 000000000..759b66292
--- /dev/null
+++ b/lang/python/python3/patches/028-host-python-support-ssl-with-libressl.patch
@@ -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
diff --git a/lang/python/python3/patches/029-disable-deprecation-warning.patch b/lang/python/python3/patches/029-disable-deprecation-warning.patch
new file mode 100644
index 000000000..fd638d4b5
--- /dev/null
+++ b/lang/python/python3/patches/029-disable-deprecation-warning.patch
@@ -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)