1 |
tetromino 12/04/02 07:34:47 |
2 |
|
3 |
Added: gvfs-1.10.1-libimobiledevice-1.1.2.patch |
4 |
Log: |
5 |
Fix building against >=libimobiledevice-1.1.2 (bug #410411, thanks to Leo Laursen for reporting). |
6 |
|
7 |
(Portage version: 2.2.0_alpha98/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 gnome-base/gvfs/files/gvfs-1.10.1-libimobiledevice-1.1.2.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gvfs/files/gvfs-1.10.1-libimobiledevice-1.1.2.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gvfs/files/gvfs-1.10.1-libimobiledevice-1.1.2.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: gvfs-1.10.1-libimobiledevice-1.1.2.patch |
16 |
=================================================================== |
17 |
From 9668b2601e43a7a32471383c63cd3839aa721c51 Mon Sep 17 00:00:00 2001 |
18 |
From: Alexandre Rostovtsev <tetromino@g.o> |
19 |
Date: Mon, 2 Apr 2012 03:15:30 -0400 |
20 |
Subject: [PATCH] afc: Fix building against libimobiledevice-1.1.2 |
21 |
|
22 |
In 1.1.2, the struct idevice_event_t uuid field was renamed to udid. |
23 |
Since libimobiledevice lacks a library version macro, we are forced |
24 |
to check for the pkgconfig version in configure. |
25 |
--- |
26 |
configure.ac | 3 +++ |
27 |
daemon/gvfsbackendafc.c | 10 +++++++++- |
28 |
monitor/afc/afcvolumemonitor.c | 11 +++++++++-- |
29 |
3 files changed, 21 insertions(+), 3 deletions(-) |
30 |
|
31 |
diff --git a/configure.ac b/configure.ac |
32 |
index e31fb50..081cc09 100644 |
33 |
--- a/configure.ac |
34 |
+++ b/configure.ac |
35 |
@@ -327,6 +327,9 @@ if test "x$enable_afc" != "xno" ; then |
36 |
if test "x$msg_afc" = "xyes"; then |
37 |
PKG_CHECK_MODULES(AFC, libimobiledevice-1.0 libplist) |
38 |
AC_DEFINE(HAVE_AFC, 1, [Define to 1 if AFC is going to be built]) |
39 |
+ PKG_CHECK_EXISTS(libimobiledevice-1.0 >= 1.1.2, |
40 |
+ [AC_DEFINE(HAVE_LIBIMOBILEDEVICE_1_1_2, 1, |
41 |
+ [Define to 1 if libimobiledevice-1.1.2 found])]) |
42 |
fi |
43 |
fi |
44 |
|
45 |
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c |
46 |
index ab7094f..a62a197 100644 |
47 |
--- a/daemon/gvfsbackendafc.c |
48 |
+++ b/daemon/gvfsbackendafc.c |
49 |
@@ -339,11 +339,19 @@ static void |
50 |
_idevice_event_cb (const idevice_event_t *event, void *user_data) |
51 |
{ |
52 |
GVfsBackendAfc *afc_backend = G_VFS_BACKEND_AFC (user_data); |
53 |
+ gchar *event_udid; |
54 |
|
55 |
g_return_if_fail (afc_backend->uuid != NULL); |
56 |
if (event->event != IDEVICE_DEVICE_REMOVE) |
57 |
return; |
58 |
- if (g_str_equal (event->uuid, afc_backend->uuid) == FALSE) |
59 |
+ |
60 |
+#ifdef HAVE_LIBIMOBILEDEVICE_1_1_2 |
61 |
+ event_udid = event->udid; |
62 |
+#else |
63 |
+ event_udid = event->uuid; |
64 |
+#endif |
65 |
+ |
66 |
+ if (g_str_equal (event_udid, afc_backend->uuid) == FALSE) |
67 |
return; |
68 |
|
69 |
g_print ("Shutting down AFC backend for device uuid %s\n", afc_backend->uuid); |
70 |
diff --git a/monitor/afc/afcvolumemonitor.c b/monitor/afc/afcvolumemonitor.c |
71 |
index dfc3fa5..9f24753 100644 |
72 |
--- a/monitor/afc/afcvolumemonitor.c |
73 |
+++ b/monitor/afc/afcvolumemonitor.c |
74 |
@@ -83,15 +83,22 @@ static void |
75 |
g_vfs_afc_monitor_idevice_event (const idevice_event_t *event, void *user_data) |
76 |
{ |
77 |
GVfsAfcVolumeMonitor *self; |
78 |
+ gchar *event_udid; |
79 |
|
80 |
g_return_if_fail (event != NULL); |
81 |
|
82 |
self = G_VFS_AFC_VOLUME_MONITOR(user_data); |
83 |
|
84 |
+#ifdef HAVE_LIBIMOBILEDEVICE_1_1_2 |
85 |
+ event_udid = event->udid; |
86 |
+#else |
87 |
+ event_udid = event->uuid; |
88 |
+#endif |
89 |
+ |
90 |
if (event->event == IDEVICE_DEVICE_ADD) |
91 |
- g_vfs_afc_monitor_create_volume (self, event->uuid); |
92 |
+ g_vfs_afc_monitor_create_volume (self, event_udid); |
93 |
else |
94 |
- g_vfs_afc_monitor_remove_volume (self, event->uuid); |
95 |
+ g_vfs_afc_monitor_remove_volume (self, event_udid); |
96 |
} |
97 |
|
98 |
static GObject * |
99 |
-- |
100 |
1.7.8.5 |