slackbuilds_ponce/system/tagainijisho/embed-sqlite.patch
David Spencer 554d24be0b system/tagainijisho: Fixed build with sqlite-3.12.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
2016-04-12 17:34:23 +07:00

50 lines
2.3 KiB
Diff

diff -u -r tagainijisho-1.0.1/src/sqlite/CMakeLists.txt tagainijisho-1.0.1-patched/src/sqlite/CMakeLists.txt
--- tagainijisho-1.0.1/src/sqlite/CMakeLists.txt 2013-11-18 23:32:01.000000000 +0000
+++ tagainijisho-1.0.1-patched/src/sqlite/CMakeLists.txt 2016-04-11 15:44:13.408359228 +0100
@@ -3,19 +3,15 @@
set(SQLITE_MIN_VERSION "3007004")
set(SQLITE_BLACKLIST "3007007;3007008;3008000")
-set(SQLITE_DOWNLOAD_VERSION "3080100")
+set(SQLITE_DOWNLOAD_VERSION "3110100")
-set(SQLITE_SOURCE http://www.sqlite.org/2013/sqlite-amalgamation-${SQLITE_DOWNLOAD_VERSION}.zip)
+set(SQLITE_SOURCE http://www.sqlite.org/2016/sqlite-amalgamation-${SQLITE_DOWNLOAD_VERSION}.zip)
option(SHARED_SQLITE_LIBRARY "Build the SQLite library as a shared library (loadable by SQLite's interpreter)" OFF)
# Embed SQLite even if the system version looks good?
-option(EMBED_SQLITE "Embed SQLite even if a system version is present and valid" OFF)
-
-# Force embedded version on Apple
-if (APPLE)
- set (EMBED_SQLITE "ON")
-endif(APPLE)
+# This should be enabled by default as we require features (e.g. FTS3 tokenizer) that may not be enabled on the system
+option(EMBED_SQLITE "Embed SQLite even if a system version is present and valid" ON)
# Look for system SQLite
find_path(SQLITE_INCLUDE_DIR sqlite3.h)
@@ -89,7 +85,7 @@
endif()
include_directories(${QT_INCLUDE_DIR})
-add_definitions(-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_OMIT_DEPRECATED)
+add_definitions(-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_FTS3_TOKENIZER)
if(SHARED_SQLITE_LIBRARY)
add_library(tagaini_sqlite SHARED ${tagainijisho_sqlite_SRCS} ${tagainijisho_sqlite_MOC_SRCS})
diff -u -r tagainijisho-1.0.1/src/sqlite/sqlite3ext.cc tagainijisho-1.0.1-patched/src/sqlite/sqlite3ext.cc
--- tagainijisho-1.0.1/src/sqlite/sqlite3ext.cc 2013-11-18 23:32:01.000000000 +0000
+++ tagainijisho-1.0.1-patched/src/sqlite/sqlite3ext.cc 2016-04-11 15:44:10.505347246 +0100
@@ -118,6 +118,10 @@
sqlite3_stmt *pStmt;
const char *zSql = "SELECT fts3_tokenizer(?, ?)";
+#ifdef SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
+ sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL);
+#endif
+
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
if( rc!=SQLITE_OK ){
return rc;