From 9728c8f71005ac973ca90ccf1ec051b6ca26735c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Jul 10 2021 14:20:51 +0000 Subject: New upstream bugfix release 5.2.10 gda_trml2html/2pdf scripts have been ported to python3, restore them Rebuild against new mdbtools-libs --- diff --git a/.gitignore b/.gitignore index b991455..95a86a5 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ libgda-4.1.6.tar.bz2 /libgda-5.2.4.tar.xz /libgda-5.2.8.tar.xz /libgda-5.2.9.tar.xz +/libgda-5.2.10.tar.xz diff --git a/0001-libgda-report-remove-trml2pdf-trml2html-functionalit.patch b/0001-libgda-report-remove-trml2pdf-trml2html-functionalit.patch deleted file mode 100644 index 95b7cd9..0000000 --- a/0001-libgda-report-remove-trml2pdf-trml2html-functionalit.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/libgda-report/RML/gda-report-rml-document.c b/libgda-report/RML/gda-report-rml-document.c -index 7bb13bc..3f905e5 100644 ---- a/libgda-report/RML/gda-report-rml-document.c -+++ b/libgda-report/RML/gda-report-rml-document.c -@@ -189,61 +189,11 @@ gda_report_rml_document_new (GdaReportEngine *engine) - static gboolean - gda_report_rml_document_run_as_html (GdaReportDocument *doc, const gchar *filename, GError **error) - { -- static GMutex init_mutex; -- static gchar *converter = NULL; -- -- g_return_val_if_fail (GDA_IS_REPORT_RML_DOCUMENT (doc), FALSE); -- g_return_val_if_fail (filename && *filename, FALSE); -- -- g_mutex_lock (&init_mutex); -- if (!converter) { -- converter = g_find_program_in_path ("trml2html.py"); -- if (!converter) { -- converter = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "gda_trml2html", "trml2html.py", NULL); -- if (!g_file_test (converter, G_FILE_TEST_IS_EXECUTABLE)) { -- g_free (converter); -- converter = NULL; -- } -- } -- if (!converter) { -- g_set_error (error, 0, 0, -- _("Could not find the '%s' program"), "trml2html.py"); -- g_mutex_unlock (&init_mutex); -- return FALSE; -- } -- } -- g_mutex_unlock (&init_mutex); -- -- return _gda_report_document_run_converter_path (doc, filename, converter, "trml2html", error); -+ return TRUE; - } - - static gboolean - gda_report_rml_document_run_as_pdf (GdaReportDocument *doc, const gchar *filename, GError **error) - { -- static GMutex init_mutex; -- static gchar *converter = NULL; -- -- g_return_val_if_fail (GDA_IS_REPORT_RML_DOCUMENT (doc), FALSE); -- g_return_val_if_fail (filename && *filename, FALSE); -- -- g_mutex_lock (&init_mutex); -- if (!converter) { -- converter = g_find_program_in_path ("trml2pdf.py"); -- if (!converter) { -- converter = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "gda_trml2pdf", "trml2pdf.py", NULL); -- if (!g_file_test (converter, G_FILE_TEST_IS_EXECUTABLE)) { -- g_free (converter); -- converter = NULL; -- } -- } -- if (!converter) { -- g_set_error (error, 0, 0, -- _("Could not find the '%s' program"), "trml2pdf.py"); -- g_mutex_unlock (&init_mutex); -- return FALSE; -- } -- } -- g_mutex_unlock (&init_mutex); -- -- return _gda_report_document_run_converter_path (doc, filename, converter, "trml2pdf", error); -+ return TRUE; - } diff --git a/0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch b/0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch new file mode 100644 index 0000000..cf4d577 --- /dev/null +++ b/0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch @@ -0,0 +1,63 @@ +From b5fb9ec54cbf38b5dd3f1e1e8bc80dc84a7aa460 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 10 Jul 2021 13:30:47 +0200 +Subject: [PATCH 1/3] mdb-provider: Remove no-op mdb_init() and mdb_exit() + calls + +According to the mdbtools NEWS file for the 0.9.0 these functions have +always been no-ops: + +"The previously-deprecated functions mdb_init() and mdb_exit() have been +removed. These functions did nothing; any calls to them should be excised with +prejudice." + +And now they have been removed completely, since these were already +no-ops in older mdbtools versions we can safely drop them without +loosing compatibility with older mdbtools releases. +--- + providers/mdb/gda-mdb-provider.c | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c +index 10bdc809d..82b085ca7 100644 +--- a/providers/mdb/gda-mdb-provider.c ++++ b/providers/mdb/gda-mdb-provider.c +@@ -63,8 +63,6 @@ static const gchar *gda_mdb_provider_get_database (GdaServerProvider *provider, + + + static GObjectClass *parent_class = NULL; +-static GMutex mdb_init_mutex; +-static gint loaded_providers = 0; + char *g_input_ptr; + + /* +@@ -107,13 +105,6 @@ gda_mdb_provider_finalize (GObject *object) + + /* chain to parent class */ + parent_class->finalize (object); +- +- /* call MDB exit function if there are no more providers */ +- g_mutex_lock (&mdb_init_mutex); +- loaded_providers--; +- if (loaded_providers == 0) +- mdb_exit (); +- g_mutex_unlock (&mdb_init_mutex); + } + + GType +@@ -148,12 +139,6 @@ gda_mdb_provider_new (void) + { + GdaMdbProvider *provider; + +- g_mutex_lock (&mdb_init_mutex); +- if (loaded_providers == 0) +- mdb_init (); +- loaded_providers++; +- g_mutex_unlock (&mdb_init_mutex); +- + provider = g_object_new (gda_mdb_provider_get_type (), NULL); + return GDA_SERVER_PROVIDER (provider); + } +-- +2.31.1 + diff --git a/0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch b/0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch new file mode 100644 index 0000000..4cdde27 --- /dev/null +++ b/0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch @@ -0,0 +1,59 @@ +From 90c4468ba5d334ffaa627f6f63fba444119bac47 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 10 Jul 2021 13:48:11 +0200 +Subject: [PATCH 2/3] mdb-provider: Store filename used to open the DB in our + private data + +With mdbtools >= 0.9.0, the MdbFile struct no longer has a filename member, +instead store the filename passed to mdb_open() in our private data. + +Note this also fixes the dynamically allocated string returned by +g_build_filename() being leaked. +--- + providers/mdb/gda-mdb-provider.c | 4 +++- + providers/mdb/gda-mdb.h | 1 + + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c +index 82b085ca7..c82a37aee 100644 +--- a/providers/mdb/gda-mdb-provider.c ++++ b/providers/mdb/gda-mdb-provider.c +@@ -288,6 +288,7 @@ gda_mdb_provider_open_connection (GdaServerProvider *provider, GdaConnection *cn + + cdata = g_new0 (MdbConnectionData, 1); + cdata->cnc = cnc; ++ cdata->filename = filename; + cdata->server_version = NULL; + #ifdef MDB_WITH_WRITE_SUPPORT + cdata->mdb = mdb_open (filename, MDB_WRITABLE); +@@ -562,7 +563,7 @@ gda_mdb_provider_get_database (GdaServerProvider *provider, GdaConnection *cnc) + if (!cdata) + return NULL; + +- return (const gchar *) cdata->mdb->f->filename; ++ return cdata->filename; + } + + /* +@@ -572,5 +573,6 @@ static void + gda_mdb_free_cnc_data (MdbConnectionData *cdata) + { + g_free (cdata->server_version); ++ g_free (cdata->filename); + g_free (cdata); + } +diff --git a/providers/mdb/gda-mdb.h b/providers/mdb/gda-mdb.h +index 4744fe593..14eaf5d22 100644 +--- a/providers/mdb/gda-mdb.h ++++ b/providers/mdb/gda-mdb.h +@@ -38,6 +38,7 @@ + typedef struct { + GdaConnection *cnc; + MdbHandle *mdb; ++ gchar *filename; + gchar *server_version; + } MdbConnectionData; + +-- +2.31.1 + diff --git a/0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch b/0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch new file mode 100644 index 0000000..d6b36cc --- /dev/null +++ b/0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch @@ -0,0 +1,40 @@ +From 66cc17d130d15d13efc5e22b2a155e426678c536 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 10 Jul 2021 13:37:11 +0200 +Subject: [PATCH 3/3] mdb-provider: Pass MdbHandle to the mdb_set_date_fmt() + call + +mdbtools >= 0.9.0 require a MdbHandle to be passed to the +mdb_set_date_fmt() call. Move the call to directly after mdb_open() +(when we first get the handle) and pass the handle to it. + +Note this change means that the mdb-provider will now no longer +compile with older mdbtools versions. +--- + providers/mdb/gda-mdb-provider.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c +index c82a37aee..17660b75d 100644 +--- a/providers/mdb/gda-mdb-provider.c ++++ b/providers/mdb/gda-mdb-provider.c +@@ -93,7 +93,6 @@ gda_mdb_provider_class_init (GdaMdbProviderClass *klass) + static void + gda_mdb_provider_init (GdaMdbProvider *myprv, GdaMdbProviderClass *klass) + { +- mdb_set_date_fmt ("%Y-%m-%d %H:%M:%S"); + } + + static void +@@ -301,6 +300,8 @@ gda_mdb_provider_open_connection (GdaServerProvider *provider, GdaConnection *cn + return FALSE; + } + ++ mdb_set_date_fmt (cdata->mdb, "%Y-%m-%d %H:%M:%S"); ++ + /* open virtual connection */ + if (! GDA_SERVER_PROVIDER_CLASS (parent_class)->open_connection (GDA_SERVER_PROVIDER (provider), cnc, params, + NULL, NULL, NULL, NULL)) { +-- +2.31.1 + diff --git a/libgda-5.2.10-mysql-bool-fix.patch b/libgda-5.2.10-mysql-bool-fix.patch new file mode 100644 index 0000000..b12b12e --- /dev/null +++ b/libgda-5.2.10-mysql-bool-fix.patch @@ -0,0 +1,30 @@ +From 9859479884fad5f39e6c37e8995e57c28b11b1b9 Mon Sep 17 00:00:00 2001 +From: Andrea Zagli +Date: Fri, 25 Dec 2020 10:21:46 +0100 +Subject: [PATCH] MySQL: bool is here again. + +--- + m4/mysql.m4 | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/m4/mysql.m4 b/m4/mysql.m4 +index 79d4d173f..535a081a9 100644 +--- a/m4/mysql.m4 ++++ b/m4/mysql.m4 +@@ -217,7 +217,12 @@ dnl Try detect API version + AC_MSG_CHECKING([checking for Mysql 8 API version]) + AX_COMPARE_VERSION($mysql_version, [ge], [8.0.0], + [ +- mysql8=yes ++ AX_COMPARE_VERSION($mysql_version, [ge], [10.0.0], ++ [ ++ mysql8=no ++ ],[ ++ mysql8=yes ++ ]) + ],[ + mysql8=no + ]) +-- +GitLab + diff --git a/libgda.spec b/libgda.spec index cee4f18..af3af91 100644 --- a/libgda.spec +++ b/libgda.spec @@ -10,16 +10,21 @@ Name: libgda Epoch: 1 -Version: 5.2.9 -Release: 8%{?dist} +Version: 5.2.10 +Release: 1%{?dist} Summary: Library for writing gnome database programs License: LGPLv2+ URL: http://www.gnome-db.org/ Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/5.2/%{name}-%{version}.tar.xz -# remove converter functionality that relies on eight-year-old python2 scripts -Patch1: 0001-libgda-report-remove-trml2pdf-trml2html-functionalit.patch +# Patches for building against mdbtools >= 0.9.0 +# https://gitlab.gnome.org/GNOME/libgda/-/merge_requests/178 +Patch1: 0001-mdb-provider-Remove-no-op-mdb_init-and-mdb_exit-call.patch +Patch2: 0002-mdb-provider-Store-filename-used-to-open-the-DB-in-o.patch +Patch3: 0003-mdb-provider-Pass-MdbHandle-to-the-mdb_set_date_fmt-.patch +# Upstream fix commit 9859479884fad5f39e6c37e8995e57c28b11b1b9 +Patch4: libgda-5.2.10-mysql-bool-fix.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -44,7 +49,8 @@ BuildRequires: libsoup-devel BuildRequires: openssl-devel BuildRequires: yelp-tools BuildRequires: vala -BuildRequires: make +BuildRequires: make +BuildRequires: gnome-common %{?with_bdb:BuildRequires: libdb-devel} %{?with_ldap:BuildRequires: openldap-devel} %{?with_mysql:BuildRequires: mariadb-connector-c-devel} @@ -175,6 +181,7 @@ This %{name}-java includes the %{name} Java JDBC provider. %prep %autosetup -p1 +NOCONFIGURE=1 srcdir=. gnome-autogen.sh # AUTHORS not in UTF-8 iconv --from=ISO-8859-1 --to=UTF-8 AUTHORS > AUTHORS.new && \ @@ -243,10 +250,6 @@ export LD_LIBRARY_PATH=/usr/lib/jvm/java/jre/lib/%{archinstall}/server:$LD_LIBRA find %{buildroot} -name '*.la' -exec rm -f {} ';' rm %{buildroot}/%{_sysconfdir}/%{name}-%{apiver}/sales_test.db -# remove eight-year-old python2 report converter scripts -rm -r %{buildroot}/%{_datadir}/%{name}-%{apiver}/gda_trml2html -rm -r %{buildroot}/%{_datadir}/%{name}-%{apiver}/gda_trml2pdf - %find_lang libgda-5.0 %find_lang gda-browser --with-gnome @@ -315,6 +318,8 @@ rm -r %{buildroot}/%{_datadir}/%{name}-%{apiver}/gda_trml2pdf %files tools -f gda-browser.lang %doc %{_datadir}/gtk-doc/html/gda-browser/ %{_bindir}/gda-* +%{_datadir}/%{name}-%{apiver}/gda_trml2html +%{_datadir}/%{name}-%{apiver}/gda_trml2pdf %{_datadir}/appdata/*.appdata.xml %{_datadir}/applications/gda-browser-%{apiver}.desktop %{_datadir}/applications/gda-control-center-%{apiver}.desktop @@ -373,6 +378,11 @@ rm -r %{buildroot}/%{_datadir}/%{name}-%{apiver}/gda_trml2pdf %endif %changelog +* Sat Jul 10 2021 Hans de Goede - 1:5.2.10-1 +- New upstream bugfix release 5.2.10 +- gda_trml2html/2pdf scripts have been ported to python3, restore them +- Rebuild against new mdbtools-libs + * Mon Feb 08 2021 Pavel Raiskup - 1:5.2.9-8 - rebuild for libpq ABI fix rhbz#1908268 diff --git a/sources b/sources index 4193107..d7932fb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libgda-5.2.9.tar.xz) = a28324533298d42aacfce5d9f3d699314ddb5d5fe7e492433dbbe4232fb310b798d312ac08dffd4f4ebef5ceea3c6c49ef3c679ab97b5e9d1f64e3fed50b2231 +SHA512 (libgda-5.2.10.tar.xz) = ff72f239dfcb96a0e24a9ceaa66f23808a221a337b4cd646ced5482cd5ad933a7b42a26c1a45386b675aede753b0942fb6440caf15b8de6dc95045d62d2ff2ee