[Midnightbsd-cvs] mports [23325] trunk/lang/python34/files: update python
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed May 2 23:16:59 EDT 2018
Revision: 23325
http://svnweb.midnightbsd.org/mports/?rev=23325
Author: laffer1
Date: 2018-05-02 23:16:58 -0400 (Wed, 02 May 2018)
Log Message:
-----------
update python
Added Paths:
-----------
trunk/lang/python34/files/patch-Include__pyport.h
trunk/lang/python34/files/patch-Lib_distutils_command_install__lib.py
trunk/lang/python34/files/patch-Modules___ctypes__libffi__src__arm__ffi.c
trunk/lang/python34/files/patch-configure
trunk/lang/python34/files/patch-issue24557
trunk/lang/python34/files/patch-issue30622
trunk/lang/python34/files/pkg-message.in
Added: trunk/lang/python34/files/patch-Include__pyport.h
===================================================================
--- trunk/lang/python34/files/patch-Include__pyport.h (rev 0)
+++ trunk/lang/python34/files/patch-Include__pyport.h 2018-05-03 03:16:58 UTC (rev 23325)
@@ -0,0 +1,13 @@
+--- Include/pyport.h.orig 2015-12-21 07:00:57.000000000 +0100
++++ Include/pyport.h 2016-04-03 19:29:17.797369000 +0200
+@@ -680,7 +680,9 @@
+
+ #ifdef __FreeBSD__
+ #include <osreldate.h>
+-#if __FreeBSD_version > 500039
++#if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \
++ (__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \
++ (__FreeBSD_version >= 800000 && __FreeBSD_version < 800001)
+ # define _PY_PORT_CTYPE_UTF8_ISSUE
+ #endif
+ #endif
Property changes on: trunk/lang/python34/files/patch-Include__pyport.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lang/python34/files/patch-Lib_distutils_command_install__lib.py
===================================================================
--- trunk/lang/python34/files/patch-Lib_distutils_command_install__lib.py (rev 0)
+++ trunk/lang/python34/files/patch-Lib_distutils_command_install__lib.py 2018-05-03 03:16:58 UTC (rev 23325)
@@ -0,0 +1,35 @@
+From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
+From: Brendan Molloy <brendan at bbqsrc.net>
+Date: Mon, 4 Jan 2016 23:14:06 +1100
+Subject: [PATCH] Check bytecode file actually exists and tests
+
+Should solve issue 20397, where using the --record argument results
+in files that failed to generate bytecode files are added to the
+record file nonetheless.
+
+--- Lib/distutils/command/install_lib.py.orig 2016-01-08 12:38:49 UTC
++++ Lib/distutils/command/install_lib.py
+@@ -165,11 +165,19 @@ class install_lib(Command):
+ if ext != PYTHON_SOURCE_EXTENSION:
+ continue
+ if self.compile:
+- bytecode_files.append(importlib.util.cache_from_source(
+- py_file, debug_override=True))
++ candidate = importlib.util.cache_from_source(
++ py_file, debug_override=True)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+ if self.optimize > 0:
+- bytecode_files.append(importlib.util.cache_from_source(
+- py_file, debug_override=False))
++ candidate = importlib.util.cache_from_source(
++ py_file, debug_override=False)
++
++ if os.path.isfile(candidate):
++ bytecode_files.append(candidate)
++
+
+ return bytecode_files
+
Property changes on: trunk/lang/python34/files/patch-Lib_distutils_command_install__lib.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lang/python34/files/patch-Modules___ctypes__libffi__src__arm__ffi.c
===================================================================
--- trunk/lang/python34/files/patch-Modules___ctypes__libffi__src__arm__ffi.c (rev 0)
+++ trunk/lang/python34/files/patch-Modules___ctypes__libffi__src__arm__ffi.c 2018-05-03 03:16:58 UTC (rev 23325)
@@ -0,0 +1,36 @@
+# Description: Fix _ctypes abort on import for FreeBSD/ARM. This is an issue
+# for anything !apple that is using the libcompiler_rt provided by clang on arm
+# PR: ports/149167 ports/184517
+# Patch by: cognet@ (to be upstreamed @ LLVM)
+
+--- ./Modules/_ctypes/libffi/src/arm/ffi.c.orig 2013-11-17 18:22:57.000000000 +1100
++++ ./Modules/_ctypes/libffi/src/arm/ffi.c 2013-12-03 19:23:24.521993369 +1100
+@@ -33,6 +33,11 @@
+
+ #include <stdlib.h>
+
++#if defined(__FreeBSD__) && defined(__arm__)
++#include <sys/types.h>
++#include <machine/sysarch.h>
++#endif
++
+ /* Forward declares. */
+ static int vfp_type_p (ffi_type *);
+ static void layout_vfp_args (ffi_cif *);
+@@ -582,6 +587,16 @@
+
+ #else
+
++#if defined(__FreeBSD__) && defined(__arm__)
++#define __clear_cache(start, end) do { \
++ struct arm_sync_icache_args ua; \
++ \
++ ua.addr = (uintptr_t)(start); \
++ ua.len = (char *)(end) - (char *)start; \
++ sysarch(ARM_SYNC_ICACHE, &ua); \
++ } while (0);
++#endif
++
+ #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
+ ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
+ unsigned int __fun = (unsigned int)(FUN); \
Property changes on: trunk/lang/python34/files/patch-Modules___ctypes__libffi__src__arm__ffi.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lang/python34/files/patch-configure
===================================================================
--- trunk/lang/python34/files/patch-configure (rev 0)
+++ trunk/lang/python34/files/patch-configure 2018-05-03 03:16:58 UTC (rev 23325)
@@ -0,0 +1,44 @@
+--- configure.orig 2018-02-04 18:40:38.000000000 -0500
++++ configure 2018-05-02 23:11:57.000000000 -0400
+@@ -5650,12 +5650,12 @@
+ PY3LIBRARY=libpython3.so
+ fi
+ ;;
+- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|MidnightBSD*)
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-L. -lpython$(LDVERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+ case $ac_sys_system in
+- FreeBSD*)
++ FreeBSD*|MidnightBSD*)
+ SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
+ ;;
+ esac
+@@ -8603,7 +8603,7 @@
+ BSD/OS*/4*)
+ LDSHARED="gcc -shared"
+ LDCXXSHARED="g++ -shared";;
+- FreeBSD*)
++ FreeBSD*|MidnightBSD*)
+ if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
+ then
+ LDSHARED='$(CC) -shared'
+@@ -8670,7 +8670,7 @@
+ fi;;
+ Linux*|GNU*) CCSHARED="-fPIC";;
+ BSD/OS*/4*) CCSHARED="-fpic";;
+- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
++ FreeBSD*|NetBSD*|OpenBSD*|DragonFly*|MidnightBSD*) CCSHARED="-fPIC";;
+ OpenUNIX*|UnixWare*)
+ if test "$GCC" = "yes"
+ then CCSHARED="-fPIC"
+@@ -8719,7 +8719,7 @@
+ OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
+ SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
+ ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
+- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
++ FreeBSD*|NetBSD*|OpenBSD*|DragonFly*|MidnightBSD*)
+ if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
+ then
+ LINKFORSHARED="-Wl,--export-dynamic"
Property changes on: trunk/lang/python34/files/patch-configure
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lang/python34/files/patch-issue24557
===================================================================
--- trunk/lang/python34/files/patch-issue24557 (rev 0)
+++ trunk/lang/python34/files/patch-issue24557 2018-05-03 03:16:58 UTC (rev 23325)
@@ -0,0 +1,23 @@
+https://bugs.python.org/issue24557
+assume egd unless OPENSSL_NO_EGD is defined-remove configure check
+
+--- Modules/_ssl.c.orig 2016-06-25 21:52:32 UTC
++++ Modules/_ssl.c
+@@ -3325,7 +3325,7 @@ Returns 1 if the OpenSSL PRNG has been s
+ It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
+ using the ssl() function.");
+
+-#ifdef HAVE_RAND_EGD
++#ifndef OPENSSL_NO_EGD
+ static PyObject *
+ PySSL_RAND_egd(PyObject *self, PyObject *args)
+ {
+@@ -3753,7 +3753,7 @@ static PyMethodDef PySSL_methods[] = {
+ PySSL_RAND_bytes_doc},
+ {"RAND_pseudo_bytes", PySSL_RAND_pseudo_bytes, METH_VARARGS,
+ PySSL_RAND_pseudo_bytes_doc},
+-#ifdef HAVE_RAND_EGD
++#ifndef OPENSSL_NO_EGD
+ {"RAND_egd", PySSL_RAND_egd, METH_VARARGS,
+ PySSL_RAND_egd_doc},
+ #endif
Property changes on: trunk/lang/python34/files/patch-issue24557
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lang/python34/files/patch-issue30622
===================================================================
--- trunk/lang/python34/files/patch-issue30622 (rev 0)
+++ trunk/lang/python34/files/patch-issue30622 2018-05-03 03:16:58 UTC (rev 23325)
@@ -0,0 +1,118 @@
+From b2d096bd2a5ff86e53c25d00ee5fa097b36bf1d8 Mon Sep 17 00:00:00 2001
+From: Melvyn Sopacua <melvyn-sopacua at users.noreply.github.com>
+Date: Mon, 4 Sep 2017 23:35:15 +0200
+Subject: [PATCH] bpo-30622: Change NPN detection: (#2079)
+
+* Change NPN detection:
+
+Version breakdown, support disabled (pre-patch/post-patch):
+- pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False
+- 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will not be defined ->
+False/False
+- 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and
+OPENSSL_NO_NEXTPROTONEG will be defined -> True/False
+
+Version breakdown support enabled (pre-patch/post-patch):
+- pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False
+- 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will be defined and
+OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True
+- 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and
+OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True
+
+* Refine NPN guard:
+
+- If NPN is disabled, but ALPN is available we need our callback
+- Make clinic's ssl behave the same way
+
+This created a working ssl module for me, with NPN disabled and ALPN
+enabled for OpenSSL 1.1.0f.
+
+Concerns to address:
+The initial commit for NPN support into OpenSSL [1], had the
+OPENSSL_NPN_* variables defined inside the OPENSSL_NO_NEXTPROTONEG
+guard. The question is if that ever made it into a release.
+This would need an ugly hack, something like:
+
+ #if defined(OPENSSL_NO_NEXTPROTONEG) && \
+ !defined(OPENSSL_NPN_NEGOTIATED)
+ # define OPENSSL_NPN_UNSUPPORTED 0
+ # define OPENSSL_NPN_NEGOTIATED 1
+ # define OPENSSL_NPN_NO_OVERLAP 2
+ #endif
+
+[1] https://github.com/openssl/openssl/commit/68b33cc5c7
+
+--- Modules/_ssl.c.orig 2018-02-04 23:40:38 UTC
++++ Modules/_ssl.c
+@@ -207,7 +207,7 @@ static unsigned int _ssl_locks_count = 0
+ typedef struct {
+ PyObject_HEAD
+ SSL_CTX *ctx;
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ char *npn_protocols;
+ int npn_protocols_len;
+ #endif
+@@ -1403,7 +1403,7 @@ static PyObject *PySSL_cipher (PySSLSock
+ return NULL;
+ }
+
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ static PyObject *PySSL_selected_npn_protocol(PySSLSocket *self) {
+ const unsigned char *out;
+ unsigned int outlen;
+@@ -1920,7 +1920,7 @@ static PyMethodDef PySSLMethods[] = {
+ {"peer_certificate", (PyCFunction)PySSL_peercert, METH_VARARGS,
+ PySSL_peercert_doc},
+ {"cipher", (PyCFunction)PySSL_cipher, METH_NOARGS},
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ {"selected_npn_protocol", (PyCFunction)PySSL_selected_npn_protocol, METH_NOARGS},
+ #endif
+ {"compression", (PyCFunction)PySSL_compression, METH_NOARGS},
+@@ -2027,7 +2027,7 @@ context_new(PyTypeObject *type, PyObject
+ return NULL;
+ }
+ self->ctx = ctx;
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ self->npn_protocols = NULL;
+ #endif
+ #ifndef OPENSSL_NO_TLSEXT
+@@ -2099,7 +2099,7 @@ context_dealloc(PySSLContext *self)
+ {
+ context_clear(self);
+ SSL_CTX_free(self->ctx);
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ PyMem_Free(self->npn_protocols);
+ #endif
+ Py_TYPE(self)->tp_free(self);
+@@ -2126,7 +2126,7 @@ set_ciphers(PySSLContext *self, PyObject
+ Py_RETURN_NONE;
+ }
+
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ /* this callback gets passed to SSL_CTX_set_next_protos_advertise_cb */
+ static int
+ _advertiseNPN_cb(SSL *s,
+@@ -2175,7 +2175,7 @@ _selectNPN_cb(SSL *s,
+ static PyObject *
+ _set_npn_protocols(PySSLContext *self, PyObject *args)
+ {
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ Py_buffer protos;
+
+ if (!PyArg_ParseTuple(args, "y*:set_npn_protocols", &protos))
+@@ -4130,7 +4130,7 @@ PyInit__ssl(void)
+ Py_INCREF(r);
+ PyModule_AddObject(m, "HAS_ECDH", r);
+
+-#ifdef OPENSSL_NPN_NEGOTIATED
++#if defined(OPENSSL_NPN_NEGOTIATED) && !defined(OPENSSL_NO_NEXTPROTONEG)
+ r = Py_True;
+ #else
+ r = Py_False;
Property changes on: trunk/lang/python34/files/patch-issue30622
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/lang/python34/files/pkg-message.in
===================================================================
--- trunk/lang/python34/files/pkg-message.in (rev 0)
+++ trunk/lang/python34/files/pkg-message.in 2018-05-03 03:16:58 UTC (rev 23325)
@@ -0,0 +1,10 @@
+===========================================================================
+
+Note that some standard Python modules are provided as separate ports
+as they require additional dependencies. They are available as:
+
+py%%PYTHON_SUFFIX%%-gdbm databases/py-gdbm at py%%PYTHON_SUFFIX%%
+py%%PYTHON_SUFFIX%%-sqlite3 databases/py-sqlite3 at py%%PYTHON_SUFFIX%%
+py%%PYTHON_SUFFIX%%-tkinter x11-toolkits/py-tkinter at py%%PYTHON_SUFFIX%%
+
+===========================================================================
Property changes on: trunk/lang/python34/files/pkg-message.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list