aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/python3
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2021-08-17 19:02:33 +1000
committerfuzzard <fuzzard@kodi.tv>2021-10-24 10:53:37 +1000
commit3572925dc500fc656ddc0dd3a919a5adb47ed448 (patch)
treeed9bf7aca0f2849d66ffc508611615c977bbc555 /tools/depends/target/python3
parentaf1a27d411be227b5de480255a8e042d03b6be6e (diff)
[tools/depends][target] python3 Move crypt.h include from public header
backport https://github.com/python/cpython/pull/27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
Diffstat (limited to 'tools/depends/target/python3')
-rw-r--r--tools/depends/target/python3/01-GH-27394-move-crypt-h.patch34
-rw-r--r--tools/depends/target/python3/Makefile3
2 files changed, 36 insertions, 1 deletions
diff --git a/tools/depends/target/python3/01-GH-27394-move-crypt-h.patch b/tools/depends/target/python3/01-GH-27394-move-crypt-h.patch
new file mode 100644
index 0000000000..352eaa48cd
--- /dev/null
+++ b/tools/depends/target/python3/01-GH-27394-move-crypt-h.patch
@@ -0,0 +1,34 @@
+--- a/Include/Python.h
++++ b/Include/Python.h
+@@ -35,19 +35,6 @@
+ #ifndef MS_WINDOWS
+ #include <unistd.h>
+ #endif
+-#ifdef HAVE_CRYPT_H
+-#if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE)
+-/* Required for glibc to expose the crypt_r() function prototype. */
+-# define _GNU_SOURCE
+-# define _Py_GNU_SOURCE_FOR_CRYPT
+-#endif
+-#include <crypt.h>
+-#ifdef _Py_GNU_SOURCE_FOR_CRYPT
+-/* Don't leak the _GNU_SOURCE define to other headers. */
+-# undef _GNU_SOURCE
+-# undef _Py_GNU_SOURCE_FOR_CRYPT
+-#endif
+-#endif
+
+ /* For size_t? */
+ #ifdef HAVE_STDDEF_H
+--- a/Modules/_cryptmodule.c
++++ b/Modules/_cryptmodule.c
+@@ -4,6 +4,9 @@
+ #include "Python.h"
+
+ #include <sys/types.h>
++#ifdef HAVE_CRYPT_H
++#include <crypt.h>
++#endif
+
+ /* Module crypt */
+
diff --git a/tools/depends/target/python3/Makefile b/tools/depends/target/python3/Makefile
index 0d9b683c15..bd5c5466fc 100644
--- a/tools/depends/target/python3/Makefile
+++ b/tools/depends/target/python3/Makefile
@@ -1,6 +1,6 @@
include ../../Makefile.include
DEPS= ../../Makefile.include Makefile apple.patch crosscompile.patch android.patch \
- modules.setup darwin_embedded.patch
+ modules.setup darwin_embedded.patch 01-GH-27394-move-crypt-h.patch
# lib name, version
LIBNAME=Python
@@ -47,6 +47,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
cd $(PLATFORM); patch -p1 -i ../crosscompile.patch
cd $(PLATFORM); patch -p1 -i ../android.patch
cd $(PLATFORM); patch -p1 -i ../apple.patch
+ cd $(PLATFORM); patch -p1 -i ../01-GH-27394-move-crypt-h.patch
ifeq ($(OS),darwin_embedded)
cd $(PLATFORM); patch -p1 -i ../darwin_embedded.patch
endif