python: add patches from archlinux for internal modules.

Add missing db dependency, bump revision.

--HG--
extra : convert_revision : 6366bfde6a37f01d401fb393e98b47aae95ef878
This commit is contained in:
Juan RP 2009-10-16 16:53:38 +02:00
parent 7f9e6dfaa6
commit 1b55b53729
5 changed files with 197 additions and 1 deletions

View File

@ -0,0 +1,123 @@
Index: setup.py
===================================================================
--- setup.py (revision 74955)
+++ setup.py (working copy)
@@ -695,7 +695,7 @@
# a release. Most open source OSes come with one or more
# versions of BerkeleyDB already installed.
- max_db_ver = (4, 7)
+ max_db_ver = (4, 8)
min_db_ver = (3, 3)
db_setup_debug = False # verbose debug prints from this script?
Index: Modules/_bsddb.c
===================================================================
--- Modules/_bsddb.c (revision 74955)
+++ Modules/_bsddb.c (working copy)
@@ -215,7 +215,11 @@
#define DB_BUFFER_SMALL ENOMEM
#endif
+#if (DBVER < 48)
+#define DB_GID_SIZE DB_XIDDATASIZE
+#endif
+
/* --------------------------------------------------------------------- */
/* Structure definitions */
@@ -4501,7 +4505,11 @@
DBTxnObject *txn;
#define PREPLIST_LEN 16
DB_PREPLIST preplist[PREPLIST_LEN];
+#if (DBVER < 48)
long retp;
+#else
+ u_int32_t retp;
+#endif
CHECK_ENV_NOT_CLOSED(self);
@@ -4522,7 +4530,7 @@
flags=DB_NEXT; /* Prepare for next loop pass */
for (i=0; i<retp; i++) {
gid=PyBytes_FromStringAndSize((char *)(preplist[i].gid),
- DB_XIDDATASIZE);
+ DB_GID_SIZE);
if (!gid) {
Py_DECREF(list);
return NULL;
@@ -5047,6 +5055,7 @@
}
+#if (DBVER < 48)
static PyObject*
DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
{
@@ -5068,6 +5077,7 @@
RETURN_IF_ERR();
RETURN_NONE();
}
+#endif
static PyObject*
DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
@@ -5947,9 +5957,9 @@
if (!PyArg_ParseTuple(args, "s#:prepare", &gid, &gid_size))
return NULL;
- if (gid_size != DB_XIDDATASIZE) {
+ if (gid_size != DB_GID_SIZE) {
PyErr_SetString(PyExc_TypeError,
- "gid must be DB_XIDDATASIZE bytes long");
+ "gid must be DB_GID_SIZE bytes long");
return NULL;
}
@@ -6539,8 +6549,10 @@
#endif
{"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none, METH_VARARGS},
{"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
+#if (DBVER < 48)
{"set_rpc_server", (PyCFunction)DBEnv_set_rpc_server,
METH_VARARGS||METH_KEYWORDS},
+#endif
{"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
#if (DBVER >= 42)
{"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
@@ -7089,6 +7101,7 @@
ADD_INT(d, DB_MAX_PAGES);
ADD_INT(d, DB_MAX_RECORDS);
+#if (DBVER < 48)
#if (DBVER >= 42)
ADD_INT(d, DB_RPCCLIENT);
#else
@@ -7096,7 +7109,11 @@
/* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
_addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
#endif
+#endif
+
+#if (DBVER < 48)
ADD_INT(d, DB_XA_CREATE);
+#endif
ADD_INT(d, DB_CREATE);
ADD_INT(d, DB_NOMMAP);
@@ -7113,7 +7130,13 @@
ADD_INT(d, DB_INIT_TXN);
ADD_INT(d, DB_JOINENV);
+#if (DBVER >= 48)
+ ADD_INT(d, DB_GID_SIZE);
+#else
ADD_INT(d, DB_XIDDATASIZE);
+ /* Allow new code to work in old BDB releases */
+ _addIntToDict(d, "DB_GID_SIZE", DB_XIDDATASIZE);
+#endif
ADD_INT(d, DB_RECOVER);
ADD_INT(d, DB_RECOVER_FATAL);

View File

@ -0,0 +1,11 @@
--- setup.py 2008-09-30 10:15:45.000000000 +1000
+++ setup.py 2008-12-07 16:04:01.000000000 +1000
@@ -1013,7 +1013,7 @@
if self.compiler.find_library_file(lib_dirs, 'ndbm'):
ndbm_libs = ['ndbm']
else:
- ndbm_libs = []
+ ndbm_libs = ['gdbm', 'gdbm_compat']
exts.append( Extension('dbm', ['dbmmodule.c'],
define_macros=[('HAVE_NDBM_H',None)],
libraries = ndbm_libs ) )

View File

@ -0,0 +1,33 @@
--- setup.py 2008-04-22 12:12:24.613554757 +0300
+++ setup.py 2008-04-22 12:13:09.276544063 +0300
@@ -1035,18 +1035,15 @@
#
# More information on Expat can be found at www.libexpat.org.
#
- expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
- define_macros = [
- ('HAVE_EXPAT_CONFIG_H', '1'),
- ]
+ # Use system expat
+ expatinc = '/usr/include'
+ define_macros = []
exts.append(Extension('pyexpat',
define_macros = define_macros,
include_dirs = [expatinc],
+ libraries = ['expat'],
sources = ['pyexpat.c',
- 'expat/xmlparse.c',
- 'expat/xmlrole.c',
- 'expat/xmltok.c',
],
))
@@ -1058,6 +1055,7 @@
exts.append(Extension('_elementtree',
define_macros = define_macros,
include_dirs = [expatinc],
+ libraries = ['expat'],
sources = ['_elementtree.c'],
))

View File

@ -0,0 +1,23 @@
--- Modules/readline.c 2008-11-04 12:43:31.000000000 -0800
+++ Modules/readline.c 2009-04-22 15:50:49.000000000 -0700
@@ -759,6 +759,10 @@
static char **
flex_complete(char *text, int start, int end)
{
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
+ rl_completion_append_character ='\0';
+ rl_completion_suppress_append = 0;
+#endif
Py_XDECREF(begidx);
Py_XDECREF(endidx);
begidx = PyInt_FromLong((long) start);
@@ -799,11 +803,8 @@
rl_completer_word_break_characters =
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
/* All nonalphanums except '.' */
-#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
- rl_completion_append_character ='\0';
-#endif
begidx = PyInt_FromLong(0L);
endidx = PyInt_FromLong(0L);

View File

@ -1,6 +1,7 @@
# Template build file for 'python'.
pkgname=python
version=2.6.3
revision=1
wrksrc="Python-$version"
distfiles="http://www.python.org/ftp/python/$version/Python-$version.tar.bz2"
configure_args="--with-threads --enable-ipv6 --with-signal-module"
@ -21,7 +22,6 @@ long_desc="
adaptable as an extension language for existing applications."
subpackages="devel"
Add_dependency full glibc
Add_dependency full zlib
Add_dependency full readline
@ -29,5 +29,11 @@ Add_dependency full bzip2
Add_dependency full gdbm
Add_dependency full openssl
Add_dependency full expat
Add_dependency full db
Add_dependency build ncurses
Add_dependency run ncurses-libs
pre_configure()
{
export OPT="${XBPS_CFLAGS} -fwrapv"
}