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