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

Collapse All | Expand All

(-)python27/Makefile (-1 / +5 lines)
Lines 1-4 Link Here
1
# $FreeBSD$
1
# $FreeBSD: head/lang/python27/Makefile 372138 2014-11-04 09:14:21Z demon $
2
2
3
PORTNAME=	python27
3
PORTNAME=	python27
4
PORTVERSION=	2.7.8
4
PORTVERSION=	2.7.8
Lines 101-106 Link Here
101
PLIST_SUB+=	NO_NIS=""
101
PLIST_SUB+=	NO_NIS=""
102
.endif
102
.endif
103
103
104
.if ${WITH_OPENSSL_PORT}
105
CONFIGURE_ARGS+=	CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
106
.endif
107
104
post-patch:
108
post-patch:
105
	@${REINPLACE_CMD} -e \
109
	@${REINPLACE_CMD} -e \
106
		's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \
110
		's,/usr/doc/python-docs-,${PREFIX}/share/doc/python,g' \
(-)python27/files/patch-Lib_ssl.py (+14 lines)
Line 0 Link Here
1
--- Lib/ssl.py.orig	2014-06-30 04:05:31.000000000 +0200
2
+++ Lib/ssl.py	2014-11-27 22:49:55.973755982 +0100
3
@@ -62,7 +62,10 @@
4
 from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
5
 from _ssl import SSLError
6
 from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
7
-from _ssl import RAND_status, RAND_egd, RAND_add
8
+try:
9
+     from _ssl import RAND_status, RAND_egd, RAND_add
10
+except ImportError:
11
+     from _ssl import RAND_status, RAND_add
12
 from _ssl import \
13
      SSL_ERROR_ZERO_RETURN, \
14
      SSL_ERROR_WANT_READ, \
(-)python27/files/patch-Modules__ssl.c (+29 lines)
Line 0 Link Here
1
--- Modules/_ssl.c.orig	2014-06-30 04:05:42.000000000 +0200
2
+++ Modules/_ssl.c	2014-11-21 11:36:17.902267822 +0100
3
@@ -1601,6 +1601,7 @@
4
 It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
5
 using the ssl() function.");
6
 
7
+#ifdef HAVE_RAND_EGD
8
 static PyObject *
9
 PySSL_RAND_egd(PyObject *self, PyObject *arg)
10
 {
11
@@ -1626,6 +1627,7 @@
12
 Queries the entropy gather daemon (EGD) on the socket named by 'path'.\n\
13
 Returns number of bytes read.  Raises SSLError if connection to EGD\n\
14
 fails or if it does not provide enough data to seed PRNG.");
15
+#endif /* HAVE_RAND_EGD */
16
 
17
 #endif /* HAVE_OPENSSL_RAND */
18
 
19
@@ -1640,8 +1642,10 @@
20
 #ifdef HAVE_OPENSSL_RAND
21
     {"RAND_add",            PySSL_RAND_add, METH_VARARGS,
22
      PySSL_RAND_add_doc},
23
+#ifdef HAVE_RAND_EGD 
24
     {"RAND_egd",            PySSL_RAND_egd, METH_O,
25
      PySSL_RAND_egd_doc},
26
+#endif /* HAVE_RAND_EGD */
27
     {"RAND_status",         (PyCFunction)PySSL_RAND_status, METH_NOARGS,
28
      PySSL_RAND_status_doc},
29
 #endif
(-)python27/files/patch-configure (+76 lines)
Line 0 Link Here
1
--- configure.orig	2014-06-30 04:05:48.000000000 +0200
2
+++ configure	2014-11-27 22:18:29.477891072 +0100
3
@@ -2916,13 +2916,6 @@
4
 
5
 
6
 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
7
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
8
-# them.
9
-
10
-$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h
11
-
12
-
13
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
14
 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
15
 
16
 $as_echo "#define _BSD_TYPES 1" >>confdefs.h
17
@@ -3290,9 +3283,8 @@
18
   # but used in struct sockaddr.sa_family. Reported by Tim Rice.
19
   SCO_SV/3.2)
20
     define_xopen_source=no;;
21
-  # On FreeBSD 4, the math functions C89 does not cover are never defined
22
-  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
23
-  FreeBSD/4.*)
24
+  # On FreeBSD,  defining _XOPEN_SOURCE to 600 requests a strict environment.
25
+  FreeBSD/*)
26
     define_xopen_source=no;;
27
   # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
28
   # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
29
@@ -15939,4 +15931,47 @@
30
 *) ;;
31
 esac
32
 
33
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_egd in -lcrypto" >&5
34
+$as_echo_n "checking for RAND_egd in -lcrypto... " >&6; }
35
+if ${ac_cv_lib_crypto_RAND_egd+:} false; then :
36
+  $as_echo_n "(cached) " >&6
37
+else
38
+  ac_check_lib_save_LIBS=$LIBS
39
+LIBS="-lcrypto  $LIBS"
40
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41
+/* end confdefs.h.  */
42
+
43
+/* Override any GCC internal prototype to avoid an error.
44
+   Use char because int might match the return type of a GCC
45
+   builtin and then its argument prototype would still apply.  */
46
+#ifdef __cplusplus
47
+extern "C"
48
+#endif
49
+char RAND_egd ();
50
+int
51
+main ()
52
+{
53
+return RAND_egd ();
54
+  ;
55
+  return 0;
56
+}
57
+_ACEOF
58
+if ac_fn_c_try_link "$LINENO"; then :
59
+  ac_cv_lib_crypto_RAND_egd=yes
60
+else
61
+  ac_cv_lib_crypto_RAND_egd=no
62
+fi
63
+rm -f core conftest.err conftest.$ac_objext \
64
+    conftest$ac_exeext conftest.$ac_ext
65
+LIBS=$ac_check_lib_save_LIBS
66
+fi
67
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_egd" >&5
68
+$as_echo "$ac_cv_lib_crypto_RAND_egd" >&6; }
69
+if test "x$ac_cv_lib_crypto_RAND_egd" = xyes; then :
70
+
71
+$as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h
72
+
73
+fi
74
+
75
+
76
 mv config.c Modules
(-)python27/files/patch-configure.ac (+33 lines)
Line 0 Link Here
1
--- configure.ac.orig	2014-11-27 14:00:55.585944435 +0100
2
+++ configure.ac	2014-11-27 14:41:05.848776114 +0100
3
@@ -88,11 +88,6 @@
4
 AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
5
 
6
 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
7
-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
8
-# them.
9
-AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
10
-
11
-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
12
 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
13
 AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
14
 
15
@@ -426,9 +421,8 @@
16
   # but used in struct sockaddr.sa_family. Reported by Tim Rice.
17
   SCO_SV/3.2)
18
     define_xopen_source=no;;
19
-  # On FreeBSD 4, the math functions C89 does not cover are never defined
20
-  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
21
-  FreeBSD/4.*)
22
+  # On FreeBSD,  defining _XOPEN_SOURCE to 600 requests a strict environment.
23
+  FreeBSD/*)
24
     define_xopen_source=no;;
25
   # On MacOS X 10.2, a bug in ncurses.h means that it craps out if 
26
   # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
27
@@ -4585,4 +4579,6 @@
28
 *) ;;
29
 esac
30
 
31
+AC_CHECK_LIB(crypto, RAND_egd, AC_DEFINE(HAVE_RAND_EGD, 1, [Define if the libcrypto has RAND_egd]))
32
+
33
 mv config.c Modules
(-)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

Return to bug 192511