add sqlite3 support by default. closes #23

This commit is contained in:
Mathieu Virbel 2012-10-28 02:59:17 +02:00
parent 128b3ed816
commit e477068654
4 changed files with 36 additions and 2 deletions

View file

@ -41,3 +41,6 @@ unicodedata unicodedata.c # static Unicode character database
_json _json.c _json _json.c
_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c _io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c
_heapq _heapqmodule.c _heapq _heapqmodule.c
# Special inclusion for sqlite3
_sqlite3 -DSQLITE_OMIT_LOAD_EXTENSION _sqlite/cache.c _sqlite/microprotocols.c _sqlite/row.c _sqlite/connection.c _sqlite/module.c _sqlite/statement.c _sqlite/cursor.c _sqlite/prepare_protocol.c _sqlite/util.c

View file

@ -0,0 +1,25 @@
--- Python-2.7.1/Modules/_sqlite/module.c.orig 2012-10-28 02:30:58.000000000 +0200
+++ Python-2.7.1/Modules/_sqlite/module.c 2012-10-28 02:28:12.000000000 +0200
@@ -28,6 +28,9 @@
#include "prepare_protocol.h"
#include "microprotocols.h"
#include "row.h"
+#ifndef MODULE_NAME
+#define MODULE_NAME "_sqlite3"
+#endif
#if SQLITE_VERSION_NUMBER >= 3003003
#define HAVE_SHARED_CACHE
--- Python-2.7.1/Modules/_sqlite/sqlitecompat.h.orig 2012-10-28 02:30:53.000000000 +0200
+++ Python-2.7.1/Modules/_sqlite/sqlitecompat.h 2012-10-28 02:28:14.000000000 +0200
@@ -26,6 +26,10 @@
#ifndef PYSQLITE_COMPAT_H
#define PYSQLITE_COMPAT_H
+#ifndef MODULE_NAME
+#define MODULE_NAME "_sqlite3"
+#endif
+
/* define Py_ssize_t for pre-2.5 versions of Python */
#if PY_VERSION_HEX < 0x02050000

View file

@ -20,6 +20,7 @@ try pushd $TMPROOT/Python-$PYTHON_VERSION
# Patch Python for temporary reduce PY_SSIZE_T_MAX otherzise, splitting string doesnet work # Patch Python for temporary reduce PY_SSIZE_T_MAX otherzise, splitting string doesnet work
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-ssize-t-max.patch try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-ssize-t-max.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-dynload.patch try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-dynload.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-static-_sqlite3.patch
# Copy our setup for modules # Copy our setup for modules
try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local
@ -27,7 +28,7 @@ try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local
echo "Building for native machine ============================================" echo "Building for native machine ============================================"
try ./configure CC="$CCACHE clang -Qunused-arguments -fcolor-diagnostics" try ./configure CC="$CCACHE clang -Qunused-arguments -fcolor-diagnostics" LDFLAGS="-lsqlite3"
try make python.exe Parser/pgen try make python.exe Parser/pgen
try mv python.exe hostpython try mv python.exe hostpython
try mv Parser/pgen Parser/hostpgen try mv Parser/pgen Parser/hostpgen
@ -52,7 +53,8 @@ ln -s "$SDKROOT/usr/lib/libgcc_s.1.dylib" extralibs/libgcc_s.10.4.dylib || echo
try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local
try ./configure CC="$ARM_CC" LD="$ARM_LD" \ try ./configure CC="$ARM_CC" LD="$ARM_LD" \
CFLAGS="$ARM_CFLAGS" LDFLAGS="$ARM_LDFLAGS -Lextralibs/" \ CFLAGS="$ARM_CFLAGS" \
LDFLAGS="$ARM_LDFLAGS -Lextralibs/ -lsqlite3" \
--disable-toolbox-glue \ --disable-toolbox-glue \
--host=armv7-apple-darwin \ --host=armv7-apple-darwin \
--prefix=/python \ --prefix=/python \

View file

@ -26,6 +26,7 @@
59994DAF148E558600863906 /* libpython2.7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAA148E558600863906 /* libpython2.7.a */; }; 59994DAF148E558600863906 /* libpython2.7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAA148E558600863906 /* libpython2.7.a */; };
59994DB0148E558600863906 /* libSDL_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAB148E558600863906 /* libSDL_ttf.a */; }; 59994DB0148E558600863906 /* libSDL_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAB148E558600863906 /* libSDL_ttf.a */; };
59994DB1148E558600863906 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAC148E558600863906 /* libSDL2.a */; }; 59994DB1148E558600863906 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAC148E558600863906 /* libSDL2.a */; };
5983EC97163CB90D00475EFB /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5983EC96163CB90D00475EFB /* libsqlite3.dylib */; };
59994DB3148E564400863906 /* lib in Resources */ = {isa = PBXBuildFile; fileRef = 59994DB2148E564400863906 /* lib */; }; 59994DB3148E564400863906 /* lib in Resources */ = {isa = PBXBuildFile; fileRef = 59994DB2148E564400863906 /* lib */; };
596C7514150CFC75003F57D9 /* include in Resources */ = {isa = PBXBuildFile; fileRef = 596C7513150CFC75003F57D9 /* include */; }; 596C7514150CFC75003F57D9 /* include in Resources */ = {isa = PBXBuildFile; fileRef = 596C7513150CFC75003F57D9 /* include */; };
59994E3B148E85C800863906 /* YourApp in Resources */ = {isa = PBXBuildFile; fileRef = 59994E3A148E85C800863906 /* YourApp */; }; 59994E3B148E85C800863906 /* YourApp in Resources */ = {isa = PBXBuildFile; fileRef = 59994E3A148E85C800863906 /* YourApp */; };
@ -43,6 +44,7 @@
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
5983EC96163CB90D00475EFB /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
598E034C14F80187000D1362 /* libSDL_mixer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL_mixer.a; path = ../build/lib/libSDL_mixer.a; sourceTree = "<group>"; }; 598E034C14F80187000D1362 /* libSDL_mixer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL_mixer.a; path = ../build/lib/libSDL_mixer.a; sourceTree = "<group>"; };
598E035314F80578000D1362 /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = ../build/lib/libogg.a; sourceTree = "<group>"; }; 598E035314F80578000D1362 /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = ../build/lib/libogg.a; sourceTree = "<group>"; };
598E035914F8177A000D1362 /* libvorbisidec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisidec.a; path = ../build/lib/libvorbisidec.a; sourceTree = "<group>"; }; 598E035914F8177A000D1362 /* libvorbisidec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisidec.a; path = ../build/lib/libvorbisidec.a; sourceTree = "<group>"; };
@ -67,6 +69,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5983EC97163CB90D00475EFB /* libsqlite3.dylib in Frameworks */,
59ED7D0B150E325100A92BEE /* MessageUI.framework in Frameworks */, 59ED7D0B150E325100A92BEE /* MessageUI.framework in Frameworks */,
59ED7D08150E0C4400A92BEE /* libios.a in Frameworks */, 59ED7D08150E0C4400A92BEE /* libios.a in Frameworks */,
598E035A14F8177A000D1362 /* libvorbisidec.a in Frameworks */, 598E035A14F8177A000D1362 /* libvorbisidec.a in Frameworks */,
@ -142,6 +145,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = { 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5983EC96163CB90D00475EFB /* libsqlite3.dylib */,
59994DA8148E558600863906 /* libfreetype.a */, 59994DA8148E558600863906 /* libfreetype.a */,
59994DA9148E558600863906 /* libkivy.a */, 59994DA9148E558600863906 /* libkivy.a */,
59994DAA148E558600863906 /* libpython2.7.a */, 59994DAA148E558600863906 /* libpython2.7.a */,