From 5e6ea79de66c12041a70f56f96118c380eeb5d71 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 25 Aug 2017 11:56:07 +0200 Subject: [PATCH] Fix build with gmime 2.6 We don't have GMime 3.0 in Fedora just yet. --- ...-Revert-Fix-build-with-latest-gmime3.patch | 69 +++++++++++++++++++ grilo-plugins.spec | 7 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 0001-Revert-Fix-build-with-latest-gmime3.patch diff --git a/0001-Revert-Fix-build-with-latest-gmime3.patch b/0001-Revert-Fix-build-with-latest-gmime3.patch new file mode 100644 index 0000000..15ba3c6 --- /dev/null +++ b/0001-Revert-Fix-build-with-latest-gmime3.patch @@ -0,0 +1,69 @@ +From d7f41453d85fa5e0f4d1a8c81ceda49a99be5227 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +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 + diff --git a/grilo-plugins.spec b/grilo-plugins.spec index a1d8a67..bd5cfd2 100644 --- a/grilo-plugins.spec +++ b/grilo-plugins.spec @@ -13,6 +13,9 @@ 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 @@ -39,6 +42,7 @@ BuildRequires: gmime-devel %endif BuildRequires: libdmapsharing-devel BuildRequires: json-glib-devel +BuildRequires: autoconf automake libtool autoconf-archive Requires: dleyna-server Requires: gnome-online-accounts%{_isa} >= %{goa_version} @@ -70,7 +74,8 @@ This package contains plugins to get information from theses sources: - Youtube %prep -%setup -q +%autosetup -S git +autoreconf -f -i %build %configure \