Switch to gmime 3.0

This commit is contained in:
Kalev Lember 2017-09-08 23:34:18 +02:00
parent 791fe2aeb3
commit c97ce33cc4
2 changed files with 6 additions and 79 deletions

View File

@ -1,69 +0,0 @@
From d7f41453d85fa5e0f4d1a8c81ceda49a99be5227 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 25 Aug 2017 11:29:10 +0200
Subject: [PATCH] Revert "Fix build with latest gmime3"
This reverts commit 4329dda2c53f9a7bd2a3f6dd9334d4eb5207e9fd.
---
configure.ac | 8 ++++++--
src/podcasts/grl-podcasts.c | 10 +++++-----
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 90c985c..aeba852 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,7 +164,11 @@ fi
PKG_CHECK_MODULES([JSON], [json-glib-1.0], HAVE_JSON_GLIB=yes, HAVE_JSON_GLIB=no)
-PKG_CHECK_MODULES(GMIME, [gmime-3.0], HAVE_GMIME=yes, HAVE_GMIME=no)
+PKG_CHECK_MODULES(GMIME, gmime-3.0,
+ HAVE_GMIME=yes,
+ [PKG_CHECK_MODULES(GMIME, gmime-2.6,
+ HAVE_GMIME=yes,
+ HAVE_GMIME=no)])
PKG_CHECK_MODULES(AVAHI, [avahi-gobject avahi-glib avahi-client], HAVE_AVAHI=yes, HAVE_AVAHI=no)
@@ -486,7 +490,7 @@ AC_ARG_ENABLE(podcasts,
AC_MSG_ERROR([sqlite3 not found, install it or use --disable-podcasts])
fi
if test "x$HAVE_GMIME" = "xno"; then
- AC_MSG_ERROR([gmime-3.0 not found, install it or use --disable-podcasts])
+ AC_MSG_ERROR([gmime-2.4 or gmime-2.6 not found, install it or use --disable-podcasts])
fi
;;
esac
diff --git a/src/podcasts/grl-podcasts.c b/src/podcasts/grl-podcasts.c
index 953e63a..14a0868 100644
--- a/src/podcasts/grl-podcasts.c
+++ b/src/podcasts/grl-podcasts.c
@@ -638,8 +638,10 @@ build_media (GrlMedia *content,
grl_media_set_id (media, url);
if (date) {
+ time_t t;
GDateTime *date_time;
- date_time = g_mime_utils_header_decode_date (date);
+ t = g_mime_utils_header_decode_date (date, NULL);
+ date_time = g_date_time_new_from_unix_utc (t);
grl_media_set_publication_date (media, date_time);
g_date_time_unref (date_time);
}
@@ -1275,10 +1277,8 @@ parse_feed (OperationSpec *os, const gchar *str, GError **error)
/* Check podcast pubDate (if available), if it has not been updated
recently then we can use the cache and avoid parsing the feed */
if (podcast_data->published != NULL) {
- GDateTime *date_time =
- g_mime_utils_header_decode_date (podcast_data->published);
- gint64 pub_time = g_date_time_to_unix (date_time);
- g_date_time_unref (date_time);
+ time_t pub_time =
+ g_mime_utils_header_decode_date (podcast_data->published, NULL);
if (pub_time == 0) {
GRL_DEBUG ("Invalid podcast pubDate: '%s'", podcast_data->published);
/* We will parse the feed again just in case */
--
2.13.5

View File

@ -6,16 +6,13 @@
Name: grilo-plugins
Version: 0.3.5
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Plugins for the Grilo framework
License: LGPLv2+
URL: https://wiki.gnome.org/Projects/Grilo
Source0: https://download.gnome.org/sources/grilo-plugins/%{release_version}/grilo-plugins-%{version}.tar.xz
# Until gmime 3.0 is in Fedora
Patch0: 0001-Revert-Fix-build-with-latest-gmime3.patch
BuildRequires: avahi-gobject-devel
BuildRequires: grilo-devel >= %{grilo_version}
BuildRequires: glib2-devel
@ -38,12 +35,10 @@ BuildRequires: libgdata-devel
BuildRequires: totem-pl-parser-devel
BuildRequires: tracker-devel
%if 0%{?fedora}
BuildRequires: gmime-devel
BuildRequires: gmime30-devel
%endif
BuildRequires: libdmapsharing-devel
BuildRequires: json-glib-devel
BuildRequires: autoconf automake libtool autoconf-archive gnome-common
BuildRequires: git-core
Requires: dleyna-server
Requires: gnome-online-accounts%{_isa} >= %{goa_version}
@ -75,8 +70,7 @@ This package contains plugins to get information from theses sources:
- Youtube
%prep
%autosetup -S git
autoreconf -f -i
%autosetup -p1
%build
%configure \
@ -108,7 +102,6 @@ sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
make %{?_smp_mflags}
%install
%make_install
@ -128,6 +121,9 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/*
%{_libdir}/grilo-%{release_version}/*.so*
%changelog
* Fri Sep 08 2017 Kalev Lember <klember@redhat.com> - 0.3.5-2
- Switch to gmime 3.0
* Fri Aug 25 2017 Bastien Nocera <bnocera@redhat.com> - 0.3.5-1
+ grilo-plugins-0.3.5-1
- Update to 0.3.5