Files
haikuports/dev-lang/python/patches/python-3.2a3.patch

188 lines
7.4 KiB
Diff

diff -urN Python-3.2a3/Lib/plat-haiku/regen Python-3.2a3-haiku/Lib/plat-haiku/regen
--- Python-3.2a3/Lib/plat-haiku/regen 1969-12-31 16:00:00.000000000 -0800
+++ Python-3.2a3-haiku/Lib/plat-haiku/regen 2010-10-25 12:04:00.000000000 -0700
@@ -0,0 +1,3 @@
+#! /bin/sh
+set -v
+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /boot/develop/headers/posix/netinet/in.h
diff -urN Python-3.2a3/Modules/resource.c Python-3.2a3-haiku/Modules/resource.c
--- Python-3.2a3/Modules/resource.c 2010-05-09 08:52:27.038797312 -0700
+++ Python-3.2a3-haiku/Modules/resource.c 2010-10-26 09:40:31.530055168 -0700
@@ -86,6 +86,7 @@
PyFloat_FromDouble(doubletime(ru.ru_utime)));
PyStructSequence_SET_ITEM(result, 1,
PyFloat_FromDouble(doubletime(ru.ru_stime)));
+#ifndef __HAIKU__
PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(ru.ru_idrss));
@@ -100,7 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyLong_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyLong_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyLong_FromLong(ru.ru_nivcsw));
-
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
return NULL;
diff -urN Python-3.2a3/Modules/socketmodule.c Python-3.2a3-haiku/Modules/socketmodule.c
--- Python-3.2a3/Modules/socketmodule.c 2010-09-28 15:03:27.048234496 -0700
+++ Python-3.2a3-haiku/Modules/socketmodule.c 2010-10-26 09:42:24.675545088 -0700
@@ -4595,7 +4595,9 @@
PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM);
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
+#ifndef __HAIKU__
PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#endif
#if defined(SOCK_RDM)
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
#endif
diff -urN Python-3.2a3/Modules/socketmodule.h Python-3.2a3-haiku/Modules/socketmodule.h
--- Python-3.2a3/Modules/socketmodule.h 2010-08-28 13:42:55.046399488 -0700
+++ Python-3.2a3-haiku/Modules/socketmodule.h 2010-10-26 09:36:23.904658944 -0700
@@ -47,6 +47,10 @@
# undef AF_NETLINK
#endif
+#if defined (__HAIKU__)
+# undef HAVE_BLUETOOTH_BLUETOOTH_H
+#endif
+
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
diff -urN Python-3.2a3/Modules/spwdmodule.c Python-3.2a3-haiku/Modules/spwdmodule.c
--- Python-3.2a3/Modules/spwdmodule.c 2010-05-15 09:27:27.038535168 -0700
+++ Python-3.2a3-haiku/Modules/spwdmodule.c 2010-10-26 09:41:38.998506496 -0700
@@ -80,7 +80,9 @@
SETS(setIndex++, p->sp_namp);
SETS(setIndex++, p->sp_pwdp);
+#ifndef __HAIKU__
SETI(setIndex++, p->sp_lstchg);
+#endif
SETI(setIndex++, p->sp_min);
SETI(setIndex++, p->sp_max);
SETI(setIndex++, p->sp_warn);
diff -urN Python-3.2a3/Python/bltinmodule.c Python-3.2a3-haiku/Python/bltinmodule.c
--- Python-3.2a3/Python/bltinmodule.c 2010-09-27 14:08:38.054788096 -0700
+++ Python-3.2a3-haiku/Python/bltinmodule.c 2010-10-25 13:10:52.010747904 -0700
@@ -22,7 +22,7 @@
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
const char *Py_FileSystemDefaultEncoding = "mbcs";
int Py_HasFileSystemDefaultEncoding = 1;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__HAIKU__)
const char *Py_FileSystemDefaultEncoding = "utf-8";
int Py_HasFileSystemDefaultEncoding = 1;
#elif defined(HAVE_LANGINFO_H) && defined(CODESET)
diff -urN Python-3.2a3/configure.in Python-3.2a3-haiku/configure.in
--- Python-3.2a3/configure.in 2010-10-10 01:10:16.033554432 -0700
+++ Python-3.2a3-haiku/configure.in 2010-10-25 13:47:17.305135616 -0700
@@ -292,6 +292,7 @@
case $MACHDEP in
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
+ haiku*) MACHDEP="haiku";;
irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
@@ -733,7 +734,7 @@
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
@@ -818,6 +819,7 @@
if test -z "$LN" ; then
case $ac_sys_system in
CYGWIN*) LN="ln -s";;
+ Haiku*) LN="ln -s";;
*) LN=ln;;
esac
fi
@@ -1748,7 +1750,7 @@
fi
fi
;;
- Linux*|GNU*|QNX*)
+ Linux*|GNU*|QNX*|Haiku*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
BSD/OS*/4*)
@@ -1817,7 +1819,7 @@
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -1848,7 +1850,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
@@ -1959,6 +1961,8 @@
AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # For Haiku
+
AC_MSG_CHECKING(for --with-libs)
AC_ARG_WITH(libs,
AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]),
@@ -3215,7 +3219,7 @@
# check for --with-libm=...
AC_SUBST(LIBM)
case $ac_sys_system in
-Darwin) ;;
+Darwin|Haiku*) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -urN Python-3.2a3/setup.py Python-3.2a3-haiku/setup.py
--- Python-3.2a3/setup.py 2010-09-14 12:41:23.030670848 -0700
+++ Python-3.2a3-haiku/setup.py 2010-10-25 13:06:13.069992448 -0700
@@ -423,6 +423,10 @@
platform = self.get_platform()
srcdir = sysconfig.get_config_var('srcdir')
+ if platform == 'haiku1':
+ inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include']
+ lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/lib']
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if platform in ['osf1', 'unixware7', 'openunix8']:
lib_dirs += ['/usr/ccs/lib']
@@ -444,9 +448,9 @@
if item.startswith('-L'):
lib_dirs.append(item[2:])
- # Check for MacOS X, which doesn't need libm.a at all
+ # Check for MacOS X or Haiku, which don't need libm.a at all
math_libs = ['m']
- if platform == 'darwin':
+ if platform == 'darwin' or platform == 'haiku':
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -1100,7 +1104,7 @@
exts.append( Extension('resource', ['resource.c']) )
# Sun yellow pages. Some systems have the functions in libc.
- if (platform not in ['cygwin', 'qnx6'] and
+ if (platform not in ['cygwin', 'qnx6', 'haiku'] and
find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']