Files
haikuports/dev-lang/python/patches/python-2.5.4.patch
Michael Weirauch 5f0cddc71a * self hosting build patch (mostly based on the present patches)
* some AC* calls for libffi had to be commented (somebody with more
  experience in this regard should have a look)
* regrtest.py not adjusted as it crashes on test_resource
  (before that is not fixed there's no use adding tests to skip)
2010-06-07 17:49:18 +00:00

204 lines
7.3 KiB
Diff

diff -X excludes-for-diff -Naur ./Python-2.5.4.orig/Modules/_ctypes/libffi/configure.ac ./Python-2.5.4/Modules/_ctypes/libffi/configure.ac
--- ./Python-2.5.4.orig/Modules/_ctypes/libffi/configure.ac 2007-09-05 01:47:16.942407680 +0200
+++ ./Python-2.5.4/Modules/_ctypes/libffi/configure.ac 2010-06-07 16:42:39.216006656 +0200
@@ -8,16 +8,16 @@
AC_CANONICAL_SYSTEM
target_alias=${target_alias-$host_alias}
-m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+#m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
m4_define([_AC_ARG_VAR_PRECIOUS],[])
AC_PROG_CC
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+#m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
AC_SUBST(CFLAGS)
AC_CHECK_HEADERS(sys/mman.h)
AC_CHECK_FUNCS(mmap)
-AC_FUNC_MMAP_BLACKLIST
+#AC_FUNC_MMAP_BLACKLIST
TARGETDIR="unknown"
case "$host" in
@@ -34,6 +34,7 @@
i*86-*-solaris2.1[[0-9]]*) TARGET=X86_64; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
+i*86-*-haiku*) TARGET=X86; TARGETDIR=x86;;
i*86-*-freebsd* | i*86-*-kfreebsd*-gnu) TARGET=X86; TARGETDIR=x86;;
i*86-*-netbsdelf* | i*86-*-knetbsd*-gnu) TARGET=X86; TARGETDIR=x86;;
i*86-*-openbsd*) TARGET=X86; TARGETDIR=x86;;
diff -X excludes-for-diff -Naur ./Python-2.5.4.orig/Modules/resource.c ./Python-2.5.4/Modules/resource.c
--- ./Python-2.5.4.orig/Modules/resource.c 2006-05-29 23:04:52.942407680 +0200
+++ ./Python-2.5.4/Modules/resource.c 2010-06-03 18:12:58.990380032 +0200
@@ -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, PyInt_FromLong(ru.ru_maxrss));
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
@@ -100,6 +101,7 @@
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
diff -X excludes-for-diff -Naur ./Python-2.5.4.orig/Modules/socketmodule.h ./Python-2.5.4/Modules/socketmodule.h
--- ./Python-2.5.4.orig/Modules/socketmodule.h 2006-12-03 12:24:00.942407680 +0100
+++ ./Python-2.5.4/Modules/socketmodule.h 2010-06-03 18:12:58.991952896 +0200
@@ -41,6 +41,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 -X excludes-for-diff -Naur ./Python-2.5.4.orig/Modules/spwdmodule.c ./Python-2.5.4/Modules/spwdmodule.c
--- ./Python-2.5.4.orig/Modules/spwdmodule.c 2006-08-02 08:15:10.942407680 +0200
+++ ./Python-2.5.4/Modules/spwdmodule.c 2010-06-03 18:12:58.994312192 +0200
@@ -79,7 +79,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 -X excludes-for-diff -Naur ./Python-2.5.4.orig/Modules/timemodule.c ./Python-2.5.4/Modules/timemodule.c
--- ./Python-2.5.4.orig/Modules/timemodule.c 2007-12-24 21:00:42.942407680 +0100
+++ ./Python-2.5.4/Modules/timemodule.c 2010-06-03 18:12:59.021757952 +0200
@@ -968,11 +968,11 @@
return -1;
}
Py_END_ALLOW_THREADS
-#elif defined(__BEOS__)
+#elif defined(__BEOS__) || defined(__HAIKU__)
/* This sleep *CAN BE* interrupted. */
{
if( secs <= 0.0 ) {
- return;
+ return 0;
}
Py_BEGIN_ALLOW_THREADS
diff -X excludes-for-diff -Naur ./Python-2.5.4.orig/Tools/scripts/h2py.py ./Python-2.5.4/Tools/scripts/h2py.py
--- ./Python-2.5.4.orig/Tools/scripts/h2py.py 2004-08-09 19:27:55.942407680 +0200
+++ ./Python-2.5.4/Tools/scripts/h2py.py 2010-06-06 11:00:49.436731904 +0200
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
@@ -50,7 +50,7 @@
searchdirs=os.environ['INCLUDE'].split(';')
except KeyError:
try:
- if sys.platform.find("beos") == 0:
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
searchdirs=os.environ['BEINCLUDES'].split(';')
elif sys.platform.startswith("atheos"):
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
diff -X excludes-for-diff -Naur ./Python-2.5.4.orig/configure.in ./Python-2.5.4/configure.in
--- ./Python-2.5.4.orig/configure.in 2008-12-13 15:13:52.942407680 +0100
+++ ./Python-2.5.4/configure.in 2010-06-07 16:53:42.874250240 +0200
@@ -7,6 +7,7 @@
AC_PREREQ(2.59)
AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
AC_CONFIG_SRCDIR([Include/object.h])
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER(pyconfig.h)
dnl This is for stuff that absolutely must end up in pyconfig.h.
@@ -627,6 +628,11 @@
BeOS*)
LDLIBRARY='libpython$(VERSION).so'
;;
+ Haiku*)
+ LDLIBRARY='libpython$(VERSION).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LIBRARY_PATH=`pwd`:${LIBRARY_PATH}
+ ;;
CYGWIN*)
LDLIBRARY='libpython$(VERSION).dll.a'
DLLLIBRARY='libpython$(VERSION).dll'
@@ -709,7 +715,7 @@
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
- BeOS*) LN="ln -s";;
+ BeOS*|Haiku*) LN="ln -s";;
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -1445,6 +1451,10 @@
BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
;;
+ Haiku*)
+ LDFLAGS="-L." # help ld find libpythonX.Y.so in root directory
+ LDSHARED="gcc -shared"
+ ;;
IRIX/5*) LDSHARED="ld -shared";;
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
SunOS/5*)
@@ -1585,6 +1595,7 @@
*) CCSHARED="";;
esac;;
atheos*) CCSHARED="-fPIC";;
+ Haiku*) CCSHARED="-fPIC";;
esac
fi
AC_MSG_RESULT($CCSHARED)
@@ -1710,6 +1721,9 @@
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
+Haiku*)
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
+;;
esac
AC_MSG_CHECKING(for --with-libs)
@@ -2879,7 +2893,7 @@
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
-BeOS) ;;
+BeOS|Haiku) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff -X excludes-for-diff -Naur ./Python-2.5.4.orig/setup.py ./Python-2.5.4/setup.py
--- ./Python-2.5.4.orig/setup.py 2008-10-16 20:58:19.942407680 +0200
+++ ./Python-2.5.4/setup.py 2010-06-03 18:12:59.056885248 +0200
@@ -338,7 +338,7 @@
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
- if platform in ['darwin', 'beos', 'mac']:
+ if platform in ['darwin', 'beos', 'haiku1', 'mac']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -912,7 +912,7 @@
exts.append( Extension('resource', ['resource.c']) )
# Sun yellow pages. Some systems have the functions in libc.
- if platform not in ['cygwin', 'atheos']:
+ if platform not in ['cygwin', 'atheos', 'haiku1']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else: