fix build with new libimobile device

This commit is contained in:
Peter Robinson 2012-04-12 09:34:04 +01:00
parent e363ca7048
commit 45abf5caba
2 changed files with 87 additions and 0 deletions

83
gvfs-libimobile.patch Normal file
View File

@ -0,0 +1,83 @@
From c9f840192312c23f7eea666f964e7eab4c2e680e Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gentoo.org>
Date: Mon, 02 Apr 2012 12:58:58 +0000
Subject: afc: Fix building against libimobiledevice-1.1.2
In 1.1.2, the struct idevice_event_t uuid field was renamed to udid.
Since libimobiledevice lacks a library version macro, we are forced
to check for the pkgconfig version in configure.
https://bugzilla.gnome.org/show_bug.cgi?id=672693
Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
---
diff --git a/configure.ac b/configure.ac
index e31fb50..081cc09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -327,6 +327,9 @@ if test "x$enable_afc" != "xno" ; then
if test "x$msg_afc" = "xyes"; then
PKG_CHECK_MODULES(AFC, libimobiledevice-1.0 libplist)
AC_DEFINE(HAVE_AFC, 1, [Define to 1 if AFC is going to be built])
+ PKG_CHECK_EXISTS(libimobiledevice-1.0 >= 1.1.2,
+ [AC_DEFINE(HAVE_LIBIMOBILEDEVICE_1_1_2, 1,
+ [Define to 1 if libimobiledevice-1.1.2 found])])
fi
fi
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index ab7094f..a62a197 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -339,11 +339,19 @@ static void
_idevice_event_cb (const idevice_event_t *event, void *user_data)
{
GVfsBackendAfc *afc_backend = G_VFS_BACKEND_AFC (user_data);
+ gchar *event_udid;
g_return_if_fail (afc_backend->uuid != NULL);
if (event->event != IDEVICE_DEVICE_REMOVE)
return;
- if (g_str_equal (event->uuid, afc_backend->uuid) == FALSE)
+
+#ifdef HAVE_LIBIMOBILEDEVICE_1_1_2
+ event_udid = event->udid;
+#else
+ event_udid = event->uuid;
+#endif
+
+ if (g_str_equal (event_udid, afc_backend->uuid) == FALSE)
return;
g_print ("Shutting down AFC backend for device uuid %s\n", afc_backend->uuid);
diff --git a/monitor/afc/afcvolumemonitor.c b/monitor/afc/afcvolumemonitor.c
index dfc3fa5..9f24753 100644
--- a/monitor/afc/afcvolumemonitor.c
+++ b/monitor/afc/afcvolumemonitor.c
@@ -83,15 +83,22 @@ static void
g_vfs_afc_monitor_idevice_event (const idevice_event_t *event, void *user_data)
{
GVfsAfcVolumeMonitor *self;
+ gchar *event_udid;
g_return_if_fail (event != NULL);
self = G_VFS_AFC_VOLUME_MONITOR(user_data);
+#ifdef HAVE_LIBIMOBILEDEVICE_1_1_2
+ event_udid = event->udid;
+#else
+ event_udid = event->uuid;
+#endif
+
if (event->event == IDEVICE_DEVICE_ADD)
- g_vfs_afc_monitor_create_volume (self, event->uuid);
+ g_vfs_afc_monitor_create_volume (self, event_udid);
else
- g_vfs_afc_monitor_remove_volume (self, event->uuid);
+ g_vfs_afc_monitor_remove_volume (self, event_udid);
}
static GObject *
--
cgit v0.9.0.2

View File

@ -5,6 +5,7 @@ Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
Source: http://download.gnome.org/sources/gvfs/1.12/gvfs-%{version}.tar.xz
BuildRequires: pkgconfig
BuildRequires: glib2-devel >= 2.31.0
@ -33,6 +34,8 @@ BuildRequires: libtool
# http://bugzilla.gnome.org/show_bug.cgi?id=567235
Patch0: gvfs-archive-integration.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=672693
Patch1: gvfs-libimobile.patch
Obsoletes: gnome-mount <= 0.8
Obsoletes: gnome-mount-nautilus-properties <= 0.8
@ -147,6 +150,7 @@ to applications using gvfs.
%prep
%setup -q
%patch0 -p1 -b .archive-integration
%patch1 -p1 -b .libimobile
%build