diff options
author | Derek Straka <derek@asterius.io> | 2016-05-06 13:29:26 -0400 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-05-10 20:18:56 +0200 |
commit | aebbd94f75f63c25e7068b665f4354c79507638a (patch) | |
tree | 54510b374253642788da56901f379894264ff172 /meta-gnome | |
parent | 1bc1405b0a3f477d656ce736804fed87ce016296 (diff) | |
download | meta-openembedded-aebbd94f75f63c25e7068b665f4354c79507638a.tar.gz |
tracker: add a patch to support giflib 5
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-gnome')
-rw-r--r-- | meta-gnome/recipes-support/tracker/tracker-0.14.2/giflib5-support.patch | 126 | ||||
-rw-r--r-- | meta-gnome/recipes-support/tracker/tracker_0.14.2.bb | 3 |
2 files changed, 128 insertions, 1 deletions
diff --git a/meta-gnome/recipes-support/tracker/tracker-0.14.2/giflib5-support.patch b/meta-gnome/recipes-support/tracker/tracker-0.14.2/giflib5-support.patch new file mode 100644 index 000000000..fab3371f0 --- /dev/null +++ b/meta-gnome/recipes-support/tracker/tracker-0.14.2/giflib5-support.patch | |||
@@ -0,0 +1,126 @@ | |||
1 | src/tracker-extract/tracker-extract-gif.c | 36 +++++++++++++++++++++++++++++ | ||
2 | 1 file changed, 36 insertions(+) | ||
3 | --- a/src/tracker-extract/tracker-extract-gif.c | ||
4 | +++ a/src/tracker-extract/tracker-extract-gif.c | ||
5 | @@ -75,6 +75,39 @@ | ||
6 | return (GIF_OK); | ||
7 | } | ||
8 | |||
9 | +#if GIFLIB_MAJOR >= 5 | ||
10 | +static inline void | ||
11 | +gif_error (const gchar *action, int err) | ||
12 | +{ | ||
13 | + const char *str = GifErrorString (err); | ||
14 | + if (str != NULL) { | ||
15 | + g_message ("%s, error: '%s'", action, str); | ||
16 | + } else { | ||
17 | + g_message ("%s, undefined error %d", action, err); | ||
18 | + } | ||
19 | +} | ||
20 | +#else /* GIFLIB_MAJOR >= 5 */ | ||
21 | +static inline void print_gif_error() | ||
22 | +{ | ||
23 | +#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) | ||
24 | + const char *str = GifErrorString (); | ||
25 | + if (str != NULL) { | ||
26 | + g_message ("GIF, error: '%s'", str); | ||
27 | + } else { | ||
28 | + g_message ("GIF, undefined error"); | ||
29 | + } | ||
30 | +#else | ||
31 | + PrintGifError(); | ||
32 | +#endif | ||
33 | +} | ||
34 | +#endif /* GIFLIB_MAJOR >= 5 */ | ||
35 | + | ||
36 | +/* giflib 5.1 changed the API of DGifCloseFile to take two arguments */ | ||
37 | +#if !defined(GIFLIB_MAJOR) || \ | ||
38 | + !(GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)) | ||
39 | +#define DGifCloseFile(a, b) DGifCloseFile(a) | ||
40 | +#endif | ||
41 | + | ||
42 | static void | ||
43 | read_metadata (TrackerSparqlBuilder *preupdate, | ||
44 | TrackerSparqlBuilder *metadata, | ||
45 | @@ -100,14 +133,22 @@ | ||
46 | ExtBlock extBlock; | ||
47 | |||
48 | if (DGifGetRecordType(gifFile, &RecordType) == GIF_ERROR) { | ||
49 | - PrintGifError(); | ||
50 | +#if GIFLIB_MAJOR < 5 | ||
51 | + print_gif_error (); | ||
52 | +#else /* GIFLIB_MAJOR < 5 */ | ||
53 | + gif_error ("Could not read next GIF record type", gifFile->Error); | ||
54 | +#endif /* GIFLIB_MAJOR < 5 */ | ||
55 | return; | ||
56 | } | ||
57 | |||
58 | switch (RecordType) { | ||
59 | case IMAGE_DESC_RECORD_TYPE: | ||
60 | if (DGifGetImageDesc(gifFile) == GIF_ERROR) { | ||
61 | - PrintGifError(); | ||
62 | +#if GIFLIB_MAJOR < 5 | ||
63 | + print_gif_error(); | ||
64 | +#else /* GIFLIB_MAJOR < 5 */ | ||
65 | + gif_error ("Could not get GIF record information", gifFile->Error); | ||
66 | +#endif /* GIFLIB_MAJOR < 5 */ | ||
67 | return; | ||
68 | } | ||
69 | |||
70 | @@ -117,7 +158,11 @@ | ||
71 | framedata = g_malloc (framewidth*frameheight); | ||
72 | |||
73 | if (DGifGetLine(gifFile, framedata, framewidth*frameheight)==GIF_ERROR) { | ||
74 | - PrintGifError(); | ||
75 | +#if GIFLIB_MAJOR < 5 | ||
76 | + print_gif_error(); | ||
77 | +#else /* GIFLIB_MAJOR < 5 */ | ||
78 | + gif_error ("Could not load a block of GIF pixes", gifFile->Error); | ||
79 | +#endif /* GIFLIB_MAJOR < 5 */ | ||
80 | return; | ||
81 | } | ||
82 | |||
83 | @@ -593,6 +638,9 @@ | ||
84 | gchar *filename, *uri; | ||
85 | GFile *file; | ||
86 | int fd; | ||
87 | +#if GIFLIB_MAJOR >= 5 | ||
88 | + int err; | ||
89 | +#endif | ||
90 | |||
91 | preupdate = tracker_extract_info_get_preupdate_builder (info); | ||
92 | metadata = tracker_extract_info_get_metadata_builder (info); | ||
93 | @@ -617,8 +665,14 @@ | ||
94 | return FALSE; | ||
95 | } | ||
96 | |||
97 | +#if GIFLIB_MAJOR < 5 | ||
98 | if ((gifFile = DGifOpenFileHandle (fd)) == NULL) { | ||
99 | - PrintGifError (); | ||
100 | + print_gif_error (); | ||
101 | +#else /* GIFLIB_MAJOR < 5 */ | ||
102 | + if ((gifFile = DGifOpenFileHandle (fd, &err)) == NULL) { | ||
103 | + gif_error ("Could not open GIF file with handle", err); | ||
104 | +#endif /* GIFLIB_MAJOR < 5 */ | ||
105 | + g_free (filename); | ||
106 | close (fd); | ||
107 | return FALSE; | ||
108 | } | ||
109 | @@ -637,10 +691,15 @@ | ||
110 | g_string_free (where, TRUE); | ||
111 | |||
112 | g_free (uri); | ||
113 | - | ||
114 | +#if GIFLIB_MAJOR < 5 | ||
115 | if (DGifCloseFile (gifFile) != GIF_OK) { | ||
116 | - PrintGifError (); | ||
117 | + print_gif_error (); | ||
118 | + } | ||
119 | +#else /* GIFLIB_MAJOR < 5 */ | ||
120 | + if (DGifCloseFile (gifFile, NULL) != GIF_OK) { | ||
121 | + gif_error ("Could not close GIF file", gifFile->Error); | ||
122 | } | ||
123 | +#endif /* GIFLIB_MAJOR < 5 */ | ||
124 | |||
125 | return TRUE; | ||
126 | } | ||
diff --git a/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb b/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb index c52d95e97..fa7fcd557 100644 --- a/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb +++ b/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb | |||
@@ -13,7 +13,8 @@ inherit autotools pkgconfig gnomebase gettext gsettings systemd gobject-introspe | |||
13 | VER_DIR = "${@gnome_verdir("${PV}")}" | 13 | VER_DIR = "${@gnome_verdir("${PV}")}" |
14 | SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/tracker/${VER_DIR}/tracker-${PV}.tar.xz \ | 14 | SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/tracker/${VER_DIR}/tracker-${PV}.tar.xz \ |
15 | file://enable-sqlite-crosscompile.patch \ | 15 | file://enable-sqlite-crosscompile.patch \ |
16 | file://fix-removable-media-detection.patch \ | 16 | file://fix-removable-media-detection.patch \ |
17 | file://giflib5-support.patch \ | ||
17 | file://90tracker \ | 18 | file://90tracker \ |
18 | file://tracker-store.service \ | 19 | file://tracker-store.service \ |
19 | file://tracker-miner-fs.service \ | 20 | file://tracker-miner-fs.service \ |