Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-Include_node.h,v 1.1 2013/04/17 13:21:05 obache Exp $
* _PyNode_SizeOf is used by parsermodule
--- Include/node.h.orig 2013-04-06 14:02:25.000000000 +0000
+++ Include/node.h
@@ -21,7 +21,7 @@ PyAPI_FUNC(int) PyNode_AddChild(node *n,
char *str, int lineno, int col_offset);
PyAPI_FUNC(void) PyNode_Free(node *n);
#ifndef Py_LIMITED_API
-Py_ssize_t _PyNode_SizeOf(node *n);
+PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n);
#endif
/* Node access functions */

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-Include_pyerrors.h,v 1.1 2013/04/17 13:21:05 obache Exp $
* from cygport 2.6.5-export-PySignal_SetWakeupFd.patch
--- Include/pyerrors.h.orig 2013-04-06 14:02:25.000000000 +0000
+++ Include/pyerrors.h
@@ -231,7 +231,7 @@ PyAPI_FUNC(int) PyErr_CheckSignals(void)
PyAPI_FUNC(void) PyErr_SetInterrupt(void);
/* In signalmodule.c */
-int PySignal_SetWakeupFd(int fd);
+PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd);
/* Support for adding program text to SyntaxErrors */
PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-Lib_distutils_unixccompiler.py,v 1.1 2013/04/17 13:21:05 obache Exp $
* from cygport 2.7.3-dylib.patch
--- Lib/distutils/unixccompiler.py.orig 2013-04-06 14:02:26.000000000 +0000
+++ Lib/distutils/unixccompiler.py
@@ -82,6 +82,7 @@ class UnixCCompiler(CCompiler):
static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s"
if sys.platform == "cygwin":
exe_extension = ".exe"
+ dylib_lib_extension = ".dll.a"
def preprocess(self, source,
output_file=None, macros=None, include_dirs=None,

View File

@@ -0,0 +1,98 @@
$NetBSD: patch-Lib_test_nullbytecert.pem,v 1.1.2.2 2013/08/21 11:47:14 tron Exp $
patch for CVE-2013-4238 taken from
http://hg.python.org/cpython/rev/bd2360476bdb
--- Lib/test/nullbytecert.pem.orig 2013-08-18 11:36:17.000000000 +0000
+++ Lib/test/nullbytecert.pem
@@ -0,0 +1,90 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 0 (0x0)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
+ Validity
+ Not Before: Aug 7 13:11:52 2013 GMT
+ Not After : Aug 7 13:12:52 2013 GMT
+ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ Public-Key: (2048 bit)
+ Modulus:
+ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
+ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
+ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
+ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
+ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
+ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
+ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
+ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
+ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
+ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
+ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
+ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
+ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
+ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
+ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
+ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
+ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
+ 2f:85
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints: critical
+ CA:FALSE
+ X509v3 Subject Key Identifier:
+ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Alternative Name:
+ *************************************************************
+ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
+ doesn't print the text after a NULL byte.
+ *************************************************************
+ DNS:altnull.python.org, email:null@python.org, URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
+ Signature Algorithm: sha1WithRSAEncryption
+ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
+ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
+ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
+ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
+ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
+ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
+ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
+ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
+ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
+ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
+ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
+ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
+ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
+ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
+ c1:ca:a9:94
+-----BEGIN CERTIFICATE-----
+MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
+DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
+eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
+RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
+ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
+NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
+DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
+ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
+ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
+hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
+BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
+pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
+vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
+KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
+oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
+08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
+HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
+BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
+Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
+bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
+AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
+i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
+HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
+kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
+VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
+RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
+-----END CERTIFICATE-----

View File

@@ -0,0 +1,67 @@
$NetBSD: patch-Lib_test_test__ssl.py,v 1.1.2.2 2013/08/21 11:47:14 tron Exp $
patch for CVE-2013-4238 taken from
http://hg.python.org/cpython/rev/bd2360476bdb
--- Lib/test/test_ssl.py.orig 2013-05-12 03:32:47.000000000 +0000
+++ Lib/test/test_ssl.py
@@ -25,6 +25,7 @@ ssl = test_support.import_module("ssl")
HOST = test_support.HOST
CERTFILE = None
SVN_PYTHON_ORG_ROOT_CERT = None
+NULLBYTECERT = None
def handle_error(prefix):
exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
@@ -123,6 +124,27 @@ class BasicSocketTests(unittest.TestCase
('DNS', 'projects.forum.nokia.com'))
)
+ def test_parse_cert_CVE_2013_4238(self):
+ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
+ if test_support.verbose:
+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
+ subject = ((('countryName', 'US'),),
+ (('stateOrProvinceName', 'Oregon'),),
+ (('localityName', 'Beaverton'),),
+ (('organizationName', 'Python Software Foundation'),),
+ (('organizationalUnitName', 'Python Core Development'),),
+ (('commonName', 'null.python.org\x00example.org'),),
+ (('emailAddress', 'python-dev@python.org'),))
+ self.assertEqual(p['subject'], subject)
+ self.assertEqual(p['issuer'], subject)
+ self.assertEqual(p['subjectAltName'],
+ (('DNS', 'altnull.python.org\x00example.com'),
+ ('email', 'null@python.org\x00user@example.org'),
+ ('URI', 'http://null.python.org\x00http://example.org'),
+ ('IP Address', '192.0.2.1'),
+ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
+ )
+
def test_DER_to_PEM(self):
with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
pem = f.read()
@@ -1360,7 +1382,7 @@ else:
def test_main(verbose=False):
- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
+ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
"keycert.pem")
SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
@@ -1368,10 +1390,13 @@ def test_main(verbose=False):
"https_svn_python_org_root.pem")
NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
"nokia.pem")
+ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "nullbytecert.pem")
if (not os.path.exists(CERTFILE) or
not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
- not os.path.exists(NOKIACERT)):
+ not os.path.exists(NOKIACERT) or
+ not os.path.exists(NULLBYTECERT)):
raise test_support.TestFailed("Can't read certificate files!")
tests = [BasicTests, BasicSocketTests]

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-Misc_NEWS,v 1.1.2.2 2013/08/21 11:47:14 tron Exp $
patch for CVE-2013-4238 taken from
http://hg.python.org/cpython/rev/bd2360476bdb
--- Misc/NEWS.orig 2013-05-12 03:32:49.000000000 +0000
+++ Misc/NEWS
@@ -26,6 +26,12 @@ Core and Builtins
Library
-------
+- Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes
+ inside subjectAltName correctly. Formerly the module has used OpenSSL's
+ GENERAL_NAME_print() function to get the string represention of ASN.1
+ strings for ``rfc822Name`` (email), ``dNSName`` (DNS) and
+ ``uniformResourceIdentifier`` (URI).
+
- Issue #16601: Restarting iteration over tarfile no more continues from where
it left off. Patch by Michael Birtwell.

View File

@@ -0,0 +1,113 @@
$NetBSD: patch-Modules___ssl.c,v 1.1.2.1 2013/08/21 11:47:14 tron Exp $
* from cygport 2.6.2-ssl-threads.patch
patch for CVE-2013-4238 taken from
http://hg.python.org/cpython/rev/bd2360476bdb
--- Modules/_ssl.c.orig 2013-04-06 14:02:36.000000000 +0000
+++ Modules/_ssl.c
@@ -16,6 +16,10 @@
#include "Python.h"
+#ifdef __CYGWIN__
+#undef WITH_THREAD
+#endif
+
#ifdef WITH_THREAD
#include "pythread.h"
#define PySSL_BEGIN_ALLOW_THREADS { \
@@ -738,13 +742,16 @@ _get_peer_alt_names (X509 *certificate)
ext->value->length));
for(j = 0; j < sk_GENERAL_NAME_num(names); j++) {
-
/* get a rendering of each name in the set of names */
+ int gntype;
+ ASN1_STRING *as = NULL;
name = sk_GENERAL_NAME_value(names, j);
- if (name->type == GEN_DIRNAME) {
-
- /* we special-case DirName as a tuple of tuples of attributes */
+ gntype = name-> type;
+ switch (gntype) {
+ case GEN_DIRNAME:
+ /* we special-case DirName as a tuple of
+ tuples of attributes */
t = PyTuple_New(2);
if (t == NULL) {
@@ -764,11 +771,61 @@ _get_peer_alt_names (X509 *certificate)
goto fail;
}
PyTuple_SET_ITEM(t, 1, v);
+ break;
- } else {
+ case GEN_EMAIL:
+ case GEN_DNS:
+ case GEN_URI:
+ /* GENERAL_NAME_print() doesn't handle NULL bytes in ASN1_string
+ correctly, CVE-2013-4238 */
+ t = PyTuple_New(2);
+ if (t == NULL)
+ goto fail;
+ switch (gntype) {
+ case GEN_EMAIL:
+ v = PyString_FromString("email");
+ as = name->d.rfc822Name;
+ break;
+ case GEN_DNS:
+ v = PyString_FromString("DNS");
+ as = name->d.dNSName;
+ break;
+ case GEN_URI:
+ v = PyString_FromString("URI");
+ as = name->d.uniformResourceIdentifier;
+ break;
+ }
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 0, v);
+ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
+ ASN1_STRING_length(as));
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
+ break;
+ default:
/* for everything else, we use the OpenSSL print form */
-
+ switch (gntype) {
+ /* check for new general name type */
+ case GEN_OTHERNAME:
+ case GEN_X400:
+ case GEN_EDIPARTY:
+ case GEN_IPADD:
+ case GEN_RID:
+ break;
+ default:
+ if (PyErr_Warn(PyExc_RuntimeWarning,
+ "Unknown general name type") == -1) {
+ goto fail;
+ }
+ break;
+ }
(void) BIO_reset(biobuf);
GENERAL_NAME_print(biobuf, name);
len = BIO_gets(biobuf, buf, sizeof(buf)-1);
@@ -794,6 +851,7 @@ _get_peer_alt_names (X509 *certificate)
goto fail;
}
PyTuple_SET_ITEM(t, 1, v);
+ break;
}
/* and add that rendering to the list */

View File

@@ -0,0 +1,35 @@
$NetBSD: patch-Modules_getpath.c,v 1.1 2013/04/17 13:21:05 obache Exp $
* from cygport 2.7.3-getpath-exe-extension.patch
--- Modules/getpath.c.orig 2013-04-06 14:02:37.000000000 +0000
+++ Modules/getpath.c
@@ -436,6 +436,28 @@ calculate_path(void)
if (isxfile(progpath))
break;
+#ifdef __CYGWIN__
+ /*
+ * Cygwin automatically removes the ".exe" extension from argv[0]
+ * to make programs feel like they are in a more Unix-like
+ * environment. Unfortunately, this can make it problemmatic for
+ * Cygwin to distinguish between a directory and an executable with
+ * the same name excluding the ".exe" extension. For example, the
+ * Cygwin Python build directory has a "Python" directory and a
+ * "python.exe" executable. This causes isxfile() to erroneously
+ * return false. If isdir() returns true and there is enough space
+ * to append the ".exe" extension, then we try again with the
+ * extension appended.
+ */
+#define EXE ".exe"
+ if (isdir(progpath) && strlen(progpath) + strlen(EXE) <= MAXPATHLEN)
+ {
+ strcat(progpath, EXE);
+ if (isxfile(progpath))
+ break;
+ }
+#endif /* __CYGWIN__ */
+
if (!delim) {
progpath[0] = '\0';
break;

View File

@@ -0,0 +1,26 @@
$NetBSD: patch-aa,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $
--- Include/py_curses.h.orig 2010-03-25 00:54:54.000000000 +0000
+++ Include/py_curses.h
@@ -44,6 +44,21 @@
#endif
#endif
+#ifdef __NetBSD__
+/*
+** On NetBSD, [n]curses.h and stdlib.h/wchar.h use different guards
+** against multiple definition of wchar_t and wint_t.
+*/
+#ifdef _XOPEN_SOURCE_EXTENDED
+#ifndef _WCHAR_T
+#define _WCHAR_T
+#endif
+#ifndef _WINT_T
+#define _WINT_T
+#endif
+#endif
+#endif
+
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else

View File

@@ -0,0 +1,24 @@
$NetBSD: patch-ab,v 1.2 2012/04/13 18:47:31 adam Exp $
--- Lib/distutils/command/build_ext.py.orig 2010-04-01 18:17:09.000000000 +0000
+++ Lib/distutils/command/build_ext.py
@@ -513,8 +513,19 @@ class build_ext (Command):
# that go into the mix.
if ext.extra_objects:
objects.extend(ext.extra_objects)
+
+ # Two possible sources for extra linker arguments:
+ # - 'extra_link_args' in Extension object
+ # - LDFLAGS environment variable
+ # The environment variable should take precedence, and
+ # any sensible compiler will give precedence to later
+ # command line args. Hence we combine them in order:
extra_args = ext.extra_link_args or []
+ if os.environ.has_key('LDFLAGS'):
+ extra_args = list(extra_args)
+ extra_args.extend(string.split(os.environ['LDFLAGS']))
+
# Detect target language, if not provided
language = ext.language or self.compiler.detect_language(sources)

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ad,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $
Add ability to parse unsigned integers as externalized by NetBSD proplib(3).
--- Lib/plistlib.py.orig 2010-04-20 20:59:37.000000000 +0000
+++ Lib/plistlib.py
@@ -463,7 +463,7 @@ class PlistParser:
def end_false(self):
self.addObject(False)
def end_integer(self):
- self.addObject(int(self.getData()))
+ self.addObject(int(self.getData(), 0))
def end_real(self):
self.addObject(float(self.getData()))
def end_string(self):

View File

@@ -0,0 +1,43 @@
$NetBSD: patch-ae,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $
XXXbjs: I use amd64, and audioop is broken on 64-bit platforms.
Thus, this needs to be tested.
--- Modules/sunaudiodev.c.orig 2010-05-09 14:46:46.000000000 +0000
+++ Modules/sunaudiodev.c
@@ -224,7 +224,11 @@ sad_ibufcount(sadobject *self)
{
audio_info_t ai;
+#if defined(__NetBSD__) && defined(AUDIO_GETBUFINFO)
+ if (ioctl(self->x_fd, AUDIO_GEBUFTINFO, &ai) < 0) {
+#else
if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) {
+#endif
PyErr_SetFromErrno(SunAudioError);
return NULL;
}
@@ -236,7 +240,11 @@ sad_obufcount(sadobject *self)
{
audio_info_t ai;
+#if defined(__NetBSD__) && defined(AUDIO_GETBUFINFO)
+ if (ioctl(self->x_fd, AUDIO_GETBUFINFO, &ai) < 0) {
+#else
if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) {
+#endif
PyErr_SetFromErrno(SunAudioError);
return NULL;
}
@@ -275,7 +283,11 @@ sad_getdev(sadobject *self)
static PyObject *
sad_flush(sadobject *self)
{
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+ if (ioctl(self->x_fd, AUDIO_FLUSH, NULL) < 0) {
+#else
if (ioctl(self->x_fd, I_FLUSH, FLUSHW) < 0) {
+#endif
PyErr_SetFromErrno(SunAudioError);
return NULL;
}

View File

@@ -0,0 +1,74 @@
$NetBSD: patch-ah,v 1.2 2013/04/12 09:03:41 adam Exp $
--- Modules/_cursesmodule.c.orig 2013-04-06 14:02:36.000000000 +0000
+++ Modules/_cursesmodule.c
@@ -322,17 +322,9 @@ Window_NoArg2TupleReturnFunction(getpary
Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)")
-#if defined(__NetBSD__)
-Window_OneArgNoReturnVoidFunction(keypad, int, "i;True(1) or False(0)")
-#else
Window_OneArgNoReturnFunction(keypad, int, "i;True(1) or False(0)")
-#endif
Window_OneArgNoReturnFunction(leaveok, int, "i;True(1) or False(0)")
-#if defined(__NetBSD__)
-Window_OneArgNoReturnVoidFunction(nodelay, int, "i;True(1) or False(0)")
-#else
Window_OneArgNoReturnFunction(nodelay, int, "i;True(1) or False(0)")
-#endif
Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines")
@@ -2110,7 +2102,6 @@ PyCurses_Is_Term_Resized(PyObject *self,
}
#endif /* HAVE_CURSES_IS_TERM_RESIZED */
-#if !defined(__NetBSD__)
static PyObject *
PyCurses_KeyName(PyObject *self, PyObject *args)
{
@@ -2129,7 +2120,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
return PyString_FromString((knp == NULL) ? "" : (char *)knp);
}
-#endif
static PyObject *
PyCurses_KillChar(PyObject *self)
@@ -2674,9 +2664,7 @@ static PyMethodDef PyCurses_methods[] =
#ifdef HAVE_CURSES_IS_TERM_RESIZED
{"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS},
#endif
-#if !defined(__NetBSD__)
{"keyname", (PyCFunction)PyCurses_KeyName, METH_VARARGS},
-#endif
{"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS},
{"longname", (PyCFunction)PyCurses_longname, METH_NOARGS},
{"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS},
@@ -2785,9 +2773,7 @@ init_curses(void)
SetDictInt("A_DIM", A_DIM);
SetDictInt("A_BOLD", A_BOLD);
SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
-#if !defined(__NetBSD__)
SetDictInt("A_INVIS", A_INVIS);
-#endif
SetDictInt("A_PROTECT", A_PROTECT);
SetDictInt("A_CHARTEXT", A_CHARTEXT);
SetDictInt("A_COLOR", A_COLOR);
@@ -2859,7 +2845,6 @@ init_curses(void)
int key;
char *key_n;
char *key_n2;
-#if !defined(__NetBSD__)
for (key=KEY_MIN;key < KEY_MAX; key++) {
key_n = (char *)keyname(key);
if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
@@ -2887,7 +2872,6 @@ init_curses(void)
if (key_n2 != key_n)
free(key_n2);
}
-#endif
SetDictInt("KEY_MIN", KEY_MIN);
SetDictInt("KEY_MAX", KEY_MAX);
}

View File

@@ -0,0 +1,108 @@
$NetBSD: patch-al,v 1.10 2013/04/12 09:03:41 adam Exp $
- recognize MirBSD, Interix
- remove special-case library version hack for FreeBSD
- honor pkgsrc LDFLAGS
- other stuff not previously commented (XXX)
--- configure.orig 2013-04-06 14:02:41.000000000 +0000
+++ configure
@@ -3243,7 +3243,7 @@ case $ac_sys_system/$ac_sys_release in
# Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
# In addition, Stefan Krah confirms that issue #1244610 exists through
# OpenBSD 4.6, but is fixed in 4.7.
- OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.[0123456])
+ OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.[0123456] | MirBSD/*)
define_xopen_source=no
# OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
# also defined. This can be overridden by defining _BSD_SOURCE
@@ -5342,15 +5342,10 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|Interix*|MirBSD*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- case $ac_sys_system in
- FreeBSD*)
- SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
- ;;
- esac
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
hp*|HP*)
@@ -8214,9 +8209,9 @@ then
LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
- BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
- LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ BLDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BUILDPYTHON)'
+ LDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ LDCXXSHARED="$LDCXXSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi ;;
Darwin/*)
# Use -undefined dynamic_lookup whenever possible (10.3 and later).
@@ -8240,15 +8235,15 @@ then
LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
- BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
- LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ BLDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BUILDPYTHON)'
+ LDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ LDCXXSHARED="$LDCXXSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi
fi
;;
Linux*|GNU*|QNX*)
LDSHARED='$(CC) -shared'
- LDCXXSHARED='$(CXX) -shared';;
+ LDCXXSHARED='$(CXX) -shared'" ${LDFLAGS}";;
BSD/OS*/4*)
LDSHARED="gcc -shared"
LDCXXSHARED="g++ -shared";;
@@ -8276,9 +8271,15 @@ then
;;
esac
fi;;
+ MirBSD*)
+ LDSHARED='$(CC) -shared $(CCSHARED)'
+ LDCXXSHARED='$(CXX) -shared $(CCSHARED)';;
NetBSD*|DragonFly*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
+ Interix*)
+ LDSHARED='$(CC) -shared'" ${LDFLAGS}"
+ LDCXXSHARED='$(CXX) -shared'" ${LDFLAGS}";; # XXX tv needs image-base hack
OpenUNIX*|UnixWare*)
if test "$GCC" = "yes" ; then
LDSHARED='$(CC) -shared'
@@ -8322,7 +8323,8 @@ then
fi;;
Linux*|GNU*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
+ FreeBSD*|NetBSD*|OpenBSD*|MirBSD*|DragonFly*) CCSHARED="-fPIC";;
+ Interix*) CCSHARED="";;
OpenUNIX*|UnixWare*)
if test "$GCC" = "yes"
then CCSHARED="-fPIC"
@@ -8374,11 +8376,12 @@ then
OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
+ FreeBSD*|NetBSD*|OpenBSD*|MirBSD*|DragonFly*)
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
then
LINKFORSHARED="-Wl,--export-dynamic"
fi;;
+ Interix*) LINKFORSHARED="-Wl,-E";;
SunOS/5*) case $CC in
*gcc*)
if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null

View File

@@ -0,0 +1,362 @@
$NetBSD: patch-am,v 1.10 2013/05/27 16:24:00 adam Exp $
Disabled modules for normal build:
bsddb
curses
curses_panel
elementtree
sqlite3
tkinter
gdbm
pyexpat
readline
{linux,oss,sun}audiodev
spwd
Those have separate packages where needed.
Only check the BUILDLINK_DIR for libraries etc, do not pick up random
headers and libraries from the system.
Build the 1.85 compat module all the time against the BDB version of choice.
cygwin 2.7.3-no-libm.patch
--- setup.py.orig 2013-04-06 14:02:41.000000000 +0000
+++ setup.py
@@ -33,7 +33,7 @@ host_platform = get_platform()
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"]
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
@@ -436,9 +436,15 @@ class PyBuildExt(build_ext):
os.unlink(tmpfile)
def detect_modules(self):
- # Ensure that /usr/local is always used
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ # Add the buildlink directories for pkgsrc
+ if os.environ.has_key('BUILDLINK_DIR'):
+ dir = os.environ['BUILDLINK_DIR']
+ libdir = dir + '/lib'
+ incdir = dir + '/include'
+ if libdir not in self.compiler.library_dirs:
+ self.compiler.library_dirs.insert(0, libdir)
+ if incdir not in self.compiler.include_dirs:
+ self.compiler.include_dirs.insert(0, incdir)
self.add_gcc_paths()
self.add_multiarch_paths()
@@ -548,7 +554,7 @@ class PyBuildExt(build_ext):
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if host_platform in ['darwin', 'beos']:
+ if host_platform in ['darwin', 'beos', 'cygwin']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -794,9 +800,7 @@ class PyBuildExt(build_ext):
if krb5_h:
ssl_incs += krb5_h
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
- ['/usr/local/ssl/lib',
- '/usr/contrib/ssl/lib/'
- ] )
+ [] )
if (ssl_incs is not None and
ssl_libs is not None):
@@ -915,175 +919,6 @@ class PyBuildExt(build_ext):
else:
raise ValueError("unknown major BerkeleyDB version", major)
- # construct a list of paths to look for the header file in on
- # top of the normal inc_dirs.
- db_inc_paths = [
- '/usr/include/db4',
- '/usr/local/include/db4',
- '/opt/sfw/include/db4',
- '/usr/include/db3',
- '/usr/local/include/db3',
- '/opt/sfw/include/db3',
- # Fink defaults (http://fink.sourceforge.net/)
- '/sw/include/db4',
- '/sw/include/db3',
- ]
- # 4.x minor number specific paths
- for x in gen_db_minor_ver_nums(4):
- db_inc_paths.append('/usr/include/db4%d' % x)
- db_inc_paths.append('/usr/include/db4.%d' % x)
- db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
- db_inc_paths.append('/usr/local/include/db4%d' % x)
- db_inc_paths.append('/pkg/db-4.%d/include' % x)
- db_inc_paths.append('/opt/db-4.%d/include' % x)
- # MacPorts default (http://www.macports.org/)
- db_inc_paths.append('/opt/local/include/db4%d' % x)
- # 3.x minor number specific paths
- for x in gen_db_minor_ver_nums(3):
- db_inc_paths.append('/usr/include/db3%d' % x)
- db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x)
- db_inc_paths.append('/usr/local/include/db3%d' % x)
- db_inc_paths.append('/pkg/db-3.%d/include' % x)
- db_inc_paths.append('/opt/db-3.%d/include' % x)
-
- if cross_compiling:
- db_inc_paths = []
-
- # Add some common subdirectories for Sleepycat DB to the list,
- # based on the standard include directories. This way DB3/4 gets
- # picked up when it is installed in a non-standard prefix and
- # the user has added that prefix into inc_dirs.
- std_variants = []
- for dn in inc_dirs:
- std_variants.append(os.path.join(dn, 'db3'))
- std_variants.append(os.path.join(dn, 'db4'))
- for x in gen_db_minor_ver_nums(4):
- std_variants.append(os.path.join(dn, "db4%d"%x))
- std_variants.append(os.path.join(dn, "db4.%d"%x))
- for x in gen_db_minor_ver_nums(3):
- std_variants.append(os.path.join(dn, "db3%d"%x))
- std_variants.append(os.path.join(dn, "db3.%d"%x))
-
- db_inc_paths = std_variants + db_inc_paths
- db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)]
-
- db_ver_inc_map = {}
-
- if host_platform == 'darwin':
- sysroot = macosx_sdk_root()
-
- class db_found(Exception): pass
- try:
- # See whether there is a Sleepycat header in the standard
- # search path.
- for d in inc_dirs + db_inc_paths:
- f = os.path.join(d, "db.h")
-
- if host_platform == 'darwin' and is_macosx_sdk_path(d):
- f = os.path.join(sysroot, d[1:], "db.h")
-
- if db_setup_debug: print "db: looking for db.h in", f
- if os.path.exists(f):
- f = open(f).read()
- m = re.search(r"#define\WDB_VERSION_MAJOR\W(\d+)", f)
- if m:
- db_major = int(m.group(1))
- m = re.search(r"#define\WDB_VERSION_MINOR\W(\d+)", f)
- db_minor = int(m.group(1))
- db_ver = (db_major, db_minor)
-
- # Avoid 4.6 prior to 4.6.21 due to a BerkeleyDB bug
- if db_ver == (4, 6):
- m = re.search(r"#define\WDB_VERSION_PATCH\W(\d+)", f)
- db_patch = int(m.group(1))
- if db_patch < 21:
- print "db.h:", db_ver, "patch", db_patch,
- print "being ignored (4.6.x must be >= 4.6.21)"
- continue
-
- if ( (db_ver not in db_ver_inc_map) and
- allow_db_ver(db_ver) ):
- # save the include directory with the db.h version
- # (first occurrence only)
- db_ver_inc_map[db_ver] = d
- if db_setup_debug:
- print "db.h: found", db_ver, "in", d
- else:
- # we already found a header for this library version
- if db_setup_debug: print "db.h: ignoring", d
- else:
- # ignore this header, it didn't contain a version number
- if db_setup_debug:
- print "db.h: no version number version in", d
-
- db_found_vers = db_ver_inc_map.keys()
- db_found_vers.sort()
-
- while db_found_vers:
- db_ver = db_found_vers.pop()
- db_incdir = db_ver_inc_map[db_ver]
-
- # check lib directories parallel to the location of the header
- db_dirs_to_check = [
- db_incdir.replace("include", 'lib64'),
- db_incdir.replace("include", 'lib'),
- ]
-
- if host_platform != 'darwin':
- db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check)
-
- else:
- # Same as other branch, but takes OSX SDK into account
- tmp = []
- for dn in db_dirs_to_check:
- if is_macosx_sdk_path(dn):
- if os.path.isdir(os.path.join(sysroot, dn[1:])):
- tmp.append(dn)
- else:
- if os.path.isdir(dn):
- tmp.append(dn)
- db_dirs_to_check = tmp
-
- # Look for a version specific db-X.Y before an ambiguous dbX
- # XXX should we -ever- look for a dbX name? Do any
- # systems really not name their library by version and
- # symlink to more general names?
- for dblib in (('db-%d.%d' % db_ver),
- ('db%d%d' % db_ver),
- ('db%d' % db_ver[0])):
- dblib_file = self.compiler.find_library_file(
- db_dirs_to_check + lib_dirs, dblib )
- if dblib_file:
- dblib_dir = [ os.path.abspath(os.path.dirname(dblib_file)) ]
- raise db_found
- else:
- if db_setup_debug: print "db lib: ", dblib, "not found"
-
- except db_found:
- if db_setup_debug:
- print "bsddb using BerkeleyDB lib:", db_ver, dblib
- print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
- db_incs = [db_incdir]
- dblibs = [dblib]
- # We add the runtime_library_dirs argument because the
- # BerkeleyDB lib we're linking against often isn't in the
- # system dynamic library search path. This is usually
- # correct and most trouble free, but may cause problems in
- # some unusual system configurations (e.g. the directory
- # is on an NFS server that goes away).
- exts.append(Extension('_bsddb', ['_bsddb.c'],
- depends = ['bsddb.h'],
- library_dirs=dblib_dir,
- runtime_library_dirs=dblib_dir,
- include_dirs=db_incs,
- libraries=dblibs))
- else:
- if db_setup_debug: print "db: no appropriate library found"
- db_incs = None
- dblibs = []
- dblib_dir = None
- missing.append('_bsddb')
-
# The sqlite interface
sqlite_setup_debug = False # verbose debug prints from this script?
@@ -1201,35 +1036,39 @@ class PyBuildExt(build_ext):
# we do not build this one. Otherwise this build will pick up
# the more recent berkeleydb's db.h file first in the include path
# when attempting to compile and it will fail.
- f = "/usr/include/db.h"
-
- if host_platform == 'darwin':
- if is_macosx_sdk_path(f):
- sysroot = macosx_sdk_root()
- f = os.path.join(sysroot, f[1:])
-
- if os.path.exists(f) and not db_incs:
- data = open(f).read()
- m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
- if m is not None:
- # bingo - old version used hash file format version 2
- ### XXX this should be fixed to not be platform-dependent
- ### but I don't have direct access to an osf1 platform and
- ### seemed to be muffing the search somehow
- libraries = host_platform == "osf1" and ['db'] or None
- if libraries is not None:
- exts.append(Extension('bsddb185', ['bsddbmodule.c'],
- libraries=libraries))
- else:
- exts.append(Extension('bsddb185', ['bsddbmodule.c']))
- else:
- missing.append('bsddb185')
+ libraries = os.getenv("PY_BDB_TYPE", "")
+ if libraries:
+ exts.append(Extension('bsddb185', ['bsddbmodule.c'],
+ libraries=['db']))
else:
- missing.append('bsddb185')
+ exts.append(Extension('bsddb185', ['bsddbmodule.c']))
dbm_order = ['gdbm']
# The standard Unix dbm module:
if host_platform not in ['cygwin']:
+ ## Top half based on find_file
+ def find_ndbm_h(dirs):
+ ret = None
+ if sys.platform == 'darwin':
+ sysroot = macosx_sdk_root()
+ for dir in dirs:
+ f = os.path.join(dir, 'ndbm.h')
+ if sys.platform == 'darwin' and is_macosx_sdk_path(dir):
+ f = os.path.join(sysroot, dir[1:], 'ndbm.h')
+ if not os.path.exists(f): continue
+
+ ret = 'True'
+ input = text_file.TextFile(f)
+ while 1:
+ line = input.readline()
+ if not line: break
+ if re.search('This file is part of GDBM', line):
+ ret = None
+ break
+ input.close()
+ break
+ return ret
+
config_args = [arg.strip("'")
for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
dbm_args = [arg for arg in config_args
@@ -1241,7 +1080,7 @@ class PyBuildExt(build_ext):
dbmext = None
for cand in dbm_order:
if cand == "ndbm":
- if find_file("ndbm.h", inc_dirs, []) is not None:
+ if find_ndbm_h(inc_dirs) is not None:
# Some systems have -lndbm, others have -lgdbm_compat,
# others don't have either
if self.compiler.find_library_file(lib_dirs,
@@ -1285,18 +1124,14 @@ class PyBuildExt(build_ext):
libraries = gdbm_libs)
break
elif cand == "bdb":
- if db_incs is not None:
- print "building dbm using bdb"
- dbmext = Extension('dbm', ['dbmmodule.c'],
- library_dirs=dblib_dir,
- runtime_library_dirs=dblib_dir,
- include_dirs=db_incs,
- define_macros=[
- ('HAVE_BERKDB_H', None),
- ('DB_DBM_HSEARCH', None),
- ],
- libraries=dblibs)
- break
+ print "building dbm using bdb"
+ dbmext = Extension('dbm', ['dbmmodule.c'],
+ define_macros=[
+ ('HAVE_BERKDB_H', None),
+ ('DB_DBM_HSEARCH', None),
+ ],
+ libraries=["db"])
+ break
if dbmext is not None:
exts.append(dbmext)
else:
@@ -2176,9 +2011,9 @@ def main():
ext_modules=[Extension('_struct', ['_struct.c'])],
# Scripts to install
- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
- 'Tools/scripts/2to3',
- 'Lib/smtpd.py']
+ scripts = ['Tools/scripts/pydoc2.7',
+ 'Tools/scripts/2to3-2.7',
+ 'Lib/smtpd2.7.py']
)
# --install-platlib

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-an,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $
--- Modules/makesetup.orig 2007-09-05 11:47:34.000000000 +0000
+++ Modules/makesetup
@@ -164,6 +164,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
-rpath) libs="$libs $arg"; skip=libs;;
--rpath) libs="$libs $arg"; skip=libs;;
-[A-Zl]*) libs="$libs $arg";;
+ -pthread) libs="$libs $arg";;
*.a) libs="$libs $arg";;
*.so) libs="$libs $arg";;
*.sl) libs="$libs $arg";;

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ao,v 1.4 2013/04/12 09:03:41 adam Exp $
--- Lib/distutils/util.py.orig 2013-04-06 14:02:26.000000000 +0000
+++ Lib/distutils/util.py
@@ -101,6 +101,8 @@ def get_platform ():
osname, release, machine = _osx_support.get_platform_osx(
distutils.sysconfig.get_config_vars(),
osname, release, machine)
+ elif osname[:9] == "dragonfly":
+ release = str.split(release, "-")[0]
return "%s-%s-%s" % (osname, release, machine)

View File

@@ -0,0 +1,27 @@
$NetBSD: patch-au,v 1.6 2013/04/12 09:03:41 adam Exp $
Fix for unpriviliged build.
http://hg.python.org/cpython/rev/a0f43f4481e0
--- Makefile.pre.in.orig 2013-04-06 14:02:34.000000000 +0000
+++ Makefile.pre.in
@@ -489,7 +489,7 @@ gdbhooks: $(BUILDPYTHON)-gdb.py
SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
- $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
+ cp $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
# minimal framework (not including the Lib directory and such) in the current
@@ -879,7 +879,8 @@ altbininstall: $(BUILDPYTHON)
(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
fi \
fi; \
- else true; \
+ elif test -f $(INSTSONAME); then \
+ $(INSTALL_SHARED) $(INSTSONAME) $(DESTDIR)$(LIBDIR); \
fi
# Install the versioned manual page

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-av,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $
Add a knob (enviroment variable) for disabling installation of egg metadata
in extensions until we have infrastructure in place for dealing w/ it.
--- Lib/distutils/command/install.py.orig 2010-05-05 19:09:31.000000000 +0000
+++ Lib/distutils/command/install.py
@@ -666,7 +666,8 @@ class install (Command):
('install_headers', has_headers),
('install_scripts', has_scripts),
('install_data', has_data),
- ('install_egg_info', lambda self:True),
]
+ if not os.environ.has_key('PKGSRC_PYTHON_NO_EGG'):
+ sub_commands += [('install_egg_info', lambda self:True),]
# class install

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-aw,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $
--- Modules/nismodule.c.orig 2010-08-19 09:09:04.000000000 +0000
+++ Modules/nismodule.c
@@ -89,7 +89,7 @@ nis_mapname (char *map, int *pfix)
return map;
}
-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
typedef int (*foreachfunc)(unsigned long, char *, int, char *, int, void *);
#else
typedef int (*foreachfunc)(int, char *, int, char *, int, char *);

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ax,v 1.4 2013/04/12 09:03:41 adam Exp $
chop "-RELEASE" or "-DEVELOPMENT" from release for DragonFly.
--- Lib/sysconfig.py.orig 2013-04-06 14:02:29.000000000 +0000
+++ Lib/sysconfig.py
@@ -559,6 +559,8 @@ def get_platform():
osname, release, machine = _osx_support.get_platform_osx(
get_config_vars(),
osname, release, machine)
+ elif osname[:9] == "dragonfly":
+ release = str.split(release, '-')[0]
return "%s-%s-%s" % (osname, release, machine)

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-az,v 1.3 2013/04/12 09:03:41 adam Exp $
--- Modules/selectmodule.c.orig Mon Jul 25 08:09:14 2011
+++ Modules/selectmodule.c
@@ -1856,7 +1856,9 @@ initselect(void)
PyModule_AddIntConstant(m, "KQ_FILTER_NETDEV", EVFILT_NETDEV);
#endif
PyModule_AddIntConstant(m, "KQ_FILTER_SIGNAL", EVFILT_SIGNAL);
+#ifdef EVFILT_TIMER
PyModule_AddIntConstant(m, "KQ_FILTER_TIMER", EVFILT_TIMER);
+#endif
/* event flags */
PyModule_AddIntConstant(m, "KQ_EV_ADD", EV_ADD);

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-pyconfig.h.in,v 1.2 2013/04/12 09:03:41 adam Exp $
--- pyconfig.h.in.orig 2011-06-11 17:46:28.000000000 +0200
+++ pyconfig.h.in 2011-11-29 20:17:04.328552361 +0100
@@ -1191,7 +1191,9 @@
#undef _UINT64_T
/* Define to the level of X/Open that your system supports */
+#if !defined(__sun) || (defined(__sun) && !defined(_XOPEN_SOURCE))
#undef _XOPEN_SOURCE
+#endif
/* Define to activate Unix95-and-earlier features */
#undef _XOPEN_SOURCE_EXTENDED

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-xa,v 1.1 2012/08/14 18:19:02 drochner Exp $
--- Python/thread_pthread.h.orig 2012-03-30 13:06:51.000000000 +0000
+++ Python/thread_pthread.h
@@ -34,6 +34,9 @@
we need to add 0 to make it work there as well. */
#if (_POSIX_SEMAPHORES+0) == -1
#define HAVE_BROKEN_POSIX_SEMAPHORES
+#elif defined(__NetBSD__)
+/* XXX accesses to closed file descriptors, needs debugging */
+#define HAVE_BROKEN_POSIX_SEMAPHORES
#else
#include <semaphore.h>
#include <errno.h>