python3: fix build with SSL module
authorAlexandru Ardelean <redacted>
Mon, 17 Sep 2018 09:53:39 +0000 (12:53 +0300)
committerAlexandru Ardelean <redacted>
Mon, 17 Sep 2018 09:53:57 +0000 (12:53 +0300)
No idea how this creeped up. Probably OpenSSL been has updated recently.
Will send this patch upstream as well, but in the meantime we should fix
the Python3 build.

Build error seems to be:
```
<openwrt>/build_dir/target-i386_pentium4_musl/Python-3.7.0/Modules/_ssl.c:4000:5: error: implicit declaration of function 'DH_free'; did you mean 'lh_free'? [-Werror=implicit-function-declaration]
     DH_free(dh);
     ^~~~~~~
     lh_free
cc1: some warnings being treated as errors

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_tkinter              _uuid                 nis
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc                  atexit                pwd
time                  zlib

Failed to build these modules:
_ssl

Makefile:618: recipe for target 'sharedmods' failed
```

Signed-off-by: Alexandru Ardelean <redacted>
lang/python/python3/Makefile
lang/python/python3/patches/002-fix-implicit-dh-free-declaration.patch [new file with mode: 0644]

index 5c277242fbe878c1c69670057bbd0aa73156f5a9..fcaf6b7ab6aef30e17539e8211e5fc4ca437478d 100644 (file)
@@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
 PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
 
 PKG_NAME:=python3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
diff --git a/lang/python/python3/patches/002-fix-implicit-dh-free-declaration.patch b/lang/python/python3/patches/002-fix-implicit-dh-free-declaration.patch
new file mode 100644 (file)
index 0000000..46cfa9b
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+index 2bce4816d2..3c93884809 100644
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -63,6 +63,7 @@ static PySocketModule_APIObject PySocketModule;
+ #include "openssl/err.h"
+ #include "openssl/rand.h"
+ #include "openssl/bio.h"
++#include "openssl/dh.h"
+ #ifndef HAVE_X509_VERIFY_PARAM_SET1_HOST
+ #  ifdef LIBRESSL_VERSION_NUMBER
git clone https://git.99rst.org/PROJECT