commit 9b52705d748a6844ccf54e6a3e88fbcd634d3a13
parent cfdffb98c315e22f5fb2059d091c088d82d8b7c0
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 15 Nov 2024 11:50:06 +0100
fix FTBFS with latest GNUnet APIs
Diffstat:
10 files changed, 127 insertions(+), 62 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -464,6 +464,8 @@ doc/Makefile
doc/doxygen/Makefile
src/Makefile
src/anastasis/Makefile
+src/include/Makefile
+src/util/Makefile
src/testing/Makefile
pixmaps/Makefile
po/Makefile.in
diff --git a/po/POTFILES.in b/po/POTFILES.in
@@ -47,6 +47,7 @@ src/anastasis/anastasis-gtk_progress.c
src/anastasis/os_installation.c
src/anastasis/print.c
src/anastasis/test-print.c
+src/util/os_installation.c
contrib/anastasis_gtk_add_provider.glade
contrib/anastasis_gtk_auth_add_email.glade
contrib/anastasis_gtk_auth_add_iban.glade
diff --git a/src/Makefile.am b/src/Makefile.am
@@ -1,2 +1,2 @@
# This Makefile.am is in the public domain
-SUBDIRS = . anastasis testing
+SUBDIRS = . include util anastasis testing
diff --git a/src/anastasis/Makefile.am b/src/anastasis/Makefile.am
@@ -2,7 +2,8 @@
SUBDIRS = .
AM_CPPFLAGS = \
- -I$(top_srcdir)/ \
+ -I$(top_srcdir)/src/include \
+ -I$(top_srcdir) \
@GTK_CFLAGS@ \
@GNUNET_CFLAGS@ \
@GLADE_CFLAGS@
@@ -56,8 +57,7 @@ anastasis_gtk_SOURCES = \
anastasis-gtk_pe-delete-challenge.c \
anastasis-gtk_pe-delete-policy.c \
anastasis-gtk_pe-edit-policy.c \
- anastasis-gtk_progress.c anastasis-gtk_progress.h \
- os_installation.c
+ anastasis-gtk_progress.c anastasis-gtk_progress.h
if HPDF_ENABLED
anastasis_gtk_SOURCES += \
@@ -69,6 +69,7 @@ anastasis_gtk_SOURCES += \
endif
anastasis_gtk_LDADD = \
+ $(top_builddir)/src/util/libanastasisgtkutil.la \
@GTK_LIBS@ \
@GLADE_LIBS@ @GNUNET_LIBS@ \
@QR_LIBS@ \
diff --git a/src/anastasis/anastasis-gtk.c b/src/anastasis/anastasis-gtk.c
@@ -25,6 +25,7 @@
* @author Dennis Neufeld
*/
#include <gnunet/gnunet_util_lib.h>
+#include "anastasis_gtk_util.h"
#include "anastasis-gtk_action.h"
#include "anastasis-gtk_helper.h"
#include <jansson.h>
@@ -217,13 +218,12 @@ run (void *cls)
AG_entry_attributes = GNUNET_CONTAINER_multihashmap_create (16,
GNUNET_NO);
GNUNET_GTK_set_icon_search_path ();
- GNUNET_OS_init (ANASTASIS_project_data_default ());
GNUNET_GTK_setup_nls ();
if (GNUNET_OK !=
GNUNET_GTK_main_loop_build_window (AG_ml,
NULL))
return;
- AG_cfg = GNUNET_GTK_main_loop_get_configuration (AG_ml);
+ AG_cfg = GNUNET_GTK_main_loop_get_gtk_configuration (AG_ml);
GNUNET_GTK_main_loop_get_args (AG_ml,
&argc,
&argv);
@@ -270,7 +270,8 @@ main (int argc,
AG_application_id = GNUNET_strdup ("anastasis-standalone");
if (GNUNET_OK !=
- GNUNET_GTK_main_loop_start ("anastasis-gtk",
+ GNUNET_GTK_main_loop_start (ANASTASIS_GTK_project_data (),
+ "anastasis-gtk",
"GTK GUI for Anastasis",
argc,
argv,
diff --git a/src/anastasis/os_installation.c b/src/anastasis/os_installation.c
@@ -1,55 +0,0 @@
-/*
- This file is part of Anastasis.
- Copyright (C) 2020 Anastasis SARL
-
- Anastasis is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
-
- Anastasis is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Anastasis; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-/**
- * @file src/anastasis/os_installation.c
- * @brief initialize GNUNET_OS for anastasis-gtk
- * @author Christian Grothoff
- */
-#include <gnunet/gnunet_util_lib.h>
-
-/**
- * Default project data used for installation path detection
- * for anastasis-gtk.
- */
-static const struct GNUNET_OS_ProjectData gtk_pd = {
- .libname = "libanastasisgtk",
- .project_dirname = "anastasis",
- .binary_name = "anastasis-gtk",
- .env_varname = "ANASTASIS_GTK_PREFIX",
- .env_varname_alt = "ANASTASIS_PREFIX",
- .base_config_varname = "ANASTASIS_BASE_CONFIG",
- .bug_email = "anastasis@gnu.org",
- .homepage = "https://anastasis.lu/",
- .config_file = "anastasis.conf",
- .user_config_file = "~/.config/anastasis.conf"
-};
-
-
-/**
- * Initialize.
- */
-void __attribute__ ((constructor))
-ANASTASIS_GTK_init ()
-{
- GNUNET_OS_init (>k_pd);
-}
-
-
-/* end of os_installation.c */
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
@@ -0,0 +1,6 @@
+# This Makefile.am is in the public domain
+
+anastasisgtkincludedir = $(includedir)/anastasis-gtk
+
+anastasisgtkinclude_HEADERS = \
+ anastasis_gtk_util.h
diff --git a/src/include/anastasis_gtk_util.h b/src/include/anastasis_gtk_util.h
@@ -0,0 +1,35 @@
+/*
+ This file is part of ANASTASIS-GTK
+ Copyright (C) 2024 Taler Systems SA
+
+ ANASTASIS-GTK is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ ANASTASIS-GTK is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ ANASTASIS-GTK; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file include/anastasis_gtk_util.h
+ * @brief Interface for common utility functions
+ * @author Christian Grothoff
+ */
+#ifndef ANASTASIS_GTK_UTIL_H
+#define ANASTASIS_GTK_UTIL_H
+
+#include <gnunet/gnunet_util_lib.h>
+
+/**
+ * Return project data used by Anastasis-Gtk.
+ *
+ * @return project data for anastasis-gtk
+ */
+const struct GNUNET_OS_ProjectData *
+ANASTASIS_GTK_project_data (void);
+
+
+#endif
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
@@ -0,0 +1,16 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS)
+
+pkgcfgdir = $(prefix)/share/anastasis-gtk/config.d/
+
+lib_LTLIBRARIES = \
+ libanastasisgtkutil.la
+
+libanastasisgtkutil_la_SOURCES = \
+ os_installation.c
+libanastasisgtkutil_la_LIBADD = \
+ -lgnunetutil \
+ $(XLIB)
+libanastasisgtkutil_la_LDFLAGS = \
+ -version-info 0:0:0 \
+ -export-dynamic -no-undefined
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
@@ -0,0 +1,58 @@
+/*
+ This file is part of Anastasis-Gtk.
+ Copyright (C) 2023 Taler Systems SA
+
+ Anastasis-Gtk is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ Anastasis-Gtk is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Anastasis-Gtk; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file os_installation.c
+ * @brief initialize libgnunet OS subsystem for Anastasis-Gtk.
+ * @author Christian Grothoff
+ */
+#include "anastasis_gtk_config.h"
+#include <gnunet/gnunet_util_lib.h>
+#include "anastasis_gtk_util.h"
+
+/**
+ * Default project data used for installation path detection
+ * for GNU Anastasis-Gtk.
+ */
+static const struct GNUNET_OS_ProjectData anastasis_gtk_pd = {
+ .libname = "libanastasisgtkutil",
+ .project_dirname = "anastasis-gtk",
+ .binary_name = "anastasis-gtk",
+ .env_varname = "ANASTASIS_GTK_PREFIX",
+ .base_config_varname = "ANASTASIS_GTK_BASE_CONFIG",
+ .bug_email = "anastasis@lists.gnu.org",
+ .homepage = "https://anastasis.lu/",
+ .config_file = "anastasis-gtk.conf",
+ .user_config_file = "~/.config/anastasis-gtk.conf",
+ .version = PACKAGE_VERSION,
+ .is_gnu = 1,
+ .gettext_domain = "anastasis-gtk",
+ .gettext_path = NULL,
+};
+
+
+const struct GNUNET_OS_ProjectData *
+ANASTASIS_GTK_project_data (void)
+{
+ return &anastasis_gtk_pd;
+}
+
+
+/* end of os_installation.c */