- Introduce Python 2.7.0

Original work by:	wen
This commit is contained in:
Li-Wen Hsu
2010-08-15 19:12:51 +00:00
parent 6dc96975e4
commit 61b31f74b4
15 changed files with 385 additions and 149 deletions

View File

@@ -1,12 +1,12 @@
--- configure.orig 2009-03-12 14:16:24.000000000 +0000
+++ configure 2009-03-12 14:17:16.000000000 +0000
@@ -5230,6 +5230,9 @@
--- configure.orig 2010-08-15 16:47:39.627297328 +0800
+++ configure 2010-08-15 16:50:31.353013856 +0800
@@ -5880,6 +5880,9 @@
CC="$ac_save_cc"
fi
+# XXX Explicitly disable system pthread libraries.
+ac_cv_pthread=no
+
{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5
echo "${ECHO_T}$ac_cv_pthread" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread" >&5
$as_echo "$ac_cv_pthread" >&6; }
fi

View File

@@ -1,18 +1,18 @@
--- setup.py.1 2009-03-12 04:07:36.000000000 +0000
+++ setup.py 2009-03-12 04:08:36.000000000 +0000
@@ -1265,13 +1265,21 @@
)
--- setup.py.bak 2010-08-15 14:57:00.347134100 +0800
+++ setup.py 2010-08-15 15:00:06.019643300 +0800
@@ -1402,10 +1402,22 @@
macros = dict()
libraries = []
- elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9'):
+ elif platform in ('freebsd4', 'freebsd5', 'freebsd6'):
# FreeBSD's P1003.1b semaphore support is very experimental
# and has many known problems. (as of June 2008)
- macros = dict( # FreeBSD
- macros = dict()
+ macros = dict( # FreeBSD 4-6
HAVE_SEM_OPEN=0,
HAVE_SEM_TIMEDWAIT=0,
HAVE_FD_TRANSFER=1,
+ HAVE_SEM_OPEN=0,
+ HAVE_SEM_TIMEDWAIT=0,
+ HAVE_FD_TRANSFER=1,
+ )
+ libraries = []
+
@@ -21,6 +21,7 @@
+ HAVE_SEM_OPEN=1,
+ HAVE_SEM_TIMEDWAIT=1,
+ HAVE_FD_TRANSFER=1,
)
+ )
libraries = []
elif platform.startswith('openbsd'):

View File

@@ -0,0 +1,11 @@
--- Doc/library/fcntl.rst.orig 2010-08-14 16:19:09.194215129 +0800
+++ Doc/library/fcntl.rst 2010-08-14 16:19:36.999453016 +0800
@@ -50,8 +50,6 @@
operations are typically defined in the library module :mod:`termios` and the
argument handling is even more complicated.
- The op parameter is limited to values that can fit in 32-bits.
-
The parameter *arg* can be one of an integer, absent (treated identically to the
integer ``0``), an object supporting the read-only buffer interface (most likely
a plain Python string) or an object supporting the read-write buffer interface.

View File

@@ -0,0 +1,11 @@
--- Lib/test/test_fcntl.py.orig 2010-08-14 16:56:31.290525837 +0800
+++ Lib/test/test_fcntl.py 2010-08-14 16:56:39.007508167 +0800
@@ -30,7 +30,7 @@
if sys.platform in ('netbsd1', 'netbsd2', 'netbsd3',
'Darwin1.2', 'darwin',
'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
- 'freebsd6', 'freebsd7', 'freebsd8',
+ 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9',
'bsdos2', 'bsdos3', 'bsdos4',
'openbsd', 'openbsd2', 'openbsd3', 'openbsd4'):
if struct.calcsize('l') == 8:

View File

@@ -0,0 +1,23 @@
--- Lib/test/test_ioctl.py.orig 2010-08-14 16:20:34.137255285 +0800
+++ Lib/test/test_ioctl.py 2010-08-14 16:36:01.013654144 +0800
@@ -41,18 +41,9 @@
raise unittest.SkipTest('pty module required')
mfd, sfd = pty.openpty()
try:
- if termios.TIOCSWINSZ < 0:
- set_winsz_opcode_maybe_neg = termios.TIOCSWINSZ
- set_winsz_opcode_pos = termios.TIOCSWINSZ & 0xffffffffL
- else:
- set_winsz_opcode_pos = termios.TIOCSWINSZ
- set_winsz_opcode_maybe_neg, = struct.unpack("i",
- struct.pack("I", termios.TIOCSWINSZ))
-
+ set_winsz_opcode = termios.TIOCSWINSZ
our_winsz = struct.pack("HHHH",80,25,0,0)
- # test both with a positive and potentially negative ioctl code
- new_winsz = fcntl.ioctl(mfd, set_winsz_opcode_pos, our_winsz)
- new_winsz = fcntl.ioctl(mfd, set_winsz_opcode_maybe_neg, our_winsz)
+ new_winsz = fcntl.ioctl(mfd, set_winsz_opcode, our_winsz)
finally:
os.close(mfd)
os.close(sfd)

View File

@@ -0,0 +1,11 @@
--- Lib/test/test_socket.py.orig 2010-08-14 16:51:08.542899328 +0800
+++ Lib/test/test_socket.py 2010-08-14 16:53:25.902184941 +0800
@@ -334,7 +334,7 @@
# I've ordered this by protocols that have both a tcp and udp
# protocol, at least for modern Linuxes.
if sys.platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
- 'freebsd7', 'freebsd8', 'darwin'):
+ 'freebsd7', 'freebsd8', 'freebsd9', 'darwin'):
# avoid the 'echo' service on this platform, as there is an
# assumption breaking non-standard port/protocol entry
services = ('daytime', 'qotd', 'domain')

View File

@@ -1,11 +1,11 @@
--- Modules/_ctypes/libffi/configure.orig 2008-05-24 00:06:50.000000000 +0900
+++ Modules/_ctypes/libffi/configure 2008-10-09 20:24:02.000000000 +0900
@@ -4725,7 +4725,7 @@
--- Modules/_ctypes/libffi/configure.orig 2010-03-20 02:59:20.000000000 +0800
+++ Modules/_ctypes/libffi/configure 2010-06-04 10:04:38.000000000 +0800
@@ -6289,7 +6289,7 @@
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+amd64-*-freebsd*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|sparc*-*linux*)
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext

View File

@@ -0,0 +1,53 @@
--- Modules/fcntlmodule.c.orig 2010-08-14 16:36:54.991363730 +0800
+++ Modules/fcntlmodule.c 2010-08-14 16:41:05.555822031 +0800
@@ -97,20 +97,15 @@
{
#define IOCTL_BUFSZ 1024
int fd;
- /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I'
+ /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k'
format for the 'code' parameter because Python turns 0x8000000
into either a large positive number (PyLong or PyInt on 64-bit
platforms) or a negative number on others (32-bit PyInt)
whereas the system expects it to be a 32bit bit field value
regardless of it being passed as an int or unsigned long on
- various platforms. See the termios.TIOCSWINSZ constant across
- platforms for an example of thise.
-
- If any of the 64bit platforms ever decide to use more than 32bits
- in their unsigned long ioctl codes this will break and need
- special casing based on the platform being built on.
+ various platforms.
*/
- unsigned int code;
+ unsigned long code;
int arg;
int ret;
char *str;
@@ -118,7 +113,7 @@
int mutate_arg = 1;
char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */
- if (PyArg_ParseTuple(args, "O&Iw#|i:ioctl",
+ if (PyArg_ParseTuple(args, "O&kw#|i:ioctl",
conv_descriptor, &fd, &code,
&str, &len, &mutate_arg)) {
char *arg;
@@ -169,7 +164,7 @@
}
PyErr_Clear();
- if (PyArg_ParseTuple(args, "O&Is#:ioctl",
+ if (PyArg_ParseTuple(args, "O&ks#:ioctl",
conv_descriptor, &fd, &code, &str, &len)) {
if (len > IOCTL_BUFSZ) {
PyErr_SetString(PyExc_ValueError,
@@ -191,7 +186,7 @@
PyErr_Clear();
arg = 0;
if (!PyArg_ParseTuple(args,
- "O&I|i;ioctl requires a file or file descriptor,"
+ "O&k|i;ioctl requires a file or file descriptor,"
" an integer and optionally an integer or buffer argument",
conv_descriptor, &fd, &code, &arg)) {
return NULL;

View File

@@ -1,5 +1,5 @@
--- Python/thread_pthread.h.orig 2006-06-13 16:04:24.000000000 +0100
+++ Python/thread_pthread.h 2009-03-12 10:55:49.000000000 +0000
--- Python/thread_pthread.h.orig 2010-05-09 22:46:46.000000000 +0800
+++ Python/thread_pthread.h 2010-08-15 14:27:51.886823397 +0800
@@ -26,13 +26,18 @@
#endif
#endif
@@ -10,9 +10,9 @@
+
/* The POSIX spec says that implementations supporting the sem_*
family of functions must indicate this by defining
_POSIX_SEMAPHORES. */
_POSIX_SEMAPHORES. */
#ifdef _POSIX_SEMAPHORES
/* On FreeBSD 4.x, _POSIX_SEMAPHORES is defined empty, so
/* On FreeBSD 4.x, _POSIX_SEMAPHORES is defined empty, so
we need to add 0 to make it work there as well. */
-#if (_POSIX_SEMAPHORES+0) == -1
+#if defined(__FreeBSD__) && __FreeBSD_version < 701104 && \
@@ -30,26 +30,26 @@
#endif
@@ -149,6 +153,7 @@
{
pthread_t th;
int status;
+ sigset_t set, oset;
pthread_t th;
int status;
+ sigset_t set, oset;
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_t attrs;
pthread_attr_t attrs;
#endif
@@ -177,6 +182,8 @@
#if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
#endif
+ sigfillset(&set);
+ SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset);
+ sigfillset(&set);
+ SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset);
status = pthread_create(&th,
status = pthread_create(&th,
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
@@ -188,6 +195,7 @@
(void *)arg
);
(void *)arg
);
+ SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL);
+ SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL);
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_destroy(&attrs);
pthread_attr_destroy(&attrs);
#endif

View File

@@ -1,7 +1,7 @@
--- setup.py.orig 2009-03-31 18:20:48.000000000 +0000
+++ setup.py 2009-09-10 05:27:01.000000000 +0000
@@ -17,7 +17,7 @@ from distutils.command.install import in
from distutils.command.install_lib import install_lib
--- setup.py.orig 2010-06-07 09:55:38.000000000 +0800
+++ setup.py 2010-06-07 10:03:30.000000000 +0800
@@ -21,7 +21,7 @@
COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
@@ -9,17 +9,17 @@
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
@@ -577,7 +577,7 @@ class PyBuildExt(build_ext):
readline_libs = ['readline']
if self.compiler.find_library_file(lib_dirs,
- 'ncursesw'):
+ 'xxxncursesw'):
readline_libs.append('ncursesw')
elif self.compiler.find_library_file(lib_dirs,
'ncurses'):
@@ -589,7 +589,7 @@ class PyBuildExt(build_ext):
'termcap'):
@@ -608,7 +608,7 @@
# use the same library for the readline and curses modules.
if 'curses' in readline_termcap_library:
curses_library = readline_termcap_library
- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+ elif self.compiler.find_library_file(lib_dirs, 'xxxncursesw'):
curses_library = 'ncursesw'
elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
curses_library = 'ncurses'
@@ -647,7 +647,7 @@
'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
- library_dirs=['/usr/lib/termcap'],
@@ -27,7 +27,7 @@
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
@@ -689,6 +689,8 @@ class PyBuildExt(build_ext):
@@ -749,6 +749,8 @@
# OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
exts.append( Extension('_sha256', ['sha256module.c']) )
exts.append( Extension('_sha512', ['sha512module.c']) )
@@ -36,59 +36,59 @@
# Modules that provide persistent dictionary-like semantics. You will
# probably want to arrange for at least one of them to be available on
@@ -990,7 +992,7 @@ class PyBuildExt(build_ext):
# 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"
@@ -1085,7 +1087,7 @@
sysroot = macosx_sdk_root()
f = os.path.join(sysroot, f[1:])
- if os.path.exists(f) and not db_incs:
+ if os.path.exists(f):
data = open(f).read()
m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
if m is not None:
@@ -1080,7 +1082,7 @@ class PyBuildExt(build_ext):
@@ -1210,13 +1212,14 @@
# Curses support, requiring the System V version of curses, often
# provided by the ncurses library.
panel_library = 'panel'
- if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
+ if (self.compiler.find_library_file(lib_dirs, 'xxxncursesw')):
curses_libs = ['ncursesw']
# Bug 1464056: If _curses.so links with ncursesw,
# _curses_panel.so must link with panelw.
@@ -1090,6 +1092,7 @@ class PyBuildExt(build_ext):
elif (self.compiler.find_library_file(lib_dirs, 'ncurses')):
curses_libs = ['ncurses']
- if curses_library.startswith('ncurses'):
- if curses_library == 'ncursesw':
+ if curses_library.startswith('xxxncurses'):
+ if curses_library == 'xxxncursesw':
# Bug 1464056: If _curses.so links with ncursesw,
# _curses_panel.so must link with panelw.
panel_library = 'panelw'
curses_libs = [curses_library]
exts.append( Extension('_curses', ['_cursesmodule.c'],
+ library_dirs = ['/usr/lib'],
libraries = curses_libs) )
elif (self.compiler.find_library_file(lib_dirs, 'curses')
and platform != 'darwin'):
@@ -1111,6 +1114,7 @@ class PyBuildExt(build_ext):
if (module_enabled(exts, '_curses') and
self.compiler.find_library_file(lib_dirs, panel_library)):
exts.append( Extension('_curses_panel', ['_curses_panel.c'],
elif curses_library == 'curses' and platform != 'darwin':
# OSX has an old Berkeley curses, not good enough for
@@ -1229,6 +1232,7 @@
curses_libs = ['curses']
exts.append( Extension('_curses', ['_cursesmodule.c'],
+ library_dirs = ['/usr/lib'],
libraries = [panel_library] + curses_libs) )
libraries = curses_libs) )
else:
missing.append('_curses_panel')
@@ -1273,7 +1277,7 @@ class PyBuildExt(build_ext):
)
missing.append('_curses')
@@ -1397,7 +1401,7 @@
macros = dict()
libraries = []
- elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
+ elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9'):
# FreeBSD's P1003.1b semaphore support is very experimental
# and has many known problems. (as of June 2008)
macros = dict( # FreeBSD
@@ -1338,7 +1342,7 @@ class PyBuildExt(build_ext):
macros = dict()
@@ -1449,7 +1453,7 @@
missing.append('linuxaudiodev')
if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
- 'freebsd7', 'freebsd8'):
+ 'freebsd7', 'freebsd8', 'freebsd9'):
if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
- 'freebsd7', 'freebsd8')
+ 'freebsd7', 'freebsd8', 'freebsd9')
or platform.startswith("gnukfreebsd")):
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
else:
missing.append('ossaudiodev')
@@ -1891,9 +1895,7 @@ def main():
@@ -2031,9 +2035,7 @@
ext_modules=[Extension('_struct', ['_struct.c'])],
# Scripts to install