summary refs log tree commit diff
path: root/gnu/packages/patches/clementine-fix-sqlite.patch
diff options
context:
space:
mode:
authorPierre Langlois <pierre.langlois@gmx.com>2018-08-14 22:17:24 +0100
committerLeo Famulari <leo@famulari.name>2018-08-15 14:29:56 -0400
commit7bcc34050b2e1dc4bc3aa832b08ec123129d71be (patch)
tree7ba7039cfc504d7ff15845dda7b9a65ebfd8f643 /gnu/packages/patches/clementine-fix-sqlite.patch
parent8a63a4df5136a72241380fbeecf35a2e6208bb62 (diff)
downloadguix-7bcc34050b2e1dc4bc3aa832b08ec123129d71be.tar.gz
gnu: clementine: Fix creating initial database.
It seems a recent version of sqlite broke Clementine's first startup. It turns
out we can patch clementine to fix the problem instead of providing a different
sqlite package:
<https://github.com/clementine-player/Clementine/pull/5669>

* gnu/packages/databases.scm (sqlite-with-fts3): Remove.
* gnu/packages/music.scm (clementine)[inputs]: Replace sqlite-with-fts3 with
sqlite.
[source]: Add clementine-fix-sqlite.patch.
* gnu/packages/patches/clementine-fix-sqlite.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Signed-off-by: Leo Famulari <leo@famulari.name>
Diffstat (limited to 'gnu/packages/patches/clementine-fix-sqlite.patch')
-rw-r--r--gnu/packages/patches/clementine-fix-sqlite.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/gnu/packages/patches/clementine-fix-sqlite.patch b/gnu/packages/patches/clementine-fix-sqlite.patch
new file mode 100644
index 0000000000..f9d44f9074
--- /dev/null
+++ b/gnu/packages/patches/clementine-fix-sqlite.patch
@@ -0,0 +1,23 @@
+Patch downloaded from https://github.com/clementine-player/Clementine/pull/5669 .
+
+diff -ruN clementine-1.3.1.565.gd20c2244a.orig/src/core/database.cpp clementine-1.3.1.565.gd20c2244a/src/core/database.cpp
+--- clementine-1.3.1.565.gd20c2244a.orig/src/core/database.cpp	2018-07-07 23:59:24.018540126 +0200
++++ clementine-1.3.1.565.gd20c2244a/src/core/database.cpp	2018-07-08 00:04:47.991551728 +0200
+@@ -265,6 +265,17 @@
+   StaticInit();
+ 
+   {
++
++#ifdef SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
++    // In case sqlite>=3.12 is compiled without -DSQLITE_ENABLE_FTS3_TOKENIZER
++    // (generally a good idea  due to security reasons) the fts3 support should be enabled explicitly.
++    QVariant v = db.driver()->handle();
++    if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) {
++      sqlite3 *handle = *static_cast<sqlite3**>(v.data());
++      if (handle) sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL);
++    }
++#endif
++
+     QSqlQuery set_fts_tokenizer(db);
+     set_fts_tokenizer.prepare("SELECT fts3_tokenizer(:name, :pointer)");
+     set_fts_tokenizer.bindValue(":name", "unicode");