Hi, this is the diff to use rthreads with Python.
Attached are two diffs: - update 2.7.1 to use rthreads - update 2.7.1 to 2.7.2 to use rthreads Please test the first diff, and if everything is ok test the second. Thanks, -- Remi
Index: Makefile =================================================================== RCS file: /cvs/ports/lang/python/2.7/Makefile,v retrieving revision 1.16 diff -u -p -r1.16 Makefile --- Makefile 27 Sep 2011 21:27:36 -0000 1.16 +++ Makefile 23 Feb 2012 20:57:15 -0000 @@ -2,8 +2,8 @@ VERSION = 2.7 PATCHLEVEL = .1 -REVISION = 12 -REVISION-bsddb = 13 +REVISION = 13 +REVISION-bsddb = 14 SHARED_LIBS = python2.7 0.0 VERSION_SPEC = >=2.7,<2.8 Index: patches/patch-Lib_tempfile_py =================================================================== RCS file: patches/patch-Lib_tempfile_py diff -N patches/patch-Lib_tempfile_py --- patches/patch-Lib_tempfile_py 6 Jul 2011 12:05:56 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-Lib_tempfile_py,v 1.2 2011/07/06 12:05:56 jasper Exp $ ---- Lib/tempfile.py.orig Wed Jul 1 15:34:35 2009 -+++ Lib/tempfile.py Wed Jul 6 14:05:40 2011 -@@ -155,7 +155,7 @@ def _candidate_tempdir_list(): - elif _os.name == 'nt': - dirlist.extend([ r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ]) - else: -- dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ]) -+ dirlist.extend([ '/tmp', '/var/tmp' ]) - - # As a last resort, the current directory. - try: Index: patches/patch-Lib_test_regrtest_py =================================================================== RCS file: patches/patch-Lib_test_regrtest_py diff -N patches/patch-Lib_test_regrtest_py --- patches/patch-Lib_test_regrtest_py 6 Jul 2011 12:05:56 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-Lib_test_regrtest_py,v 1.2 2011/07/06 12:05:56 jasper Exp $ ---- Lib/test/regrtest.py.orig Wed Jul 6 14:05:40 2011 -+++ Lib/test/regrtest.py Wed Jul 6 14:05:41 2011 -@@ -1170,6 +1170,8 @@ _expectations = { - """, - 'unixware7': - """ -+ test_audioop -+ test_imageop - test_bsddb - test_bsddb185 - test_dl Index: patches/patch-Lib_test_test_signal_py =================================================================== RCS file: patches/patch-Lib_test_test_signal_py diff -N patches/patch-Lib_test_test_signal_py --- patches/patch-Lib_test_test_signal_py 14 Sep 2011 09:23:11 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ -$OpenBSD: patch-Lib_test_test_signal_py,v 1.4 2011/09/14 09:23:11 fgsch Exp $ - -workarounds for breakage caused by libpthread - ---- Lib/test/test_signal.py.orig Sun Nov 21 13:34:58 2010 -+++ Lib/test/test_signal.py Sat Sep 10 17:13:14 2011 -@@ -461,8 +461,8 @@ class ItimerTest(unittest.TestCase): - self.assertEqual(self.hndl_called, True) - - # Issue 3864. Unknown if this affects earlier versions of freebsd also. -- @unittest.skipIf(sys.platform=='freebsd6', -- 'itimer not reliable (does not mix well with threading) on freebsd6') -+ @unittest.skipIf(sys.platform in ('freebsd6', 'openbsd3', 'openbsd4', 'openbsd5'), -+ 'itimer not reliable (does not mix well with threading) on some BSDs.') - def test_itimer_prof(self): - self.itimer = signal.ITIMER_PROF - signal.signal(signal.SIGPROF, self.sig_prof) Index: patches/patch-Python_ceval_c =================================================================== RCS file: patches/patch-Python_ceval_c diff -N patches/patch-Python_ceval_c --- patches/patch-Python_ceval_c 5 May 2011 23:25:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-Python_ceval_c,v 1.1 2011/05/05 23:25:44 fgsch Exp $ ---- Python/ceval.c.orig Thu Apr 28 11:50:30 2011 -+++ Python/ceval.c Thu Apr 28 11:50:52 2011 -@@ -385,7 +385,7 @@ PyEval_RestoreThread(PyThreadState *tstate) - #endif - */ - --#ifdef WITH_THREAD -+#if defined(WITH_THREAD) && !defined(__OpenBSD__) - - /* The WITH_THREAD implementation is thread-safe. It allows - scheduling to be made from any thread, and even from an executing
Index: Makefile =================================================================== RCS file: /cvs/ports/lang/python/2.7/Makefile,v retrieving revision 1.16 diff -u -p -r1.16 Makefile --- Makefile 27 Sep 2011 21:27:36 -0000 1.16 +++ Makefile 20 Feb 2012 09:09:30 -0000 @@ -1,13 +1,11 @@ # $OpenBSD: Makefile,v 1.16 2011/09/27 21:27:36 sthen Exp $ VERSION = 2.7 -PATCHLEVEL = .1 -REVISION = 12 -REVISION-bsddb = 13 +PATCHLEVEL = .2 SHARED_LIBS = python2.7 0.0 VERSION_SPEC = >=2.7,<2.8 -AUTOCONF_VERSION = 2.65 +AUTOCONF_VERSION = 2.68 CONFIGURE_ARGS += --with-cxx_main \ --with-system-expat Index: distinfo =================================================================== RCS file: /cvs/ports/lang/python/2.7/distinfo,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 distinfo --- distinfo 24 Apr 2011 09:31:44 -0000 1.1.1.1 +++ distinfo 20 Feb 2012 09:09:30 -0000 @@ -1,5 +1,5 @@ -MD5 (Python-2.7.1.tgz) = Fe1WczZV4/q3heSacnjS+w== -RMD160 (Python-2.7.1.tgz) = CTxJp5LXVfUXPbsE6Vljnz6eYWs= -SHA1 (Python-2.7.1.tgz) = 3WuRDEeRKnxdjyO3/ArIv4Rl65I= -SHA256 (Python-2.7.1.tgz) = yhPnsYYIIUlPcN4BcgIoOtc7H7e9iFhkAcVO+Vgibsg= -SIZE (Python-2.7.1.tgz) = 14058131 +MD5 (Python-2.7.2.tgz) = Dd/iZfGz0KjCRZ9b9miUxw== +RMD160 (Python-2.7.2.tgz) = HdgHP3CLkrtXttOsqRS1T4HxBxw= +SHA1 (Python-2.7.2.tgz) = WnTB2ubCpMI9D5rqs09sskd03PM= +SHA256 (Python-2.7.2.tgz) = HVS3CWwXkCw/QP/OfluE4ActAUQCQYT/8YSoTVY6u7M= +SIZE (Python-2.7.2.tgz) = 14091337 Index: patches/patch-Lib_tempfile_py =================================================================== RCS file: patches/patch-Lib_tempfile_py diff -N patches/patch-Lib_tempfile_py --- patches/patch-Lib_tempfile_py 6 Jul 2011 12:05:56 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-Lib_tempfile_py,v 1.2 2011/07/06 12:05:56 jasper Exp $ ---- Lib/tempfile.py.orig Wed Jul 1 15:34:35 2009 -+++ Lib/tempfile.py Wed Jul 6 14:05:40 2011 -@@ -155,7 +155,7 @@ def _candidate_tempdir_list(): - elif _os.name == 'nt': - dirlist.extend([ r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ]) - else: -- dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ]) -+ dirlist.extend([ '/tmp', '/var/tmp' ]) - - # As a last resort, the current directory. - try: Index: patches/patch-Lib_test_regrtest_py =================================================================== RCS file: patches/patch-Lib_test_regrtest_py diff -N patches/patch-Lib_test_regrtest_py --- patches/patch-Lib_test_regrtest_py 6 Jul 2011 12:05:56 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-Lib_test_regrtest_py,v 1.2 2011/07/06 12:05:56 jasper Exp $ ---- Lib/test/regrtest.py.orig Wed Jul 6 14:05:40 2011 -+++ Lib/test/regrtest.py Wed Jul 6 14:05:41 2011 -@@ -1170,6 +1170,8 @@ _expectations = { - """, - 'unixware7': - """ -+ test_audioop -+ test_imageop - test_bsddb - test_bsddb185 - test_dl Index: patches/patch-Lib_test_test_signal_py =================================================================== RCS file: patches/patch-Lib_test_test_signal_py diff -N patches/patch-Lib_test_test_signal_py --- patches/patch-Lib_test_test_signal_py 14 Sep 2011 09:23:11 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ -$OpenBSD: patch-Lib_test_test_signal_py,v 1.4 2011/09/14 09:23:11 fgsch Exp $ - -workarounds for breakage caused by libpthread - ---- Lib/test/test_signal.py.orig Sun Nov 21 13:34:58 2010 -+++ Lib/test/test_signal.py Sat Sep 10 17:13:14 2011 -@@ -461,8 +461,8 @@ class ItimerTest(unittest.TestCase): - self.assertEqual(self.hndl_called, True) - - # Issue 3864. Unknown if this affects earlier versions of freebsd also. -- @unittest.skipIf(sys.platform=='freebsd6', -- 'itimer not reliable (does not mix well with threading) on freebsd6') -+ @unittest.skipIf(sys.platform in ('freebsd6', 'openbsd3', 'openbsd4', 'openbsd5'), -+ 'itimer not reliable (does not mix well with threading) on some BSDs.') - def test_itimer_prof(self): - self.itimer = signal.ITIMER_PROF - signal.signal(signal.SIGPROF, self.sig_prof) Index: patches/patch-Lib_test_test_urllib2_py =================================================================== RCS file: patches/patch-Lib_test_test_urllib2_py diff -N patches/patch-Lib_test_test_urllib2_py --- patches/patch-Lib_test_test_urllib2_py 6 Jul 2011 12:05:56 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,35 +0,0 @@ -$OpenBSD: patch-Lib_test_test_urllib2_py,v 1.3 2011/07/06 12:05:56 jasper Exp $ - -Test fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3 - ---- Lib/test/test_urllib2.py.orig Mon Nov 22 06:04:33 2010 -+++ Lib/test/test_urllib2.py Wed Jul 6 14:05:40 2011 -@@ -969,6 +969,28 @@ class HandlerTests(unittest.TestCase): - self.assertEqual(count, - urllib2.HTTPRedirectHandler.max_redirections) - -+ def test_invalid_redirect(self): -+ from_url = "http://example.com/a.html" -+ valid_schemes = ['http', 'https', 'ftp'] -+ invalid_schemes = ['file', 'imap', 'ldap'] -+ schemeless_url = "example.com/b.html" -+ h = urllib2.HTTPRedirectHandler() -+ o = h.parent = MockOpener() -+ req = Request(from_url) -+ req.timeout = socket._GLOBAL_DEFAULT_TIMEOUT -+ -+ for scheme in invalid_schemes: -+ invalid_url = scheme + '://' + schemeless_url -+ self.assertRaises(urllib2.HTTPError, h.http_error_302, -+ req, MockFile(), 302, "Security Loophole", -+ MockHeaders({"location": invalid_url})) -+ -+ for scheme in valid_schemes: -+ valid_url = scheme + '://' + schemeless_url -+ h.http_error_302(req, MockFile(), 302, "That's fine", -+ MockHeaders({"location": valid_url})) -+ self.assertEqual(o.req.get_full_url(), valid_url) -+ - def test_cookie_redirect(self): - # cookies shouldn't leak into redirected requests - from cookielib import CookieJar Index: patches/patch-Lib_test_test_urllib_py =================================================================== RCS file: patches/patch-Lib_test_test_urllib_py diff -N patches/patch-Lib_test_test_urllib_py --- patches/patch-Lib_test_test_urllib_py 6 Jul 2011 12:05:56 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@ -$OpenBSD: patch-Lib_test_test_urllib_py,v 1.3 2011/07/06 12:05:56 jasper Exp $ - -Test fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3 - ---- Lib/test/test_urllib.py.orig Sun Nov 21 14:34:58 2010 -+++ Lib/test/test_urllib.py Wed Jul 6 14:05:40 2011 -@@ -161,6 +161,20 @@ Content-Type: text/html; charset=iso-8859-1 - finally: - self.unfakehttp() - -+ def test_invalid_redirect(self): -+ # urlopen() should raise IOError for many error codes. -+ self.fakehttp("""HTTP/1.1 302 Found -+Date: Wed, 02 Jan 2008 03:03:54 GMT -+Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e -+Location: file:README -+Connection: close -+Content-Type: text/html; charset=iso-8859-1 -+""") -+ try: -+ self.assertRaises(IOError, urllib.urlopen, "http://python.org/") -+ finally: -+ self.unfakehttp() -+ - def test_empty_socket(self): - # urlopen() raises IOError if the underlying socket does not send any - # data. (#1680230) Index: patches/patch-Lib_urllib2_py =================================================================== RCS file: patches/patch-Lib_urllib2_py diff -N patches/patch-Lib_urllib2_py --- patches/patch-Lib_urllib2_py 6 Jul 2011 12:05:56 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,24 +0,0 @@ -$OpenBSD: patch-Lib_urllib2_py,v 1.3 2011/07/06 12:05:56 jasper Exp $ - -Fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3 - ---- Lib/urllib2.py.orig Sat Nov 20 12:24:08 2010 -+++ Lib/urllib2.py Wed Jul 6 14:05:40 2011 -@@ -579,6 +579,17 @@ class HTTPRedirectHandler(BaseHandler): - - newurl = urlparse.urljoin(req.get_full_url(), newurl) - -+ # For security reasons we do not allow redirects to protocols -+ # other than HTTP, HTTPS or FTP. -+ newurl_lower = newurl.lower() -+ if not (newurl_lower.startswith('http://') or -+ newurl_lower.startswith('https://') or -+ newurl_lower.startswith('ftp://')): -+ raise HTTPError(newurl, code, -+ msg + " - Redirection to url '%s' is not allowed" % -+ newurl, -+ headers, fp) -+ - # XXX Probably want to forget about the state of the current - # request, although that might interact poorly with other - # handlers that also use handler-specific request attributes Index: patches/patch-Lib_urllib_py =================================================================== RCS file: patches/patch-Lib_urllib_py diff -N patches/patch-Lib_urllib_py --- patches/patch-Lib_urllib_py 7 May 2011 09:35:13 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,25 +0,0 @@ -$OpenBSD: patch-Lib_urllib_py,v 1.2 2011/05/07 09:35:13 fgsch Exp $ - -Fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3 - ---- Lib/urllib.py.orig Sat Apr 23 15:02:11 2011 -+++ Lib/urllib.py Sat Apr 23 15:09:17 2011 -@@ -644,6 +644,18 @@ class FancyURLopener(URLopener): - fp.close() - # In case the server sent a relative URL, join with original: - newurl = basejoin(self.type + ":" + url, newurl) -+ -+ # For security reasons we do not allow redirects to protocols -+ # other than HTTP, HTTPS or FTP. -+ newurl_lower = newurl.lower() -+ if not (newurl_lower.startswith('http://') or -+ newurl_lower.startswith('https://') or -+ newurl_lower.startswith('ftp://')): -+ raise IOError('redirect error', errcode, -+ errmsg + " - Redirection to url '%s' is not allowed" % -+ newurl, -+ headers) -+ - return self.open(newurl) - - def http_error_301(self, url, fp, errcode, errmsg, headers, data=None): Index: patches/patch-Makefile_pre_in =================================================================== RCS file: /cvs/ports/lang/python/2.7/patches/patch-Makefile_pre_in,v retrieving revision 1.2 diff -u -p -r1.2 patch-Makefile_pre_in --- patches/patch-Makefile_pre_in 6 Jul 2011 12:05:56 -0000 1.2 +++ patches/patch-Makefile_pre_in 20 Feb 2012 09:09:30 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-Makefile_pre_in,v 1.2 2011/07/06 12:05:56 jasper Exp $ ---- Makefile.pre.in.orig Thu Oct 14 13:37:30 2010 -+++ Makefile.pre.in Wed Jul 6 14:05:40 2011 -@@ -360,6 +360,8 @@ LIBRARY_OBJS= \ +--- Makefile.pre.in.orig Sat Jun 11 17:46:26 2011 ++++ Makefile.pre.in Sun Feb 19 19:10:29 2012 +@@ -363,6 +363,8 @@ LIBRARY_OBJS= \ ######################################################################### # Rules @@ -10,7 +10,7 @@ $OpenBSD: patch-Makefile_pre_in,v 1.2 20 # Default target all: build_all build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks -@@ -395,7 +397,7 @@ coverage: +@@ -398,7 +400,7 @@ coverage: $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ Modules/python.o \ @@ -19,7 +19,7 @@ $OpenBSD: patch-Makefile_pre_in,v 1.2 20 platform: $(BUILDPYTHON) $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform -@@ -444,8 +446,12 @@ gdbhooks: $(BUILDPYTHON)-gdb.py +@@ -447,8 +449,12 @@ gdbhooks: $(BUILDPYTHON)-gdb.py SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS) @@ -33,7 +33,7 @@ $OpenBSD: patch-Makefile_pre_in,v 1.2 20 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current # directory. -@@ -787,7 +793,6 @@ bininstall: altbininstall +@@ -792,7 +798,6 @@ bininstall: altbininstall then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \ else true; \ fi @@ -41,7 +41,7 @@ $OpenBSD: patch-Makefile_pre_in,v 1.2 20 -rm -f $(DESTDIR)$(BINDIR)/python-config (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config) -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC) -@@ -797,7 +802,7 @@ bininstall: altbininstall +@@ -802,7 +807,7 @@ bininstall: altbininstall # Install the interpreter with $(VERSION) affixed # This goes into $(exec_prefix) altbininstall: $(BUILDPYTHON) @@ -50,7 +50,7 @@ $OpenBSD: patch-Makefile_pre_in,v 1.2 20 do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ -@@ -813,7 +818,8 @@ altbininstall: $(BUILDPYTHON) +@@ -818,7 +823,8 @@ altbininstall: $(BUILDPYTHON) $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ @@ -60,7 +60,7 @@ $OpenBSD: patch-Makefile_pre_in,v 1.2 20 fi; \ else true; \ fi -@@ -942,8 +948,8 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) +@@ -947,8 +953,8 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" # Create the PLATDIR source directory, if one wasn't distributed.. Index: patches/patch-Python_ceval_c =================================================================== RCS file: patches/patch-Python_ceval_c diff -N patches/patch-Python_ceval_c --- patches/patch-Python_ceval_c 5 May 2011 23:25:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-Python_ceval_c,v 1.1 2011/05/05 23:25:44 fgsch Exp $ ---- Python/ceval.c.orig Thu Apr 28 11:50:30 2011 -+++ Python/ceval.c Thu Apr 28 11:50:52 2011 -@@ -385,7 +385,7 @@ PyEval_RestoreThread(PyThreadState *tstate) - #endif - */ - --#ifdef WITH_THREAD -+#if defined(WITH_THREAD) && !defined(__OpenBSD__) - - /* The WITH_THREAD implementation is thread-safe. It allows - scheduling to be made from any thread, and even from an executing Index: patches/patch-configure_in =================================================================== RCS file: /cvs/ports/lang/python/2.7/patches/patch-configure_in,v retrieving revision 1.6 diff -u -p -r1.6 patch-configure_in --- patches/patch-configure_in 10 Dec 2011 19:06:03 -0000 1.6 +++ patches/patch-configure_in 20 Feb 2012 09:09:30 -0000 @@ -2,9 +2,9 @@ $OpenBSD: patch-configure_in,v 1.6 2011/ Wrong value of LDSHARED in sysconfig, cf http://bugs.python.org/issue10547 ---- configure.in.orig Mon Nov 1 02:47:19 2010 -+++ configure.in Thu Jul 7 22:57:06 2011 -@@ -331,7 +331,7 @@ case $ac_sys_system/$ac_sys_release in +--- configure.in.orig Sat Jun 11 17:46:28 2011 ++++ configure.in Sun Feb 19 19:10:29 2012 +@@ -324,7 +324,7 @@ case $ac_sys_system/$ac_sys_release in # As this has a different meaning on Linux, only define it on OpenBSD AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features]) ;; @@ -13,42 +13,7 @@ Wrong value of LDSHARED in sysconfig, cf # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is # also defined. This can be overridden by defining _BSD_SOURCE # As this has a different meaning on Linux, only define it on OpenBSD -@@ -1850,30 +1850,14 @@ then - BSD/OS*/4*) - LDSHARED="gcc -shared" - LDCXXSHARED="g++ -shared";; -- FreeBSD*) -+ FreeBSD*|OpenBSD*) - if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] - then -- LDSHARED='$(CC) -shared ${LDFLAGS}' -- LDCXXSHARED='$(CXX) -shared ${LDFLAGS}' -+ LDSHARED='$(CC) -shared' -+ LDCXXSHARED='$(CXX) -shared' - else -- LDSHARED="ld -Bshareable ${LDFLAGS}" -+ LDSHARED="ld -Bshareable" - fi;; -- OpenBSD*) -- if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] -- then -- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}' -- LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}' -- else -- case `uname -r` in -- [[01]].* | 2.[[0-7]] | 2.[[0-7]].*) -- LDSHARED="ld -Bshareable ${LDFLAGS}" -- ;; -- *) -- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}' -- LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}' -- ;; -- esac -- fi;; - NetBSD*|DragonFly*) - LDSHARED="cc -shared ${LDFLAGS}" - LDCXXSHARED="c++ -shared ${LDFLAGS}";; -@@ -2035,9 +2019,10 @@ AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-U +@@ -2049,9 +2049,10 @@ AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-U # only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then Index: patches/patch-setup_py =================================================================== RCS file: /cvs/ports/lang/python/2.7/patches/patch-setup_py,v retrieving revision 1.2 diff -u -p -r1.2 patch-setup_py --- patches/patch-setup_py 6 Jul 2011 12:05:56 -0000 1.2 +++ patches/patch-setup_py 20 Feb 2012 09:09:30 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/06 12:05:56 jasper Exp $ ---- setup.py.orig Sun Oct 31 17:40:21 2010 -+++ setup.py Wed Jul 6 14:05:41 2011 +--- setup.py.orig Sat Jun 11 17:46:28 2011 ++++ setup.py Sun Feb 19 19:12:04 2012 @@ -23,6 +23,11 @@ COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount # This global variable is used to hold the list of modules to be disabled. disabled_module_list = [] @@ -13,7 +13,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 def add_dir_to_list(dirlist, dir): """Add the directory 'dir' to the list 'dirlist' (at the front) if 1) 'dir' is not already in 'dirlist' -@@ -347,8 +352,8 @@ class PyBuildExt(build_ext): +@@ -369,8 +374,8 @@ class PyBuildExt(build_ext): def detect_modules(self): # Ensure that /usr/local is always used @@ -21,10 +21,10 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + add_dir_to_list(self.compiler.library_dirs, usrlocal('lib')) + add_dir_to_list(self.compiler.include_dirs, usrlocal('include')) + self.add_multiarch_paths() # Add paths specified in the environment variables LDFLAGS and - # CPPFLAGS for header and library files. -@@ -680,8 +685,6 @@ class PyBuildExt(build_ext): +@@ -703,8 +708,6 @@ class PyBuildExt(build_ext): depends = ['socketmodule.h']) ) # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ @@ -33,7 +33,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 ] ssl_incs = find_file('openssl/ssl.h', inc_dirs, search_for_ssl_incs_in -@@ -692,9 +695,7 @@ class PyBuildExt(build_ext): +@@ -715,9 +718,7 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, @@ -44,7 +44,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 if (ssl_incs is not None and ssl_libs is not None): -@@ -793,7 +794,7 @@ class PyBuildExt(build_ext): +@@ -816,7 +817,7 @@ class PyBuildExt(build_ext): # BerkeleyDB 4.6.x is not stable on many architectures. arch = platform_machine() if arch not in ('i386', 'i486', 'i586', 'i686', @@ -53,7 +53,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 return False return True -@@ -856,6 +857,7 @@ class PyBuildExt(build_ext): +@@ -879,6 +880,7 @@ class PyBuildExt(build_ext): std_variants.append(os.path.join(dn, "db3.%d"%x)) db_inc_paths = std_variants + db_inc_paths @@ -61,7 +61,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)] db_ver_inc_map = {} -@@ -919,6 +921,7 @@ class PyBuildExt(build_ext): +@@ -942,6 +944,7 @@ class PyBuildExt(build_ext): db_incdir.replace("include", 'lib64'), db_incdir.replace("include", 'lib'), ] @@ -69,7 +69,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 if sys.platform != 'darwin': db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check) -@@ -941,6 +944,7 @@ class PyBuildExt(build_ext): +@@ -964,6 +967,7 @@ class PyBuildExt(build_ext): # symlink to more general names? for dblib in (('db-%d.%d' % db_ver), ('db%d%d' % db_ver), @@ -77,7 +77,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 ('db%d' % db_ver[0])): dblib_file = self.compiler.find_library_file( db_dirs_to_check + lib_dirs, dblib ) -@@ -988,6 +992,7 @@ class PyBuildExt(build_ext): +@@ -1011,6 +1015,7 @@ class PyBuildExt(build_ext): '/usr/local/include/sqlite', '/usr/local/include/sqlite3', ] @@ -85,7 +85,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 MIN_SQLITE_VERSION_NUMBER = (3, 0, 8) MIN_SQLITE_VERSION = ".".join([str(x) for x in MIN_SQLITE_VERSION_NUMBER]) -@@ -1033,6 +1038,7 @@ class PyBuildExt(build_ext): +@@ -1056,6 +1061,7 @@ class PyBuildExt(build_ext): os.path.join(sqlite_incdir, '..', '..', 'lib64'), os.path.join(sqlite_incdir, '..', '..', 'lib'), ] @@ -93,7 +93,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 sqlite_libfile = self.compiler.find_library_file( sqlite_dirs_to_check + lib_dirs, 'sqlite3') if sqlite_libfile: -@@ -1097,7 +1103,7 @@ class PyBuildExt(build_ext): +@@ -1120,7 +1126,7 @@ class PyBuildExt(build_ext): sysroot = macosx_sdk_root() f = os.path.join(sysroot, f[1:]) @@ -102,7 +102,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 data = open(f).read() m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) if m is not None: -@@ -1416,7 +1422,11 @@ class PyBuildExt(build_ext): +@@ -1439,7 +1445,11 @@ class PyBuildExt(build_ext): libraries = [] elif platform.startswith('openbsd'): @@ -115,7 +115,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 libraries = [] elif platform.startswith('netbsd'): -@@ -1464,6 +1474,9 @@ class PyBuildExt(build_ext): +@@ -1487,6 +1497,9 @@ class PyBuildExt(build_ext): 'freebsd7', 'freebsd8') or platform.startswith("gnukfreebsd")): exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) ) @@ -125,7 +125,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 else: missing.append('ossaudiodev') -@@ -1637,7 +1650,7 @@ class PyBuildExt(build_ext): +@@ -1660,7 +1673,7 @@ class PyBuildExt(build_ext): # For 8.4a2, the X11 headers are not included. Rather than include a # complicated search, this is a hard-coded path. It could bail out # if X11 libs are not found... @@ -134,7 +134,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] # All existing framework builds of Tcl/Tk don't support 64-bit -@@ -1687,8 +1700,7 @@ class PyBuildExt(build_ext): +@@ -1710,8 +1723,7 @@ class PyBuildExt(build_ext): # The versions with dots are used on Unix, and the versions without # dots on Windows, for detection by cygwin. tcllib = tklib = tcl_includes = tk_includes = None @@ -144,7 +144,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version) tcllib = self.compiler.find_library_file(lib_dirs, -@@ -1731,17 +1743,9 @@ class PyBuildExt(build_ext): +@@ -1754,17 +1766,9 @@ class PyBuildExt(build_ext): if platform == 'sunos5': include_dirs.append('/usr/openwin/include') added_lib_dirs.append('/usr/openwin/lib') @@ -165,7 +165,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0 # If Cygwin, then verify that X is installed before proceeding if platform == 'cygwin': -@@ -2045,7 +2049,7 @@ def main(): +@@ -2068,7 +2072,7 @@ def main(): # Scripts to install scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', 'Tools/scripts/2to3', Index: pkg/PLIST-main =================================================================== RCS file: /cvs/ports/lang/python/2.7/pkg/PLIST-main,v retrieving revision 1.3 diff -u -p -r1.3 PLIST-main --- pkg/PLIST-main 18 Jul 2011 15:32:18 -0000 1.3 +++ pkg/PLIST-main 20 Feb 2012 09:09:30 -0000 @@ -450,10 +450,10 @@ lib/python2.7/distutils/command/sdist.py lib/python2.7/distutils/command/upload.py lib/python2.7/distutils/command/upload.pyc lib/python2.7/distutils/command/upload.pyo +@comment lib/python2.7/distutils/command/wininst-9.0-${MACHINE_ARCH}.exe @comment lib/python2.7/distutils/command/wininst-6.0.exe @comment lib/python2.7/distutils/command/wininst-7.1.exe @comment lib/python2.7/distutils/command/wininst-8.0.exe -@comment lib/python2.7/distutils/command/wininst-9.0-${MACHINE_ARCH}.exe @comment lib/python2.7/distutils/command/wininst-9.0.exe lib/python2.7/distutils/config.py lib/python2.7/distutils/config.pyc @@ -1335,7 +1335,7 @@ lib/python2.7/keyword.py lib/python2.7/keyword.pyc lib/python2.7/keyword.pyo lib/python2.7/lib-dynload/ -lib/python2.7/lib-dynload/Python-2.7.1-py2.7.egg-info +lib/python2.7/lib-dynload/Python-2.7.2-py2.7.egg-info lib/python2.7/lib-dynload/_bisect.so lib/python2.7/lib-dynload/_codecs_cn.so lib/python2.7/lib-dynload/_codecs_hk.so @@ -1395,15 +1395,17 @@ lib/python2.7/lib-dynload/termios.so lib/python2.7/lib-dynload/time.so lib/python2.7/lib-dynload/unicodedata.so lib/python2.7/lib-dynload/zlib.so -lib/python2.7/lib-old/ lib/python2.7/lib2to3/ lib/python2.7/lib2to3/Grammar.txt -lib/python2.7/lib2to3/Grammar2.7.1.final.0.pickle +lib/python2.7/lib2to3/Grammar2.7.2.final.0.pickle lib/python2.7/lib2to3/PatternGrammar.txt -lib/python2.7/lib2to3/PatternGrammar2.7.1.final.0.pickle +lib/python2.7/lib2to3/PatternGrammar2.7.2.final.0.pickle lib/python2.7/lib2to3/__init__.py lib/python2.7/lib2to3/__init__.pyc lib/python2.7/lib2to3/__init__.pyo +lib/python2.7/lib2to3/__main__.py +lib/python2.7/lib2to3/__main__.pyc +lib/python2.7/lib2to3/__main__.pyo lib/python2.7/lib2to3/btm_matcher.py lib/python2.7/lib2to3/btm_matcher.pyc lib/python2.7/lib2to3/btm_matcher.pyo Index: pkg/PLIST-tests =================================================================== RCS file: /cvs/ports/lang/python/2.7/pkg/PLIST-tests,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 PLIST-tests --- pkg/PLIST-tests 24 Apr 2011 09:31:46 -0000 1.1.1.1 +++ pkg/PLIST-tests 20 Feb 2012 09:09:31 -0000 @@ -28,9 +28,33 @@ lib/python2.7/test/buffer_tests.pyc lib/python2.7/test/buffer_tests.pyo lib/python2.7/test/cfgparser.1 lib/python2.7/test/check_soundcard.vbs -lib/python2.7/test/cjkencodings_test.py -lib/python2.7/test/cjkencodings_test.pyc -lib/python2.7/test/cjkencodings_test.pyo +lib/python2.7/test/cjkencodings/ +lib/python2.7/test/cjkencodings/big5-utf8.txt +lib/python2.7/test/cjkencodings/big5.txt +lib/python2.7/test/cjkencodings/big5hkscs-utf8.txt +lib/python2.7/test/cjkencodings/big5hkscs.txt +lib/python2.7/test/cjkencodings/cp949-utf8.txt +lib/python2.7/test/cjkencodings/cp949.txt +lib/python2.7/test/cjkencodings/euc_jisx0213-utf8.txt +lib/python2.7/test/cjkencodings/euc_jisx0213.txt +lib/python2.7/test/cjkencodings/euc_jp-utf8.txt +lib/python2.7/test/cjkencodings/euc_jp.txt +lib/python2.7/test/cjkencodings/euc_kr-utf8.txt +lib/python2.7/test/cjkencodings/euc_kr.txt +lib/python2.7/test/cjkencodings/gb18030-utf8.txt +lib/python2.7/test/cjkencodings/gb18030.txt +lib/python2.7/test/cjkencodings/gb2312-utf8.txt +lib/python2.7/test/cjkencodings/gb2312.txt +lib/python2.7/test/cjkencodings/gbk-utf8.txt +lib/python2.7/test/cjkencodings/gbk.txt +lib/python2.7/test/cjkencodings/hz-utf8.txt +lib/python2.7/test/cjkencodings/hz.txt +lib/python2.7/test/cjkencodings/johab-utf8.txt +lib/python2.7/test/cjkencodings/johab.txt +lib/python2.7/test/cjkencodings/shift_jis-utf8.txt +lib/python2.7/test/cjkencodings/shift_jis.txt +lib/python2.7/test/cjkencodings/shift_jisx0213-utf8.txt +lib/python2.7/test/cjkencodings/shift_jisx0213.txt lib/python2.7/test/cmath_testcases.txt lib/python2.7/test/curses_tests.py lib/python2.7/test/curses_tests.pyc @@ -279,6 +303,10 @@ lib/python2.7/test/ssl_key.pem lib/python2.7/test/string_tests.py lib/python2.7/test/string_tests.pyc lib/python2.7/test/string_tests.pyo +lib/python2.7/test/subprocessdata/ +lib/python2.7/test/subprocessdata/sigchild_ignore.py +lib/python2.7/test/subprocessdata/sigchild_ignore.pyc +lib/python2.7/test/subprocessdata/sigchild_ignore.pyo lib/python2.7/test/svn_python_org_https_cert.pem lib/python2.7/test/test_MimeWriter.py lib/python2.7/test/test_MimeWriter.pyc @@ -927,6 +955,9 @@ lib/python2.7/test/test_module.pyo lib/python2.7/test/test_modulefinder.py lib/python2.7/test/test_modulefinder.pyc lib/python2.7/test/test_modulefinder.pyo +lib/python2.7/test/test_msilib.py +lib/python2.7/test/test_msilib.pyc +lib/python2.7/test/test_msilib.pyo lib/python2.7/test/test_multibytecodec.py lib/python2.7/test/test_multibytecodec.pyc lib/python2.7/test/test_multibytecodec.pyo Index: pkg/PLIST-tools =================================================================== RCS file: /cvs/ports/lang/python/2.7/pkg/PLIST-tools,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 PLIST-tools --- pkg/PLIST-tools 24 Apr 2011 09:31:46 -0000 1.1.1.1 +++ pkg/PLIST-tools 20 Feb 2012 09:09:31 -0000 @@ -26,6 +26,14 @@ lib/python2.7/Tools/bgen/bgen/scantools. lib/python2.7/Tools/buildbot/ lib/python2.7/Tools/buildbot/README.tcltk-AMD64 @comment lib/python2.7/Tools/buildbot/build-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/clean-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/external-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/test-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/build-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/clean-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/external-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/test-${MACHINE_ARCH}.bat +@comment lib/python2.7/Tools/buildbot/build-${MACHINE_ARCH}.bat @comment lib/python2.7/Tools/buildbot/build.bat @comment lib/python2.7/Tools/buildbot/buildmsi.bat @comment lib/python2.7/Tools/buildbot/clean-${MACHINE_ARCH}.bat