Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Milan Crha
0cc80d9220 Resolves: #1705678 (Remove Evolution runtime dependency)
Also added upstream patch for a possible build break
and fixed two bogus dates in the changelog part.
2019-05-03 09:33:32 +02:00
3 changed files with 445 additions and 5 deletions

240
almanah-build-break.patch Normal file
View file

@ -0,0 +1,240 @@
From 06dc5b67203730e1dc8a9362dc74c5d72de577b0 Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip@tecnocode.co.uk>
Date: Mon, 12 Dec 2016 14:54:49 +0000
Subject: [PATCH] build: Update glib-mkenums build rules
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Update the build rules to:
• Atomically replace the target files to avoid race conditions while
building.
• Not distribute the generated files, as they are generated.
• Use template files instead of putting C and escaped newlines in
Makefile.am in some grotesque display of nesting.
• Rename from event-factory-builtins.[ch] to enums.[ch] to more
accurately reflect what they contain.
This might fix https://bugzilla.redhat.com/show_bug.cgi?id=1403508.
diff -up almanah-0.11.1/src/enums.c.template.build-break almanah-0.11.1/src/enums.c.template
--- almanah-0.11.1/src/enums.c.template.build-break 2019-05-03 08:57:58.860406374 +0200
+++ almanah-0.11.1/src/enums.c.template 2019-05-03 08:57:58.860406374 +0200
@@ -0,0 +1,56 @@
+/*** BEGIN file-header ***/
+/* vim:set et sw=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e2s: */
+/*
+ * Almanah
+ * Copyright © Philip Withnall 2016 <philip@tecnocode.co.uk>
+ *
+ * Almanah 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 of the License, or
+ * (at your option) any later version.
+ *
+ * Almanah 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 Almanah. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "event-factory.h"
+#include "enums.h"
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+
+ if (g_once_init_enter (&g_define_type_id__volatile))
+ {
+ static const G@Type@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id =
+ g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+
+ return g_define_type_id__volatile;
+}
+
+/*** END value-tail ***/
diff -up almanah-0.11.1/src/enums.h.template.build-break almanah-0.11.1/src/enums.h.template
--- almanah-0.11.1/src/enums.h.template.build-break 2019-05-03 08:57:58.860406374 +0200
+++ almanah-0.11.1/src/enums.h.template 2019-05-03 08:57:58.860406374 +0200
@@ -0,0 +1,43 @@
+/*** BEGIN file-header ***/
+/* vim:set et sw=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e2s: */
+/*
+ * Almanah
+ * Copyright © Philip Withnall 2016 <philip@tecnocode.co.uk>
+ *
+ * Almanah 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 of the License, or
+ * (at your option) any later version.
+ *
+ * Almanah 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 Almanah. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ALMANAH_ENUMS_H
+#define ALMANAH_ENUMS_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif
+/*** END file-tail ***/
diff -up almanah-0.11.1/src/event-factory.c.build-break almanah-0.11.1/src/event-factory.c
--- almanah-0.11.1/src/event-factory.c.build-break 2014-09-24 19:24:12.000000000 +0200
+++ almanah-0.11.1/src/event-factory.c 2019-05-03 08:57:58.860406374 +0200
@@ -20,7 +20,7 @@
#include <glib.h>
#include "event-factory.h"
-#include "event-factory-builtins.h"
+#include "enums.h"
static void almanah_event_factory_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
diff -up almanah-0.11.1/src/event-manager.c.build-break almanah-0.11.1/src/event-manager.c
--- almanah-0.11.1/src/event-manager.c.build-break 2014-09-24 19:24:12.000000000 +0200
+++ almanah-0.11.1/src/event-manager.c 2019-05-03 08:57:58.861406374 +0200
@@ -21,7 +21,7 @@
#include "event-manager.h"
#include "event-factory.h"
-#include "event-factory-builtins.h"
+#include "enums.h"
typedef struct {
AlmanahEventFactoryType type_id;
diff -up almanah-0.11.1/src/Makefile.am.build-break almanah-0.11.1/src/Makefile.am
--- almanah-0.11.1/src/Makefile.am.build-break 2014-09-24 19:33:27.000000000 +0200
+++ almanah-0.11.1/src/Makefile.am 2019-05-03 08:58:25.483406005 +0200
@@ -1,8 +1,11 @@
bin_PROGRAMS = almanah
+BUILT_SOURCES =
+EXTRA_DIST =
+CLEANFILES =
+
almanah_SOURCES = \
$(ALMANAH_MARSHAL_FILES) \
- $(ALMANAH_ENUM_FILES) \
main.c \
application.c \
application.h \
@@ -80,6 +83,11 @@ almanah_SOURCES += \
preferences-dialog.h
endif
+nodist_almanah_SOURCES = \
+ $(almanah_enum_header_file) \
+ $(almanah_enum_source_file) \
+ $(NULL)
+
almanah_CPPFLAGS = \
-DPACKAGE_LOCALE_DIR=\""$(datadir)/locale"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
@@ -114,31 +122,36 @@ almanah-marshal.c: almanah-marshal.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=almanah_marshal --header --body $< > $@
# Enums
-ALMANAH_ENUM_FILES = \
- event-factory-builtins.h \
- event-factory-builtins.c
-
-event-factory-builtins.h: event-factory.h Makefile
- $(AM_V_GEN)(cd $(srcdir) && $(GLIB_MKENUMS) \
- --fhead "#ifndef __ALMANAH_EVENT_FACTORY_BUILTINS_H__\n#define __ALMANAH_EVENT_FACTORY_BUILTINS_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
- --fprod "/* enumerations from \"@filename@\" */\n" \
- --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define ALMANAH_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
- --ftail "G_END_DECLS\n\n#endif /* __ALMANAH_EVENT_FACTORY_BUILTINS_H__ */" \
- event-factory.h) > $(@F)
-
-event-factory-builtins.c: event-factory.h Makefile event-factory-builtins.h
- $(AM_V_GEN)(cd $(srcdir) && $(GLIB_MKENUMS) \
- --fhead "#include \"event-factory.h\"\n#include \"event-factory-builtins.h\"" \
- --fprod "\n/* enumerations from \"@filename@\" */" \
- --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
- --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
- --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
- event-factory.h) > $(@F)
-
-CLEANFILES = \
- $(ALMANAH_MARSHAL_FILES) \
- $(ALMANAH_ENUM_FILES)
+almanah_enum_header_file = enums.h
+almanah_enum_source_file = enums.c
+almanah_enum_prerequisites = event-factory.h
+
+$(almanah_enum_header_file): $(almanah_enum_header_file:%=%.template) $(almanah_enum_prerequisites)
+ $(AM_V_GEN)$(GLIB_MKENUMS) --template $< \
+ $(patsubst %,$(srcdir)/%,$(almanah_enum_prerequisites)) \
+ > $@.tmp && mv $@.tmp $@
+
+$(almanah_enum_source_file): $(almanah_enum_source_file:%=%.template) $(almanah_enum_prerequisites)
+ $(AM_V_GEN)$(GLIB_MKENUMS) --template $< \
+ $(patsubst %,$(srcdir)/%,$(almanah_enum_prerequisites)) \
+ > $@.tmp && mv $@.tmp $@
+
+EXTRA_DIST += \
+ $(almanah_enum_header_file:%=%.template) \
+ $(almanah_enum_source_file:%=%.template) \
+ $(NULL)
+BUILT_SOURCES += \
+ $(almanah_enum_header_file) \
+ $(almanah_enum_source_file) \
+ $(NULL)
+CLEANFILES += \
+ $(almanah_enum_header_file) \
+ $(almanah_enum_source_file) \
+ $(NULL)
+
+CLEANFILES += \
+ $(ALMANAH_MARSHAL_FILES)
-EXTRA_DIST = almanah-marshal.list
+EXTRA_DIST += almanah-marshal.list
-include $(top_srcdir)/git.mk

View file

@ -0,0 +1,185 @@
From 54ccb8255eaf136a853acef4666b561a561654f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Pe=C3=B1a?= <alvaropg@gmail.com>
Date: Mon, 9 Nov 2015 11:27:26 +0100
Subject: [PATCH] events: Removed Evolution runtime dependency
We have a runtime dependecy in Almanah because we check for the
org.gnome.evolution.calendar settings to read the timezone, so just use
the EDS e_cal_util_get_system_timezone_location and watch for changes
in /etc/timezone
https://bugzilla.gnome.org/show_bug.cgi?id=745497
---
configure.ac | 3 +-
src/event-factories/calendar-client.c | 71 ++++++++++-----------------
2 files changed, 29 insertions(+), 45 deletions(-)
diff --git a/configure.ac b/configure.ac
index 243dfb9..88df7f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,7 +124,8 @@ AC_SUBST(STANDARD_CFLAGS)
AC_SUBST(STANDARD_LIBS)
dnl Evolution
-PKG_CHECK_MODULES(EVO, libecal-1.2 >= 3.5.91 libedataserver-1.2, have_evo=yes, have_evo=no)
+EDS_MIN_VERSION=2.28
+PKG_CHECK_MODULES(EVO, libecal-1.2 >= 3.5.91 libedataserver-1.2 >= $EDS_MIN_VERSION, have_evo=yes, have_evo=no)
if test "x$have_evo" = "xyes"; then
AC_DEFINE(HAVE_EVO, 1, [Defined if libecal-1.2 is installed])
fi
diff --git a/src/event-factories/calendar-client.c b/src/event-factories/calendar-client.c
index 7cd6187..c529dbe 100644
--- a/src/event-factories/calendar-client.c
+++ b/src/event-factories/calendar-client.c
@@ -1,5 +1,7 @@
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2-*- */
/*
* Copyright (C) 2004 Free Software Foundation, Inc.
+ * Copyright (C) 2015 Álvaro Peña <alvaropg@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -19,6 +21,9 @@
* William Jon McCann <mccann@jhu.edu>
* Martin Grimme <martin@pycage.de>
* Christian Kellner <gicmo@xatom.net>
+ *
+ * Modified by:
+ * Álvaro Peña <alvaropg@gmail.com>
*/
#include <config.h>
@@ -77,8 +82,7 @@ struct _CalendarClientPrivate
icaltimezone *zone;
- guint zone_listener;
- GSettings *settings;
+ GFileMonitor *tz_monitor;
guint day;
guint month;
@@ -225,45 +229,29 @@ calendar_client_class_init (CalendarClientClass *klass)
0);
}
-/* Timezone code adapted from evolution/calendar/gui/calendar-config.c */
-/* The current timezone, e.g. "Europe/London". It may be NULL, in which case
- you should assume UTC. */
-static gchar *
-calendar_client_config_get_timezone (GSettings *settings)
-{
- char *location;
-
- if (g_settings_get_boolean (settings, "use-system-timezone"))
- location = e_cal_util_get_system_timezone_location ();
- else
- location = g_settings_get_string (settings, "timezone");
-
- return location;
-}
-
static icaltimezone *
-calendar_client_config_get_icaltimezone (GSettings *settings)
+calendar_client_config_get_icaltimezone (void)
{
char *location;
icaltimezone *zone = NULL;
-
- location = calendar_client_config_get_timezone (settings);
+
+ location = e_cal_util_get_system_timezone_location ();
if (!location)
return icaltimezone_get_utc_timezone ();
zone = icaltimezone_get_builtin_timezone (location);
g_free (location);
-
+
return zone;
}
static void
-calendar_client_set_timezone (CalendarClient *client)
+calendar_client_set_timezone (CalendarClient *client)
{
GSList *l;
GSList *esources;
- client->priv->zone = calendar_client_config_get_icaltimezone (client->priv->settings);
+ client->priv->zone = calendar_client_config_get_icaltimezone ();
esources = calendar_sources_get_appointment_sources (client->priv->calendar_sources);
for (l = esources; l; l = l->next) {
@@ -274,13 +262,13 @@ calendar_client_set_timezone (CalendarClient *client)
}
static void
-calendar_client_timezone_changed_cb (GSettings *settings,
- const gchar *key,
- CalendarClient *client)
+calendar_client_timezone_changed_cb (G_GNUC_UNUSED GFileMonitor *monitor,
+ G_GNUC_UNUSED GFile *file,
+ G_GNUC_UNUSED GFile *other_file,
+ G_GNUC_UNUSED GFileMonitorEvent *event,
+ gpointer user_data)
{
- if (g_strcmp0 (key, "timezone") == 0 ||
- g_strcmp0 (key, "use-system-timezone") == 0)
- calendar_client_set_timezone (client);
+ calendar_client_set_timezone (CALENDAR_CLIENT (user_data));
}
static void
@@ -365,11 +353,11 @@ static void
calendar_client_init (CalendarClient *client)
{
GSList *esources;
+ GFile *tz;
client->priv = CALENDAR_CLIENT_GET_PRIVATE (client);
client->priv->calendar_sources = calendar_sources_get ();
- client->priv->settings = g_settings_new ("org.gnome.evolution.calendar");
esources = calendar_sources_get_appointment_sources (client->priv->calendar_sources);
client->priv->appointment_sources =
@@ -393,9 +381,13 @@ calendar_client_init (CalendarClient *client)
G_CALLBACK (calendar_client_task_sources_changed),
client);
- client->priv->zone_listener = g_signal_connect (client->priv->settings, "changed",
- G_CALLBACK (calendar_client_timezone_changed_cb),
- client);
+ tz = g_file_new_for_path ("/etc/localtime");
+ client->priv->tz_monitor = g_file_monitor_file (tz, G_FILE_MONITOR_NONE, NULL, NULL);
+ g_object_unref (tz);
+ if (client->priv->tz_monitor == NULL)
+ g_warning ("Can't monitor /etc/localtime for changes");
+ else
+ g_signal_connect (client->priv->tz_monitor, "changed", G_CALLBACK (calendar_client_timezone_changed_cb), client);
client->priv->day = G_MAXUINT;
client->priv->month = G_MAXUINT;
@@ -408,16 +400,7 @@ calendar_client_finalize (GObject *object)
CalendarClient *client = CALENDAR_CLIENT (object);
GSList *l;
- if (client->priv->zone_listener)
- {
- g_signal_handler_disconnect (client->priv->settings,
- client->priv->zone_listener);
- client->priv->zone_listener = 0;
- }
-
- if (client->priv->settings)
- g_object_unref (client->priv->settings);
- client->priv->settings = NULL;
+ g_clear_object (&client->priv->tz_monitor);
for (l = client->priv->appointment_sources; l; l = l->next)
{
--
2.18.1

View file

@ -3,11 +3,15 @@
Name: almanah
Version: 0.11.1
Release: 23%{?dist}
Release: 24%{?dist}
Summary: Application for keeping an encrypted diary
License: GPLv3+
URL: http://tecnocode.co.uk/projects/almanah/
Source0: http://ftp.gnome.org/pub/GNOME/sources/almanah/%{majorVersion}/%{name}-%{version}.tar.xz
Patch01: almanah-build-break.patch
Patch02: almanah-remove-evo-runtime-dep.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: gettext
BuildRequires: gpgme-devel
@ -18,7 +22,9 @@ BuildRequires: gtk3-devel
BuildRequires: gtkspell-devel
%endif
BuildRequires: intltool
BuildRequires: libtool
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib-devel
BuildRequires: pkgconfig(libecal-1.2)
BuildRequires: pkgconfig(libedataserver-1.2)
%if 0%{fedora} <= 15
@ -37,12 +43,18 @@ diary entries using multiple events.
%prep
%setup -q
%patch01 -p1 -b .build-break
%patch02 -p1 -b .remove-evo-runtime-dep
sed -e 's/_//' \
-e 's/=Diary/=Almanah/' \
-i data/%{name}.desktop.in
%build
CFLAGS="${RPM_OPT_FLAGS} -D_FILE_OFFSET_BITS=64" %configure --enable-encryption \
autoreconf -fi
libtoolize
intltoolize --force
CFLAGS="${RPM_OPT_FLAGS} -D_FILE_OFFSET_BITS=64 -Wno-deprecated-declarations" %configure --enable-encryption \
%if 0%{?spellchecking}
--enable-spell-checking
%else
@ -70,11 +82,14 @@ fi
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/hicolor/*/actions/%{name}*.svg
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/GConf/gsettings/%{name}.convert
%{_datadir}/glib-2.0/schemas/org.gnome.%{name}.gschema.xml
%changelog
* Fri May 03 2019 Milan Crha <mcrha@redhat.com> - 0.11.1-24
- Add patch for RH bug #1705678 (Remove Evolution runtime dependency)
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
@ -222,13 +237,13 @@ fi
* Mon Oct 4 2010 Bill Nottingham <notting@redhat.com> - 0.7.3-4
- Release bump and build to fix libedataserver broken dep
* Mon Jun 26 2010 Caolán McNamara <caolanm@redhat.com> - 0.7.3-3
* Sat Jun 26 2010 Caolán McNamara <caolanm@redhat.com> - 0.7.3-3
- Release bump and build to fix libedataserver broken dep
* Fri Jun 11 2010 Mike McGrath <mmcgrath@redhat.com> - 0.7.3-2
- Release bump and build to fix libedataserver broken dep
* Sun May 22 2010 Andreas Osowski <th0br0@mkdir.name> - 0.7.3-1
* Sat May 22 2010 Andreas Osowski <th0br0@mkdir.name> - 0.7.3-1
- Update to 0.7.3
- Improved the UI appearance a little by adding some padding
- Updated translations