summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-09-08 13:58:25 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-09-13 02:04:38 -0400
commitdc1cf13ac58b7693cbabd3ebd82ad05088b4dbf4 (patch)
tree5b6fa9166e6e418ef4508e7244595f50cb9d3ea2 /gnu
parent8dae63937bb28d2bafe47225664f1a3acf5fdc30 (diff)
downloadguix-dc1cf13ac58b7693cbabd3ebd82ad05088b4dbf4.tar.gz
gnu: libgda: Update to 6.0.0.
* gnu/packages/gnome.scm (libgda): Update to 6.0.0.
[source]: Delete modules and snippet field.  Apply new patches.
[build-system]: Use meson-build-system.
[native-inputs]: Remove autoconf, autoconf-archive, automake, libtool, which
and xorg-server-for-tests.
[inputs]: Add json-glib.
* gnu/packages/patches/libgda-cve-2021-39359.patch: New file.
* gnu/packages/patches/libgda-fix-build.patch: Likewise.
* gnu/packages/patches/libgda-fix-missing-initialization.patch: Likewise.
* gnu/packages/patches/libgda-skip-postgresql-tests.patch: Likewise.
* gnu/local.mk (dist_patch_DATA): Register them.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk4
-rw-r--r--gnu/packages/gnome.scm90
-rw-r--r--gnu/packages/patches/libgda-cve-2021-39359.patch33
-rw-r--r--gnu/packages/patches/libgda-fix-build.patch131
-rw-r--r--gnu/packages/patches/libgda-fix-missing-initialization.patch26
-rw-r--r--gnu/packages/patches/libgda-skip-postgresql-tests.patch91
6 files changed, 312 insertions, 63 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 8e5a1970ab..376ce481b1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1405,6 +1405,10 @@ dist_patch_DATA =						\
   %D%/packages/patches/libcroco-CVE-2020-12825.patch		\
   %D%/packages/patches/libcyaml-libyaml-compat.patch		\
   %D%/packages/patches/libexpected-nofetch.patch                \
+  %D%/packages/patches/libgda-cve-2021-39359.patch		\
+  %D%/packages/patches/libgda-fix-build.patch			\
+  %D%/packages/patches/libgda-fix-missing-initialization.patch	\
+  %D%/packages/patches/libgda-skip-postgresql-tests.patch	\
   %D%/packages/patches/libgit2-mtime-0.patch			\
   %D%/packages/patches/libgnome-encoding.patch			\
   %D%/packages/patches/libgnomeui-utf8.patch			\
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index f7f12a6b12..7c78b194f6 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -12704,58 +12704,35 @@ developed with the aim of being used with the Librem 5 phone.")
 (define-public libgda
   (package
     (name "libgda")
-    (version "5.2.10")
+    (version "6.0.0")
     (source
      (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://gitlab.gnome.org/GNOME/libgda.git/")
-             (commit (string-append "LIBGDA_" (string-replace-substring
-                                               version "." "_")))))
-       (file-name (git-file-name name version))
+       (method url-fetch)
+       (uri (string-append "mirror://gnome/sources/" name "/"
+                           (version-major+minor version) "/"
+                           name "-" version ".tar.xz"))
        (sha256
-        (base32 "18rg773gq9v3cdywpmrp12c5xyp97ir9yqjinccpi22sksb1kl8a"))
-       (modules '((guix build utils)))
-       (snippet
-        ;; Remove the bundled sqlite, but keep its header because code relies
-        ;; on this header variant.
-        '(delete-file "libgda/sqlite/sqlite-src/sqlite3.c"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:configure-flags '("--enable-system-sqlite" "--enable-vala")
-       ;; There's a race between check_cnc_lock and check_threaded_cnc
-       ;; in tests/multi-threading.
-       #:parallel-tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-glade-install
-           (lambda _
-             (substitute* "configure.ac"
-               (("`\\$PKG_CONFIG --variable=catalogdir gladeui-2\\.0`")
-                "${datadir}/glade/catalogs")
-               (("`\\$PKG_CONFIG --variable=pixmapdir gladeui-2\\.0`")
-                "${datadir}/glade/pixmaps"))
-             #t))
-         (add-before 'check 'pre-check
-           (lambda* (#:key inputs #:allow-other-keys)
-             ;; Tests require a running X server.
-             (system "Xvfb :1 &")
-             (setenv "DISPLAY" ":1")
-             #t))
-         (add-after 'install 'symlink-glade-module
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((shlib "libgda-ui-5.0.so")
-                    (out (assoc-ref outputs "out"))
-                    (out/lib (string-append out "/lib"))
-                    (moduledir (string-append out/lib "/glade/modules")))
-               (mkdir-p moduledir)
-               (symlink (string-append out/lib "/" shlib)
-                        (string-append moduledir "/" shlib))
-               #t))))))
-    (propagated-inputs
-     (list libxml2))           ; required by libgda-5.0.pc
+        (base32 "0w564z7krgjk19r39mi5qn4kggpdg9ggbyn9pb4aavb61r14npwr"))
+       (patches (search-patches "libgda-cve-2021-39359.patch"
+                                "libgda-fix-build.patch"
+                                "libgda-fix-missing-initialization.patch"
+                                "libgda-skip-postgresql-tests.patch"))))
+    (build-system meson-build-system)
+    (native-inputs
+     (list intltool
+           iso-codes
+           `(,glib "bin")
+           gnome-common
+           gettext-minimal
+           gobject-introspection
+           gtk-doc/stable
+           pkg-config
+           python
+           vala
+           yelp-tools))
     (inputs
-     (list glib
+     (list json-glib
+           glib
            glade3
            gtk+
            libsecret
@@ -12763,21 +12740,8 @@ developed with the aim of being used with the Librem 5 phone.")
            openssl
            sqlite
            vala))
-    (native-inputs
-     `(("autoconf" ,autoconf)
-       ("autoconf-archive" ,autoconf-archive)
-       ("automake" ,automake)
-       ("glib:bin" ,glib "bin")
-       ("gnome-common" ,gnome-common)
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk-doc" ,gtk-doc/stable)
-       ("intltool" ,intltool)
-       ("libtool" ,libtool)
-       ("pkg-config" ,pkg-config)
-       ("vala" ,vala)
-       ("which" ,which)
-       ("xorg-server" ,xorg-server-for-tests)
-       ("yelp-tools" ,yelp-tools)))
+    (propagated-inputs
+     (list libxml2))                    ; required by libgda-5.0.pc
     (home-page "https://gitlab.gnome.org/GNOME/libgda")
     (synopsis "Uniform data access")
     (description
diff --git a/gnu/packages/patches/libgda-cve-2021-39359.patch b/gnu/packages/patches/libgda-cve-2021-39359.patch
new file mode 100644
index 0000000000..5e14e79393
--- /dev/null
+++ b/gnu/packages/patches/libgda-cve-2021-39359.patch
@@ -0,0 +1,33 @@
+From bebdffb4de586fb43fd07ac549121f4b22f6812d Mon Sep 17 00:00:00 2001
+From: "Douglas R. Reno" <renodr@linuxfromscratch.org>
+Date: Mon, 18 Oct 2021 13:18:01 -0500
+Subject: [PATCH] Fix CVE-2021-39359 by forcing TLS certificate validation
+
+This was done by adding "ssl-use-system-ca-file", TRUE to the options
+for each soup_session_new_with_options() call that was made.
+
+Tested on Linux From Scratch 11.0 and Debian 11.
+
+Fixes #249
+---
+ providers/web/gda-web-provider.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/providers/web/gda-web-provider.c b/providers/web/gda-web-provider.c
+index cf8d14dc3..cc818895f 100644
+--- a/providers/web/gda-web-provider.c
++++ b/providers/web/gda-web-provider.c
+@@ -355,8 +355,8 @@ gda_web_provider_open_connection (GdaServerProvider *provider, GdaConnection *cn
+ 	g_rec_mutex_init (& (cdata->mutex));
+ 	cdata->server_id = NULL;
+ 	cdata->forced_closing = FALSE;
+-	cdata->worker_session = soup_session_new ();
+-	cdata->front_session = soup_session_new_with_options ("max-conns-per-host", 1, NULL);
++	cdata->worker_session = soup_session_new_with_options ("ssl-use-system-ca-file", TRUE, NULL);
++	cdata->front_session = soup_session_new_with_options ("max-conns-per-host", 1, "ssl-use-system-ca-file", TRUE, NULL);
+ 	if (use_ssl) {
+ 		server_url = g_string_new ("https://");
+ 		g_print ("USING SSL\n");
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/libgda-fix-build.patch b/gnu/packages/patches/libgda-fix-build.patch
new file mode 100644
index 0000000000..35f5b9694b
--- /dev/null
+++ b/gnu/packages/patches/libgda-fix-build.patch
@@ -0,0 +1,131 @@
+Taken from upstream.
+
+From 4c2369083c5941ffada100e4a7e4702e681585e3 Mon Sep 17 00:00:00 2001
+From: taozuhong <taozuhong@gmail.com>
+Date: Tue, 11 Jan 2022 15:03:28 +0800
+Subject: [PATCH] fixed compile error
+
+---
+ libgda/Gda-6.0-custom.vala |  3 +++
+ libgda/sql-parser/lemon.c  | 39 +++++++++++++++++++-------------------
+ 2 files changed, 22 insertions(+), 20 deletions(-)
+
+diff --git a/libgda/Gda-6.0-custom.vala b/libgda/Gda-6.0-custom.vala
+index d046c5c24..4d1408648 100644
+--- a/libgda/Gda-6.0-custom.vala
++++ b/libgda/Gda-6.0-custom.vala
+@@ -92,7 +92,10 @@ namespace Gda {
+ 	[CCode (cheader_filename = "libgda.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gda_sql_statement_get_type ()")]
+ 	[Compact]
+ 	public class SqlStatement {
++		#if VALA_0_50
++		#else
+ 		public static Gda.SqlStatementContentsInfo get_contents_infos (Gda.SqlStatementType type);
++		#endif
+ 	}
+ 
+ }
+diff --git a/libgda/sql-parser/lemon.c b/libgda/sql-parser/lemon.c
+index a6fe75bb9..a3c727777 100644
+--- a/libgda/sql-parser/lemon.c
++++ b/libgda/sql-parser/lemon.c
+@@ -11,6 +11,7 @@
+ #include <string.h>
+ #include <ctype.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <assert.h>
+ #include <gio/gio.h>
+ 
+@@ -40,7 +41,7 @@ static const char **made_files = NULL;
+ static int made_files_count = 0;
+ static int successful_exit = 0;
+ 
+-static char *msort(char*,char**,int(*)(const char*,const char*));
++static uintptr_t msort(uintptr_t, uintptr_t*, int(*)(const uintptr_t, const uintptr_t));
+ 
+ /*
+ ** Compilers are getting increasingly pedantic about type conversions
+@@ -396,8 +397,7 @@ static int actioncmp(
+ static struct action *Action_sort(
+   struct action *ap
+ ){
+-  ap = (struct action *)msort((char *)ap,(char **)&ap->next,
+-                              (int(*)(const char*,const char*))actioncmp);
++  ap = (struct action *)msort(ap, &ap->next, actioncmp);
+   return ap;
+ }
+ 
+@@ -1277,14 +1277,14 @@ void Configlist_closure(struct lemon *lemp)
+ 
+ /* Sort the configuration list */
+ void Configlist_sort(){
+-  current = (struct config *)msort((char *)current,(char **)&(current->next),Configcmp);
++  current = (struct config *)msort(current, &(current->next), Configcmp);
+   currentend = 0;
+   return;
+ }
+ 
+ /* Sort the basis configuration list */
+ void Configlist_sortbasis(){
+-  basis = (struct config *)msort((char *)current,(char **)&(current->bp),Configcmp);
++  basis = (struct config *)msort(current, &(current->bp), Configcmp);
+   basisend = 0;
+   return;
+ }
+@@ -1577,7 +1577,7 @@ int main(G_GNUC_UNUSED int argc, char **argv)
+ /*
+ ** Return a pointer to the next structure in the linked list.
+ */
+-#define NEXT(A) (*(char**)(((unsigned long)A)+offset))
++#define NEXT(A) (*(uintptr_t *)(((uintptr_t)A)+offset))
+ 
+ /*
+ ** Inputs:
+@@ -1594,13 +1594,13 @@ int main(G_GNUC_UNUSED int argc, char **argv)
+ **   The "next" pointers for elements in the lists a and b are
+ **   changed.
+ */
+-static char *merge(
+-  char *a,
+-  char *b,
+-  int (*cmp)(const char*,const char*),
+-  int offset
++static uintptr_t merge(
++  uintptr_t a,
++  uintptr_t b,
++  int (*cmp)(const uintptr_t, const uintptr_t),
++  uintptr_t offset
+ ){
+-  char *ptr, *head;
++  uintptr_t ptr, *head;
+ 
+   if( a==0 ){
+     head = b;
+@@ -1646,16 +1646,15 @@ static char *merge(
+ **   The "next" pointers for elements in list are changed.
+ */
+ #define LISTSIZE 30
+-static char *msort(
+-  char *list,
+-  char **next,
+-  int (*cmp)(const char*,const char*)
++static uintptr_t msort(
++  uintptr_t list,
++  uintptr_t *next,
++  int (*cmp)(const uintptr_t, const uintptr_t)
+ ){
+-  unsigned long offset;
+-  char *ep;
+-  char *set[LISTSIZE];
++  uintptr_t ep;
++  uintptr_t set[LISTSIZE];
+   int i;
+-  offset = (unsigned long)next - (unsigned long)list;
++  uintptr_t offset = (uintptr_t)next - (uintptr_t)list;
+   for(i=0; i<LISTSIZE; i++) set[i] = 0;
+   while( list ){
+     ep = list;
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/libgda-fix-missing-initialization.patch b/gnu/packages/patches/libgda-fix-missing-initialization.patch
new file mode 100644
index 0000000000..59c4a21e28
--- /dev/null
+++ b/gnu/packages/patches/libgda-fix-missing-initialization.patch
@@ -0,0 +1,26 @@
+Taken from upstream.
+
+From a4a3930ecfc4dc815b7a18dbb7338c165ea08f4e Mon Sep 17 00:00:00 2001
+From: Pavlo Solntsev <p.sun.fun@gmail.com>
+Date: Sun, 19 Sep 2021 22:54:33 -0500
+Subject: [PATCH] Test: Fixing missing initialization
+
+---
+ libgda/thread-wrapper/test-itsignaler.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libgda/thread-wrapper/test-itsignaler.c b/libgda/thread-wrapper/test-itsignaler.c
+index d0c15ae17..7ac4e958a 100644
+--- a/libgda/thread-wrapper/test-itsignaler.c
++++ b/libgda/thread-wrapper/test-itsignaler.c
+@@ -203,6 +203,7 @@ test2 (void)
+ 	CbData cbdata;
+ 	cbdata.counter = 0;
+ 	cbdata.loop = loop;
++	cbdata.its = its;
+ 	itsignaler_add (its, NULL, (ITSignalerFunc) source_callback, &cbdata, NULL);
+ 	itsignaler_unref (its);
+   g_mutex_unlock (&mutex);
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/libgda-skip-postgresql-tests.patch b/gnu/packages/patches/libgda-skip-postgresql-tests.patch
new file mode 100644
index 0000000000..28fef585ac
--- /dev/null
+++ b/gnu/packages/patches/libgda-skip-postgresql-tests.patch
@@ -0,0 +1,91 @@
+Taken from upstream.
+
+From b0cd77e588620465b78f7c017d3f240e13936aa3 Mon Sep 17 00:00:00 2001
+From: Pavlo Solntsev <p.sun.fun@gmail.com>
+Date: Sun, 19 Sep 2021 22:51:38 -0500
+Subject: [PATCH] Test: Skip test if no server available
+
+Two variables will be checked. If they set
+and provide all needed information the test
+will be executed. If they are not set, the test
+will return TRUE and will terminate with
+termination status EXIT_SUCCESS.
+---
+ tests/db/check-db-catalog-postgresql.c   | 16 ++++++++++++++++
+ tests/test-server-operation-postgresql.c | 16 ++++++++++++++++
+ 2 files changed, 32 insertions(+)
+
+diff --git a/tests/db/check-db-catalog-postgresql.c b/tests/db/check-db-catalog-postgresql.c
+index 5b8e9395c..bf9a8942c 100644
+--- a/tests/db/check-db-catalog-postgresql.c
++++ b/tests/db/check-db-catalog-postgresql.c
+@@ -25,6 +25,9 @@
+ #include <libgda/libgda.h>
+ #include "../test-cnc-utils.h"
+ 
++#define PROVIDER_DB_CREATE_PARAMS "POSTGRESQL_DBCREATE_PARAMS"
++#define PROVIDER_CNC_PARAMS "POSTGRESQL_CNC_PARAMS"
++
+ typedef struct {
+   GdaDbCatalog *catalog;
+   GdaConnection *cnc;
+@@ -359,6 +362,19 @@ main (gint   argc,
+ {
+   setlocale (LC_ALL,"");
+ 
++  const gchar *db_create_str;
++  const gchar *cnc_params;
++
++  db_create_str = g_getenv (PROVIDER_DB_CREATE_PARAMS);
++  cnc_params = g_getenv (PROVIDER_CNC_PARAMS);
++
++  if (!db_create_str || !cnc_params) {
++      g_print ("Please set POSTGRESQL_DBCREATE_PARAMS and POSTGRESQL_CNC_PARAMS variable"
++	      "with dbname, host, user and port (usually 5432)\n");
++      g_print ("Test will not be performed\n");
++      return EXIT_SUCCESS;
++  }
++
+   g_test_init (&argc,&argv,NULL);
+ 
+   g_test_add ("/test-db-postgresql/meta-tables",
+diff --git a/tests/test-server-operation-postgresql.c b/tests/test-server-operation-postgresql.c
+index 37796c4be..860f41a18 100644
+--- a/tests/test-server-operation-postgresql.c
++++ b/tests/test-server-operation-postgresql.c
+@@ -38,9 +38,12 @@
+ #include <glib/gi18n.h>
+ #include <locale.h>
+ #include <libgda/libgda.h>
++/*#include <stdlib.h>*/
+ #include "test-cnc-utils.h"
+ 
+ #define PROVIDER_NAME "PostgreSQL"
++#define PROVIDER_DB_CREATE_PARAMS "POSTGRESQL_DBCREATE_PARAMS"
++#define PROVIDER_CNC_PARAMS "POSTGRESQL_CNC_PARAMS"
+ 
+ #define GDA_PGSQL_ERROR_HANDLE(e) (g_print("Error: %s: %s\n", G_STRLOC, e && e->message ? e->message : "No default"));
+ 
+@@ -1335,6 +1338,19 @@ main(gint argc, gchar *argv[])
+ {
+   setlocale (LC_ALL,"");
+ 
++  const gchar *db_create_str;
++  const gchar *cnc_params;
++
++  db_create_str = g_getenv (PROVIDER_DB_CREATE_PARAMS);
++  cnc_params = g_getenv (PROVIDER_CNC_PARAMS);
++
++  if (!db_create_str || !cnc_params) {
++      g_print ("Please set POSTGRESQL_DBCREATE_PARAMS and POSTGRESQL_CNC_PARAMS variable"
++	      "with dbname, host, user and port (usually 5432)\n");
++      g_print ("Test will not be performed\n");
++      return EXIT_SUCCESS;
++  }
++
+   g_test_init (&argc,&argv,NULL);
+ 
+   g_test_add ("/test-server-operation-sqlite/old-so-module",
+-- 
+GitLab
+