View | Details | Raw Unified | Return to bug 192511 | Differences between
and this patch

Collapse All | Expand All

(-)lang/python27/Makefile (+4 lines)
Lines 105-110 Link Here
105
PLIST_SUB+=	NO_NIS=""
105
PLIST_SUB+=	NO_NIS=""
106
.endif
106
.endif
107
107
108
.if defined(WITH_OPENSSL_PORT)
109
CONFIGURE_ARGS+=	CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
110
.endif
111
108
post-patch:
112
post-patch:
109
	@${REINPLACE_CMD} -e \
113
	@${REINPLACE_CMD} -e \
110
		's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \
114
		's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \
(-)lang/python27/files/patch-Doc__library__fcntl.rst (-10 lines)
Lines 1-10 Link Here
1
--- ./Doc/library/fcntl.rst.orig	2014-07-03 21:53:41.473098625 +1000
2
+++ ./Doc/library/fcntl.rst	2014-07-03 21:54:04.342833056 +1000
3
@@ -50,7 +50,6 @@
4
    operations are typically defined in the library module :mod:`termios` and the
5
    argument handling is even more complicated.
6
 
7
-   The op parameter is limited to values that can fit in 32-bits.
8
    Additional constants of interest for use as the *op* argument can be
9
    found in the :mod:`termios` module, under the same names as used in
10
    the relevant C header files.
(-)lang/python27/files/patch-Doc_library_fcntl.rst (+10 lines)
Line 0 Link Here
1
--- Doc/library/fcntl.rst.orig	2014-12-10 15:59:27 UTC
2
+++ Doc/library/fcntl.rst
3
@@ -50,7 +50,6 @@ The module defines the following functio
4
    operations are typically defined in the library module :mod:`termios` and the
5
    argument handling is even more complicated.
6
 
7
-   The op parameter is limited to values that can fit in 32-bits.
8
    Additional constants of interest for use as the *op* argument can be
9
    found in the :mod:`termios` module, under the same names as used in
10
    the relevant C header files.
(-)lang/python27/files/patch-Lib__distutils__unixccompiler.py (-15 lines)
Lines 1-15 Link Here
1
# Description: Some python extensions can't be compiled with clang 3.4
2
# Issue ID: http://bugs.python.org/issue20767
3
# Submitted by: antoine
4
5
--- ./Lib/distutils/unixccompiler.py.orig      2013-11-10 07:36:40.000000000 +0000
6
+++ ./Lib/distutils/unixccompiler.py   2014-02-19 15:41:48.000000000 +0000
7
@@ -228,6 +228,8 @@
8
         if sys.platform[:6] == "darwin":
9
             # MacOSX's linker doesn't understand the -R flag at all
10
             return "-L" + dir
11
+        elif sys.platform[:7] == "freebsd":
12
+            return "-Wl,-rpath=" + dir
13
         elif sys.platform[:5] == "hp-ux":
14
             if self._is_gcc(compiler):
15
                 return ["-Wl,+s", "-L" + dir]
(-)lang/python27/files/patch-Lib_distutils_command_build__scripts.py (+17 lines)
Line 0 Link Here
1
# Description: A non-invasive partial backport of the Python3 distutils behaviour.
2
# This allows Python's scripts to be properly suffixed (similar to Python 3.x) on
3
# installation.
4
# Submitted by: mva
5
6
--- Lib/distutils/command/build_scripts.py.orig	2014-12-10 15:59:34 UTC
7
+++ Lib/distutils/command/build_scripts.py
8
@@ -126,6 +126,9 @@ class build_scripts (Command):
9
                                  file, oldmode, newmode)
10
                         os.chmod(file, newmode)
11
 
12
+        # XXX should we modify self.outfiles?
13
+        return outfiles
14
+
15
     # copy_scripts ()
16
 
17
 # class build_scripts
(-)lang/python27/files/patch-Lib_distutils_command_build_scripts.py (-17 lines)
Lines 1-17 Link Here
1
# Description: A non-invasive partial backport of the Python3 distutils behaviour.
2
# This allows Python's scripts to be properly suffixed (similar to Python 3.x) on
3
# installation.
4
# Submitted by: mva
5
6
--- Lib/distutils/command/build_scripts.py.orig	2014-07-26 11:52:20.000000000 +0200
7
+++ Lib/distutils/command/build_scripts.py	2014-07-26 11:52:56.000000000 +0200
8
@@ -126,6 +126,9 @@
9
                                  file, oldmode, newmode)
10
                         os.chmod(file, newmode)
11
 
12
+        # XXX should we modify self.outfiles?
13
+        return outfiles
14
+
15
     # copy_scripts ()
16
 
17
 # class build_scripts
(-)lang/python27/files/patch-Lib_distutils_unixccompiler.py (+15 lines)
Line 0 Link Here
1
# Description: Some python extensions can't be compiled with clang 3.4
2
# Issue ID: http://bugs.python.org/issue20767
3
# Submitted by: antoine
4
5
--- Lib/distutils/unixccompiler.py.orig	2014-12-10 15:59:34 UTC
6
+++ Lib/distutils/unixccompiler.py
7
@@ -228,6 +228,8 @@ class UnixCCompiler(CCompiler):
8
         if sys.platform[:6] == "darwin":
9
             # MacOSX's linker doesn't understand the -R flag at all
10
             return "-L" + dir
11
+        elif sys.platform[:7] == "freebsd":
12
+            return "-Wl,-rpath=" + dir
13
         elif sys.platform[:5] == "hp-ux":
14
             if self._is_gcc(compiler):
15
                 return ["-Wl,+s", "-L" + dir]
(-)lang/python27/files/patch-Lib_socket.py (+26 lines)
Line 0 Link Here
1
# Fix build with LibreSSL (does not have RAND_egd)
2
# PR192511, http://bugs.python.org/issue21356
3
# Submitted by: spil.oss@gmail.org
4
5
--- Lib/socket.py.orig	2014-12-10 15:59:40 UTC
6
+++ Lib/socket.py
7
@@ -67,7 +67,6 @@ else:
8
     from _ssl import SSLError as sslerror
9
     from _ssl import \
10
          RAND_add, \
11
-         RAND_egd, \
12
          RAND_status, \
13
          SSL_ERROR_ZERO_RETURN, \
14
          SSL_ERROR_WANT_READ, \
15
@@ -78,6 +77,11 @@ else:
16
          SSL_ERROR_WANT_CONNECT, \
17
          SSL_ERROR_EOF, \
18
          SSL_ERROR_INVALID_ERROR_CODE
19
+    try:
20
+         from _ssl import RAND_egd
21
+         # LibreSSL does not provide RAND_egd
22
+    except ImportError:
23
+         pass
24
 
25
 import os, sys, warnings
26
 
(-)lang/python27/files/patch-Lib_ssl.py (+19 lines)
Line 0 Link Here
1
# Fix build with LibreSSL (does not have RAND_egd)
2
# PR192511, http://bugs.python.org/issue21356
3
# Submitted by: spil.oss@gmail.org
4
5
--- Lib/ssl.py.orig	2014-12-10 15:59:40 UTC
6
+++ Lib/ssl.py
7
@@ -106,7 +106,11 @@ from _ssl import CERT_NONE, CERT_OPTIONA
8
 from _ssl import (VERIFY_DEFAULT, VERIFY_CRL_CHECK_LEAF, VERIFY_CRL_CHECK_CHAIN,
9
     VERIFY_X509_STRICT)
10
 from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
11
-from _ssl import RAND_status, RAND_egd, RAND_add
12
+from _ssl import RAND_status, RAND_add
13
+try:
14
+    from _ssl import RAND_egd
15
+except ImportError:
16
+    pass
17
 
18
 def _import_symbols(prefix):
19
     for n in dir(_ssl):
(-)lang/python27/files/patch-Lib_test_test__ssl.py (+18 lines)
Line 0 Link Here
1
# Fix build with LibreSSL (does not have RAND_egd)
2
# PR192511, http://bugs.python.org/issue21356
3
# Submitted by: spil.oss@gmail.org
4
5
--- Lib/test/test_ssl.py.orig	2014-12-10 15:59:47 UTC
6
+++ Lib/test/test_ssl.py
7
@@ -169,8 +169,9 @@ class BasicSocketTests(unittest.TestCase
8
             sys.stdout.write("\n RAND_status is %d (%s)\n"
9
                              % (v, (v and "sufficient randomness") or
10
                                 "insufficient randomness"))
11
-        self.assertRaises(TypeError, ssl.RAND_egd, 1)
12
-        self.assertRaises(TypeError, ssl.RAND_egd, 'foo', 1)
13
+        if hasattr(ssl, 'RAND_egd'):
14
+            self.assertRaises(TypeError, ssl.RAND_egd, 1)
15
+            self.assertRaises(TypeError, ssl.RAND_egd, 'foo', 1)
16
         ssl.RAND_add("this is a random string", 75.0)
17
 
18
     def test_parse_cert(self):
(-)lang/python27/files/patch-Makefile.pre.in (-6 / +6 lines)
Lines 1-12 Link Here
1
# Description: Link scripts in the same way Python3 does
1
# Description: Link scripts in the same way Python3 does
2
# Submitted by: mva
2
# Submitted by: mva
3
3
4
--- Makefile.pre.in.orig	2014-06-30 04:05:39.000000000 +0200
4
--- Makefile.pre.in.orig	2014-12-10 15:59:50 UTC
5
+++ Makefile.pre.in	2014-07-26 11:09:46.000000000 +0200
5
+++ Makefile.pre.in
6
@@ -868,6 +868,12 @@
6
@@ -900,6 +900,12 @@ bininstall:	altbininstall
7
	(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
7
 	(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
8
	-rm -f $(DESTDIR)$(LIBPC)/python.pc
8
 	-rm -f $(DESTDIR)$(LIBPC)/python.pc
9
	(cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
9
 	(cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
10
+	-rm -f $(DESTDIR)$(BINDIR)/idle
10
+	-rm -f $(DESTDIR)$(BINDIR)/idle
11
+	(cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle2)
11
+	(cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle2)
12
+	-rm -f $(DESTDIR)$(BINDIR)/pydoc
12
+	-rm -f $(DESTDIR)$(BINDIR)/pydoc
(-)lang/python27/files/patch-Modules-_ctypes-libffi-configure (-11 lines)
Lines 1-11 Link Here
1
--- Modules/_ctypes/libffi/configure.orig	2014-12-16 08:10:12.000000000 +0100
2
+++ Modules/_ctypes/libffi/configure	2014-12-16 08:10:40.000000000 +0100
3
@@ -7526,7 +7526,7 @@
4
   rm -rf conftest*
5
   ;;
6
 
7
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
8
+amd64-*-freebsd*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
9
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
10
   # Find out what ABI is being produced by ac_compile, and set linker
11
   # options accordingly.  Note that the listed cases only cover the
(-)lang/python27/files/patch-Modules___ctypes__libffi__src__arm__ffi.c (-36 lines)
Lines 1-36 Link Here
1
# Description: Fix _ctypes abort on import for FreeBSD/ARM. This is an issue
2
# for anything !apple that is using the libcompiler_rt provided by clang on arm
3
# PR: ports/149167 ports/184517
4
# Patch by: cognet@ (to be upstreamed @ LLVM)
5
6
--- ./Modules/_ctypes/libffi/src/arm/ffi.c.orig	2013-11-10 18:36:41.000000000 +1100
7
+++ ./Modules/_ctypes/libffi/src/arm/ffi.c	2013-12-03 18:05:51.461078888 +1100
8
@@ -33,6 +33,11 @@
9
 
10
 #include <stdlib.h>
11
 
12
+#if defined(__FreeBSD__) && defined(__arm__)
13
+#include <sys/types.h>
14
+#include <machine/sysarch.h>
15
+#endif
16
+
17
 /* Forward declares. */
18
 static int vfp_type_p (ffi_type *);
19
 static void layout_vfp_args (ffi_cif *);
20
@@ -582,6 +587,16 @@
21
 
22
 #else
23
 
24
+#if defined(__FreeBSD__) && defined(__arm__)
25
+#define __clear_cache(start, end) do { \
26
+		struct arm_sync_icache_args ua; 		\
27
+								\
28
+		ua.addr = (uintptr_t)(start);			\
29
+		ua.len = (char *)(end) - (char *)start;		\
30
+		sysarch(ARM_SYNC_ICACHE, &ua);			\
31
+	} while (0);
32
+#endif
33
+
34
 #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX)				\
35
 ({ unsigned char *__tramp = (unsigned char*)(TRAMP);			\
36
    unsigned int  __fun = (unsigned int)(FUN);				\
(-)lang/python27/files/patch-Modules___ctypes_libffi_configure (+11 lines)
Line 0 Link Here
1
--- Modules/_ctypes/libffi/configure.orig	2014-12-10 15:59:51 UTC
2
+++ Modules/_ctypes/libffi/configure
3
@@ -7526,7 +7526,7 @@ mips64*-*linux*)
4
   rm -rf conftest*
5
   ;;
6
 
7
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
8
+amd64-*-freebsd*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
9
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
10
   # Find out what ABI is being produced by ac_compile, and set linker
11
   # options accordingly.  Note that the listed cases only cover the
(-)lang/python27/files/patch-Modules___ctypes_libffi_src_arm_ffi.c (+36 lines)
Line 0 Link Here
1
# Description: Fix _ctypes abort on import for FreeBSD/ARM. This is an issue
2
# for anything !apple that is using the libcompiler_rt provided by clang on arm
3
# PR: ports/149167 ports/184517
4
# Patch by: cognet@ (to be upstreamed @ LLVM)
5
6
--- Modules/_ctypes/libffi/src/arm/ffi.c.orig	2014-12-10 15:59:52 UTC
7
+++ Modules/_ctypes/libffi/src/arm/ffi.c
8
@@ -33,6 +33,11 @@
9
 
10
 #include <stdlib.h>
11
 
12
+#if defined(__FreeBSD__) && defined(__arm__)
13
+#include <sys/types.h>
14
+#include <machine/sysarch.h>
15
+#endif
16
+
17
 /* Forward declares. */
18
 static int vfp_type_p (ffi_type *);
19
 static void layout_vfp_args (ffi_cif *);
20
@@ -751,6 +756,16 @@ ffi_closure_free (void *ptr)
21
 
22
 #else
23
 
24
+#if defined(__FreeBSD__) && defined(__arm__)
25
+#define __clear_cache(start, end) do { \
26
+		struct arm_sync_icache_args ua; 		\
27
+								\
28
+		ua.addr = (uintptr_t)(start);			\
29
+		ua.len = (char *)(end) - (char *)start;		\
30
+		sysarch(ARM_SYNC_ICACHE, &ua);			\
31
+	} while (0);
32
+#endif
33
+
34
 #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX)				\
35
 ({ unsigned char *__tramp = (unsigned char*)(TRAMP);			\
36
    unsigned int  __fun = (unsigned int)(FUN);				\
(-)lang/python27/files/patch-Modules___ssl.c (+33 lines)
Line 0 Link Here
1
# Fix build with LibreSSL (does not have RAND_egd)
2
# PR192511, http://bugs.python.org/issue21356
3
# Submitted by: spil.oss@gmail.org
4
5
--- Modules/_ssl.c.orig	2014-12-10 15:59:53 UTC
6
+++ Modules/_ssl.c
7
@@ -3301,6 +3301,7 @@ Returns 1 if the OpenSSL PRNG has been s
8
 It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
9
 using the ssl() function.");
10
 
11
+#ifdef HAVE_RAND_EGD
12
 static PyObject *
13
 PySSL_RAND_egd(PyObject *self, PyObject *arg)
14
 {
15
@@ -3326,6 +3327,7 @@ PyDoc_STRVAR(PySSL_RAND_egd_doc,
16
 Queries the entropy gather daemon (EGD) on the socket named by 'path'.\n\
17
 Returns number of bytes read.  Raises SSLError if connection to EGD\n\
18
 fails or if it does not provide enough data to seed PRNG.");
19
+#endif /* HAVE_RAND_EGD */
20
 
21
 #endif /* HAVE_OPENSSL_RAND */
22
 
23
@@ -3720,8 +3722,10 @@ static PyMethodDef PySSL_methods[] = {
24
 #ifdef HAVE_OPENSSL_RAND
25
     {"RAND_add",            PySSL_RAND_add, METH_VARARGS,
26
      PySSL_RAND_add_doc},
27
+#ifdef HAVE_RAND_EGD
28
     {"RAND_egd",            PySSL_RAND_egd, METH_VARARGS,
29
      PySSL_RAND_egd_doc},
30
+#endif /* HAVE_RAND_EGD */
31
     {"RAND_status",         (PyCFunction)PySSL_RAND_status, METH_NOARGS,
32
      PySSL_RAND_status_doc},
33
 #endif
(-)lang/python27/files/patch-Modules__fcntlmodule.c (-53 lines)
Lines 1-53 Link Here
1
--- ./Modules/fcntlmodule.c.orig	2014-07-03 21:57:10.429953240 +1000
2
+++ ./Modules/fcntlmodule.c	2014-07-03 21:59:36.517210444 +1000
3
@@ -98,20 +98,15 @@
4
 {
5
 #define IOCTL_BUFSZ 1024
6
     int fd;
7
-    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I'
8
+    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k'
9
        format for the 'code' parameter because Python turns 0x8000000
10
        into either a large positive number (PyLong or PyInt on 64-bit
11
        platforms) or a negative number on others (32-bit PyInt)
12
        whereas the system expects it to be a 32bit bit field value
13
        regardless of it being passed as an int or unsigned long on
14
-       various platforms.  See the termios.TIOCSWINSZ constant across
15
-       platforms for an example of this.
16
-
17
-       If any of the 64bit platforms ever decide to use more than 32bits
18
-       in their unsigned long ioctl codes this will break and need
19
-       special casing based on the platform being built on.
20
+       various platforms.
21
      */
22
-    unsigned int code;
23
+    unsigned long code;
24
     int arg;
25
     int ret;
26
     char *str;
27
@@ -119,7 +114,7 @@
28
     int mutate_arg = 1;
29
     char buf[IOCTL_BUFSZ+1];  /* argument plus NUL byte */
30
 
31
-    if (PyArg_ParseTuple(args, "O&Iw#|i:ioctl",
32
+    if (PyArg_ParseTuple(args, "O&kw#|i:ioctl",
33
                          conv_descriptor, &fd, &code,
34
                          &str, &len, &mutate_arg)) {
35
         char *arg;
36
@@ -170,7 +165,7 @@
37
     }
38
 
39
     PyErr_Clear();
40
-    if (PyArg_ParseTuple(args, "O&Is#:ioctl",
41
+    if (PyArg_ParseTuple(args, "O&ks#:ioctl",
42
                          conv_descriptor, &fd, &code, &str, &len)) {
43
         if (len > IOCTL_BUFSZ) {
44
             PyErr_SetString(PyExc_ValueError,
45
@@ -192,7 +187,7 @@
46
     PyErr_Clear();
47
     arg = 0;
48
     if (!PyArg_ParseTuple(args,
49
-         "O&I|i;ioctl requires a file or file descriptor,"
50
+         "O&k|i;ioctl requires a file or file descriptor,"
51
          " an integer and optionally an integer or buffer argument",
52
                           conv_descriptor, &fd, &code, &arg)) {
53
       return NULL;
(-)lang/python27/files/patch-Modules_fcntlmodule.c (+53 lines)
Line 0 Link Here
1
--- Modules/fcntlmodule.c.orig	2014-12-10 15:59:54 UTC
2
+++ Modules/fcntlmodule.c
3
@@ -98,20 +98,15 @@ fcntl_ioctl(PyObject *self, PyObject *ar
4
 {
5
 #define IOCTL_BUFSZ 1024
6
     int fd;
7
-    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I'
8
+    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k'
9
        format for the 'code' parameter because Python turns 0x8000000
10
        into either a large positive number (PyLong or PyInt on 64-bit
11
        platforms) or a negative number on others (32-bit PyInt)
12
        whereas the system expects it to be a 32bit bit field value
13
        regardless of it being passed as an int or unsigned long on
14
-       various platforms.  See the termios.TIOCSWINSZ constant across
15
-       platforms for an example of this.
16
-
17
-       If any of the 64bit platforms ever decide to use more than 32bits
18
-       in their unsigned long ioctl codes this will break and need
19
-       special casing based on the platform being built on.
20
+       various platforms.
21
      */
22
-    unsigned int code;
23
+    unsigned long code;
24
     int arg;
25
     int ret;
26
     char *str;
27
@@ -119,7 +114,7 @@ fcntl_ioctl(PyObject *self, PyObject *ar
28
     int mutate_arg = 1;
29
     char buf[IOCTL_BUFSZ+1];  /* argument plus NUL byte */
30
 
31
-    if (PyArg_ParseTuple(args, "O&Iw#|i:ioctl",
32
+    if (PyArg_ParseTuple(args, "O&kw#|i:ioctl",
33
                          conv_descriptor, &fd, &code,
34
                          &str, &len, &mutate_arg)) {
35
         char *arg;
36
@@ -170,7 +165,7 @@ fcntl_ioctl(PyObject *self, PyObject *ar
37
     }
38
 
39
     PyErr_Clear();
40
-    if (PyArg_ParseTuple(args, "O&Is#:ioctl",
41
+    if (PyArg_ParseTuple(args, "O&ks#:ioctl",
42
                          conv_descriptor, &fd, &code, &str, &len)) {
43
         if (len > IOCTL_BUFSZ) {
44
             PyErr_SetString(PyExc_ValueError,
45
@@ -192,7 +187,7 @@ fcntl_ioctl(PyObject *self, PyObject *ar
46
     PyErr_Clear();
47
     arg = 0;
48
     if (!PyArg_ParseTuple(args,
49
-         "O&I|i;ioctl requires a file or file descriptor,"
50
+         "O&k|i;ioctl requires a file or file descriptor,"
51
          " an integer and optionally an integer or buffer argument",
52
                           conv_descriptor, &fd, &code, &arg)) {
53
       return NULL;
(-)lang/python27/files/patch-configure (+85 lines)
Line 0 Link Here
1
# Description: do not define __BSD_VISIBLE/_XOPEN_SOURCE/_POSIX_C_SOURCE
2
# in include/python2.7/pyconfig.h
3
# Submitted by: antoine
4
5
# Fix build with LibreSSL (does not have RAND_egd)
6
# PR192511, http://bugs.python.org/issue21356
7
# Submitted by: spil.oss@gmail.org
8
9
--- configure.orig	2015-03-13 12:32:09 UTC
10
+++ configure
11
@@ -2919,13 +2919,6 @@
12
13
14
 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
15
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
16
-# them.
17
-
18
-$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h
19
-
20
-
21
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
22
 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
23
24
 $as_echo "#define _BSD_TYPES 1" >>confdefs.h
25
@@ -3293,9 +3286,8 @@
26
   # but used in struct sockaddr.sa_family. Reported by Tim Rice.
27
   SCO_SV/3.2)
28
     define_xopen_source=no;;
29
-  # On FreeBSD 4, the math functions C89 does not cover are never defined
30
-  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
31
-  FreeBSD/4.*)
32
+  # On FreeBSD,  defining _XOPEN_SOURCE to 600 requests a strict environment.
33
+  FreeBSD/*)
34
     define_xopen_source=no;;
35
   # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
36
   # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
37
@@ -8534,6 +8534,48 @@ _ACEOF
38
 fi
39
 	# Dynamic linking for HP-UX
40
 
41
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_egd in -lcrypto" >&5
42
+$as_echo_n "checking for RAND_egd in -lcrypto... " >&6; }
43
+if ${ac_cv_lib_crypto_RAND_egd+:} false; then :
44
+  $as_echo_n "(cached) " >&6
45
+else
46
+  ac_check_lib_save_LIBS=$LIBS
47
+LIBS="-lcrypto  $LIBS"
48
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49
+/* end confdefs.h.  */
50
+
51
+/* Override any GCC internal prototype to avoid an error.
52
+   Use char because int might match the return type of a GCC
53
+   builtin and then its argument prototype would still apply.  */
54
+#ifdef __cplusplus
55
+extern "C"
56
+#endif
57
+char RAND_egd ();
58
+int
59
+main ()
60
+{
61
+return RAND_egd ();
62
+  ;
63
+  return 0;
64
+}
65
+_ACEOF
66
+if ac_fn_c_try_link "$LINENO"; then :
67
+  ac_cv_lib_crypto_RAND_egd=yes
68
+else
69
+  ac_cv_lib_crypto_RAND_egd=no
70
+fi
71
+rm -f core conftest.err conftest.$ac_objext \
72
+    conftest$ac_exeext conftest.$ac_ext
73
+LIBS=$ac_check_lib_save_LIBS
74
+fi
75
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_egd" >&5
76
+$as_echo "$ac_cv_lib_crypto_RAND_egd" >&6; }
77
+if test "x$ac_cv_lib_crypto_RAND_egd" = xyes; then :
78
+
79
+$as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h
80
+
81
+fi
82
+
83
 # only check for sem_init if thread support is requested
84
 if test "$with_threads" = "yes" -o -z "$with_threads"; then
85
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
(-)lang/python27/files/patch-configure.ac (+45 lines)
Line 0 Link Here
1
# Description: do not define __BSD_VISIBLE/_XOPEN_SOURCE/_POSIX_C_SOURCE
2
# in include/python2.7/pyconfig.h
3
# Submitted by: antoine
4
5
# Fix build with LibreSSL (does not have RAND_egd)
6
# PR192511, http://bugs.python.org/issue21356
7
# Submitted by: spil.oss@gmail.org
8
9
--- configure.ac.orig	2015-03-13 12:32:09 UTC
10
+++ configure.ac
11
@@ -88,11 +88,6 @@
12
 AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
13
14
 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
15
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
16
-# them.
17
-AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
18
-
19
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
20
 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
21
 AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
22
23
@@ -426,9 +421,8 @@
24
   # but used in struct sockaddr.sa_family. Reported by Tim Rice.
25
   SCO_SV/3.2)
26
     define_xopen_source=no;;
27
-  # On FreeBSD 4, the math functions C89 does not cover are never defined
28
-  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
29
-  FreeBSD/4.*)
30
+  # On FreeBSD,  defining _XOPEN_SOURCE to 600 requests a strict environment.
31
+  FreeBSD/*)
32
     define_xopen_source=no;;
33
   # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
34
   # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
35
@@ -2216,6 +2216,10 @@ AC_MSG_RESULT($SHLIBS)
36
 AC_CHECK_LIB(dl, dlopen)	# Dynamic linking for SunOS/Solaris and SYSV
37
 AC_CHECK_LIB(dld, shl_load)	# Dynamic linking for HP-UX
38
 
39
+AC_CHECK_LIB(crypto, RAND_egd,
40
+             AC_DEFINE(HAVE_RAND_EGD, 1,
41
+             [Define if the libcrypto has RAND_egd]))
42
+
43
 # only check for sem_init if thread support is requested
44
 if test "$with_threads" = "yes" -o -z "$with_threads"; then
45
     AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
(-)lang/python27/files/patch-pr192365 (-58 lines)
Lines 1-58 Link Here
1
# Description: do not define __BSD_VISIBLE/_XOPEN_SOURCE/_POSIX_C_SOURCE
2
# in include/python2.7/pyconfig.h
3
# Submitted by: antoine
4
5
--- configure.orig	2014-09-06 14:42:50 UTC
6
+++ configure
7
@@ -2919,13 +2919,6 @@
8
 
9
 
10
 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
11
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
12
-# them.
13
-
14
-$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h
15
-
16
-
17
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
18
 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
19
 
20
 $as_echo "#define _BSD_TYPES 1" >>confdefs.h
21
@@ -3293,9 +3286,8 @@
22
   # but used in struct sockaddr.sa_family. Reported by Tim Rice.
23
   SCO_SV/3.2)
24
     define_xopen_source=no;;
25
-  # On FreeBSD 4, the math functions C89 does not cover are never defined
26
-  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
27
-  FreeBSD/4.*)
28
+  # On FreeBSD,  defining _XOPEN_SOURCE to 600 requests a strict environment.
29
+  FreeBSD/*)
30
     define_xopen_source=no;;
31
   # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
32
   # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
33
--- configure.ac.orig	2014-09-06 14:42:50 UTC
34
+++ configure.ac
35
@@ -88,11 +88,6 @@
36
 AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
37
 
38
 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
39
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
40
-# them.
41
-AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
42
-
43
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
44
 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
45
 AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
46
 
47
@@ -426,9 +421,8 @@
48
   # but used in struct sockaddr.sa_family. Reported by Tim Rice.
49
   SCO_SV/3.2)
50
     define_xopen_source=no;;
51
-  # On FreeBSD 4, the math functions C89 does not cover are never defined
52
-  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
53
-  FreeBSD/4.*)
54
+  # On FreeBSD,  defining _XOPEN_SOURCE to 600 requests a strict environment.
55
+  FreeBSD/*)
56
     define_xopen_source=no;;
57
   # On MacOS X 10.2, a bug in ncurses.h means that it craps out if 
58
   # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
(-)lang/python27/files/patch-pyconfig.h.in (+16 lines)
Line 0 Link Here
1
# Fix build with LibreSSL (does not have RAND_egd)
2
# PR192511, http://bugs.python.org/issue21356
3
# Submitted by: spil.oss@gmail.org
4
5
--- pyconfig.h.in.orig	2014-12-10 16:00:01 UTC
6
+++ pyconfig.h.in
7
@@ -544,6 +544,9 @@
8
 /* Define to 1 if you have the `putenv' function. */
9
 #undef HAVE_PUTENV
10
 
11
+/* Define if the libcrypto has RAND_egd */
12
+#undef HAVE_RAND_EGD
13
+
14
 /* Define to 1 if you have the `readlink' function. */
15
 #undef HAVE_READLINK
16
 
(-)lang/python27/files/patch-setup.py (-10 / +10 lines)
Lines 5-13 Link Here
5
5
6
# Description: ossaudiodev detection fix backport
6
# Description: ossaudiodev detection fix backport
7
7
8
--- setup.py.orig	2014-06-30 04:05:48.000000000 +0200
8
--- setup.py.orig	2014-12-10 16:00:01 UTC
9
+++ setup.py	2014-07-26 14:51:29.000000000 +0200
9
+++ setup.py
10
@@ -15,6 +15,7 @@
10
@@ -15,6 +15,7 @@ from distutils.core import Extension, se
11
 from distutils.command.build_ext import build_ext
11
 from distutils.command.build_ext import build_ext
12
 from distutils.command.install import install
12
 from distutils.command.install import install
13
 from distutils.command.install_lib import install_lib
13
 from distutils.command.install_lib import install_lib
Lines 15-21 Link Here
15
 from distutils.spawn import find_executable
15
 from distutils.spawn import find_executable
16
 
16
 
17
 cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
17
 cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
18
@@ -33,7 +34,7 @@
18
@@ -33,7 +34,7 @@ host_platform = get_platform()
19
 COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
19
 COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
20
 
20
 
21
 # This global variable is used to hold the list of modules to be disabled.
21
 # This global variable is used to hold the list of modules to be disabled.
Lines 24-30 Link Here
24
 
24
 
25
 def add_dir_to_list(dirlist, dir):
25
 def add_dir_to_list(dirlist, dir):
26
     """Add the directory 'dir' to the list 'dirlist' (at the front) if
26
     """Add the directory 'dir' to the list 'dirlist' (at the front) if
27
@@ -1212,7 +1213,7 @@
27
@@ -1214,7 +1215,7 @@ class PyBuildExt(build_ext):
28
                 sysroot = macosx_sdk_root()
28
                 sysroot = macosx_sdk_root()
29
                 f = os.path.join(sysroot, f[1:])
29
                 f = os.path.join(sysroot, f[1:])
30
 
30
 
Lines 33-39 Link Here
33
             data = open(f).read()
33
             data = open(f).read()
34
             m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
34
             m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
35
             if m is not None:
35
             if m is not None:
36
@@ -1551,7 +1552,7 @@
36
@@ -1553,7 +1554,7 @@ class PyBuildExt(build_ext):
37
             macros = dict()
37
             macros = dict()
38
             libraries = []
38
             libraries = []
39
 
39
 
Lines 42-48 Link Here
42
             # FreeBSD's P1003.1b semaphore support is very experimental
42
             # FreeBSD's P1003.1b semaphore support is very experimental
43
             # and has many known problems. (as of June 2008)
43
             # and has many known problems. (as of June 2008)
44
             macros = dict()
44
             macros = dict()
45
@@ -1602,9 +1603,10 @@
45
@@ -1604,9 +1605,10 @@ class PyBuildExt(build_ext):
46
         else:
46
         else:
47
             missing.append('linuxaudiodev')
47
             missing.append('linuxaudiodev')
48
 
48
 
Lines 56-62 Link Here
56
             exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
56
             exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
57
         else:
57
         else:
58
             missing.append('ossaudiodev')
58
             missing.append('ossaudiodev')
59
@@ -2176,6 +2178,22 @@
59
@@ -2178,6 +2180,22 @@ class PyBuildInstallLib(install_lib):
60
     def is_chmod_supported(self):
60
     def is_chmod_supported(self):
61
         return hasattr(os, 'chmod')
61
         return hasattr(os, 'chmod')
62
 
62
 
Lines 79-85 Link Here
79
 SUMMARY = """
79
 SUMMARY = """
80
 Python is an interpreted, interactive, object-oriented programming
80
 Python is an interpreted, interactive, object-oriented programming
81
 language. It is often compared to Tcl, Perl, Scheme or Java.
81
 language. It is often compared to Tcl, Perl, Scheme or Java.
82
@@ -2221,7 +2239,9 @@
82
@@ -2223,7 +2241,9 @@ def main():
83
           platforms = ["Many"],
83
           platforms = ["Many"],
84
 
84
 
85
           # Build info
85
           # Build info
Lines 90-96 Link Here
90
                       'install_lib':PyBuildInstallLib},
90
                       'install_lib':PyBuildInstallLib},
91
           # The struct module is defined here, because build_ext won't be
91
           # The struct module is defined here, because build_ext won't be
92
           # called unless there's at least one extension module defined.
92
           # called unless there's at least one extension module defined.
93
@@ -2229,8 +2249,7 @@
93
@@ -2231,8 +2251,7 @@ def main():
94
 
94
 
95
           # Scripts to install
95
           # Scripts to install
96
           scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
96
           scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',

Return to bug 192511