[bug#33136,2/7] gnu: qt: Use system sqlite.

Message ID 20181024114134.3116-2-efraim@flashner.co.il
State Accepted
Commit d28af1991ae0a99e660ad1b82ac955556d3a9382
Headers show
Series Qt updates | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed

Commit Message

Efraim Flashner Oct. 24, 2018, 11:41 a.m. UTC
* gnu/packages/databases.scm (sqlite-with-column-metadata): New
variable.
* gnu/packages/qt.scm (qt, qtbase)[source]: Remove bundled sqlite.
[inputs]: Add sqlite-with-column-metadata.
[arguments]: Add configure-flag to use system sqlite.
---
 gnu/packages/databases.scm | 12 ++++++++++++
 gnu/packages/qt.scm        | 15 ++++++---------
 2 files changed, 18 insertions(+), 9 deletions(-)

Comments

Danny Milosavljevic Oct. 26, 2018, 9:45 a.m. UTC | #1
Hi,

> +(define-public sqlite-with-column-metadata
> +  (package (inherit sqlite)
> +    (name "sqlite-with-column-metadata")
> +    (arguments
> +     (substitute-keyword-arguments (package-arguments sqlite)
> +       ((#:configure-flags flags)
> +        `(list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
> +                              "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
> +                              "-DSQLITE_ENABLE_DBSTAT_VTAB "
> +                              "-DSQLITE_ENABLE_COLUMN_METADATA")))))))

Note sure about the name.  It's doing a whole lot of other stuff.

How about sqlite/qt ?

Otherwise LGTM!
Efraim Flashner Oct. 27, 2018, 8:19 p.m. UTC | #2
On Fri, Oct 26, 2018 at 11:45:58AM +0200, Danny Milosavljevic wrote:
> Hi,
> 
> > +(define-public sqlite-with-column-metadata
> > +  (package (inherit sqlite)
> > +    (name "sqlite-with-column-metadata")
> > +    (arguments
> > +     (substitute-keyword-arguments (package-arguments sqlite)
> > +       ((#:configure-flags flags)
> > +        `(list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
> > +                              "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
> > +                              "-DSQLITE_ENABLE_DBSTAT_VTAB "
> > +                              "-DSQLITE_ENABLE_COLUMN_METADATA")))))))
> 
> Note sure about the name.  It's doing a whole lot of other stuff.
> 
> How about sqlite/qt ?
> 

The easiest way to add the flag was to overwrite the configure flags
from regular sqlite, so it really is regular sqlite with the extra flag.
Danny Milosavljevic Oct. 28, 2018, 5:17 p.m. UTC | #3
> The easiest way to add the flag was to overwrite the configure flags
> from regular sqlite, so it really is regular sqlite with the extra flag.

Oh, okay then.

Patch

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 6ebbc281f..87fb170e5 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -1211,6 +1211,18 @@  is in the public domain.")
        ((#:configure-flags flags)
         `(cons "--enable-fts5" ,flags))))))
 
+;; This is used by Qt.
+(define-public sqlite-with-column-metadata
+  (package (inherit sqlite)
+    (name "sqlite-with-column-metadata")
+    (arguments
+     (substitute-keyword-arguments (package-arguments sqlite)
+       ((#:configure-flags flags)
+        `(list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
+                              "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
+                              "-DSQLITE_ENABLE_DBSTAT_VTAB "
+                              "-DSQLITE_ENABLE_COLUMN_METADATA")))))))
+
 (define-public tdb
   (package
     (name "tdb")
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 05713e8ef..dffa8b5cf 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -135,7 +135,7 @@  system, and the core design of Django is reused in Grantlee.")
                   (lambda (dir)
                     (delete-file-recursively (string-append "qtbase/src/3rdparty/" dir)))
                   (list "double-conversion" "freetype" "harfbuzz-ng"
-                        "libpng" "libjpeg" "pcre2" "xcb"
+                        "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
                         "xkbcommon" "zlib"))
                 (for-each
                   (lambda (dir)
@@ -206,7 +206,7 @@  system, and the core design of Django is reused in Grantlee.")
        ("postgresql" ,postgresql)
        ("pulseaudio" ,pulseaudio)
        ("pcre2" ,pcre2)
-       ;("sqlite" ,sqlite)
+       ("sqlite" ,sqlite-with-column-metadata)
        ("udev" ,eudev)
        ("unixodbc" ,unixodbc)
        ("wayland" ,wayland)
@@ -273,7 +273,7 @@  system, and the core design of Django is reused in Grantlee.")
                        "-no-compile-examples"
                        ;; Most "-system-..." are automatic, but some use
                        ;; the bundled copy by default.
-                       ;"-system-sqlite"
+                       "-system-sqlite"
                        "-system-harfbuzz"
                        "-system-pcre"
                        ;; explicitly link with openssl instead of dlopening it
@@ -503,7 +503,7 @@  system, and the core design of Django is reused in Grantlee.")
                   (lambda (dir)
                     (delete-file-recursively (string-append "src/3rdparty/" dir)))
                   (list "double-conversion" "freetype" "harfbuzz-ng"
-                        "libpng" "libjpeg" "pcre2" "xcb"
+                        "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
                         "xkbcommon" "zlib"))
                 #t))))
     (build-system gnu-build-system)
@@ -545,7 +545,7 @@  system, and the core design of Django is reused in Grantlee.")
        ("pcre2" ,pcre2)
        ("postgresql" ,postgresql)
        ("pulseaudio" ,pulseaudio)
-       ;("sqlite" ,sqlite)
+       ("sqlite" ,sqlite-with-column-metadata)
        ("unixodbc" ,unixodbc)
        ("xcb-util" ,xcb-util)
        ("xcb-util-image" ,xcb-util-image)
@@ -616,10 +616,7 @@  system, and the core design of Django is reused in Grantlee.")
                  "-no-compile-examples"
                  ;; Most "-system-..." are automatic, but some use
                  ;; the bundled copy by default.
-                 ;; System sqlite fails on 5.10+
-                 ;;.obj/qsql_sqlite.o: In function `QSQLiteResultPrivate::initColumns(bool)':
-                 ;;qsql_sqlite.cpp:(.text+0x190c): undefined reference to `sqlite3_column_table_name16'
-                 ;"-system-sqlite"
+                 "-system-sqlite"
                  "-system-harfbuzz"
                  "-system-pcre"
                  ;; explicitly link with openssl instead of dlopening it