diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-04-05 13:39:56 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-04-06 09:02:12 -0700 |
commit | c6f3bec2e9768d9231cc042a9902570610a05ffb (patch) | |
tree | 31fc196a874465bcb057d81ad9b38e72337aac61 /meta-oe/recipes-support/poppler | |
parent | 6f2099cf7806a7d00cdd3b4cda74e9e5574d0479 (diff) | |
download | meta-openembedded-c6f3bec2e9768d9231cc042a9902570610a05ffb.tar.gz |
poppler: Backport patches to fix build with glib-2.0 2.68+ and GCC11
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/poppler')
3 files changed, 277 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/poppler/poppler/0001-glib-Use-stock-glib-macro-to-define-boxed-type.patch b/meta-oe/recipes-support/poppler/poppler/0001-glib-Use-stock-glib-macro-to-define-boxed-type.patch new file mode 100644 index 000000000..89de98c0c --- /dev/null +++ b/meta-oe/recipes-support/poppler/poppler/0001-glib-Use-stock-glib-macro-to-define-boxed-type.patch | |||
@@ -0,0 +1,228 @@ | |||
1 | From 17b25e3122685d8277fe70fb6d27ab1eaf15b3e7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Christian Persch <chpe@src.gnome.org> | ||
3 | Date: Fri, 26 Mar 2021 18:17:25 +0100 | ||
4 | Subject: [PATCH 1/2] glib: Use stock glib macro to define boxed type | ||
5 | |||
6 | Upstream-Staus: Backport [https://github.com/freedesktop/poppler/commit/47de887d7658cfd68df44b3acf710971054f957b] | ||
7 | Poppler already depends on a sufficiently new glib version, so we can | ||
8 | simply use G_DEFINE_BOXED_TYPE instead of defining our own macro. | ||
9 | --- | ||
10 | glib/poppler-action.cc | 4 ++-- | ||
11 | glib/poppler-annot.cc | 2 +- | ||
12 | glib/poppler-document.cc | 6 +++--- | ||
13 | glib/poppler-page.cc | 20 ++++++++++---------- | ||
14 | glib/poppler-private.h | 15 --------------- | ||
15 | glib/poppler-structure-element.cc | 4 ++-- | ||
16 | 6 files changed, 18 insertions(+), 33 deletions(-) | ||
17 | |||
18 | diff --git a/glib/poppler-action.cc b/glib/poppler-action.cc | ||
19 | index d395db7..b772a3c 100644 | ||
20 | --- a/glib/poppler-action.cc | ||
21 | +++ b/glib/poppler-action.cc | ||
22 | @@ -25,7 +25,7 @@ | ||
23 | * @title: PopplerAction | ||
24 | */ | ||
25 | |||
26 | -POPPLER_DEFINE_BOXED_TYPE(PopplerDest, poppler_dest, poppler_dest_copy, poppler_dest_free) | ||
27 | +G_DEFINE_BOXED_TYPE(PopplerDest, poppler_dest, poppler_dest_copy, poppler_dest_free) | ||
28 | |||
29 | /** | ||
30 | * poppler_dest_copy: | ||
31 | @@ -88,7 +88,7 @@ static PopplerActionLayer *poppler_action_layer_copy(PopplerActionLayer *action_ | ||
32 | return retval; | ||
33 | } | ||
34 | |||
35 | -POPPLER_DEFINE_BOXED_TYPE(PopplerAction, poppler_action, poppler_action_copy, poppler_action_free) | ||
36 | +G_DEFINE_BOXED_TYPE(PopplerAction, poppler_action, poppler_action_copy, poppler_action_free) | ||
37 | |||
38 | /** | ||
39 | * poppler_action_free: | ||
40 | diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc | ||
41 | index f4c5bb1..5320565 100644 | ||
42 | --- a/glib/poppler-annot.cc | ||
43 | +++ b/glib/poppler-annot.cc | ||
44 | @@ -1693,7 +1693,7 @@ gchar *poppler_annot_file_attachment_get_name(PopplerAnnotFileAttachment *popple | ||
45 | } | ||
46 | |||
47 | /* PopplerAnnotCalloutLine */ | ||
48 | -POPPLER_DEFINE_BOXED_TYPE(PopplerAnnotCalloutLine, poppler_annot_callout_line, poppler_annot_callout_line_copy, poppler_annot_callout_line_free) | ||
49 | +G_DEFINE_BOXED_TYPE(PopplerAnnotCalloutLine, poppler_annot_callout_line, poppler_annot_callout_line_copy, poppler_annot_callout_line_free) | ||
50 | |||
51 | /** | ||
52 | * poppler_annot_callout_line_new: | ||
53 | diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc | ||
54 | index bd26bc7..9e62ff6 100644 | ||
55 | --- a/glib/poppler-document.cc | ||
56 | +++ b/glib/poppler-document.cc | ||
57 | @@ -2360,7 +2360,7 @@ struct _PopplerIndexIter | ||
58 | int index; | ||
59 | }; | ||
60 | |||
61 | -POPPLER_DEFINE_BOXED_TYPE(PopplerIndexIter, poppler_index_iter, poppler_index_iter_copy, poppler_index_iter_free) | ||
62 | +G_DEFINE_BOXED_TYPE(PopplerIndexIter, poppler_index_iter, poppler_index_iter_copy, poppler_index_iter_free) | ||
63 | |||
64 | /** | ||
65 | * poppler_index_iter_copy: | ||
66 | @@ -2579,7 +2579,7 @@ struct _PopplerFontsIter | ||
67 | int index; | ||
68 | }; | ||
69 | |||
70 | -POPPLER_DEFINE_BOXED_TYPE(PopplerFontsIter, poppler_fonts_iter, poppler_fonts_iter_copy, poppler_fonts_iter_free) | ||
71 | +G_DEFINE_BOXED_TYPE(PopplerFontsIter, poppler_fonts_iter, poppler_fonts_iter_copy, poppler_fonts_iter_free) | ||
72 | |||
73 | /** | ||
74 | * poppler_fonts_iter_get_full_name: | ||
75 | @@ -3111,7 +3111,7 @@ struct _PopplerLayersIter | ||
76 | int index; | ||
77 | }; | ||
78 | |||
79 | -POPPLER_DEFINE_BOXED_TYPE(PopplerLayersIter, poppler_layers_iter, poppler_layers_iter_copy, poppler_layers_iter_free) | ||
80 | +G_DEFINE_BOXED_TYPE(PopplerLayersIter, poppler_layers_iter, poppler_layers_iter_copy, poppler_layers_iter_free) | ||
81 | |||
82 | /** | ||
83 | * poppler_layers_iter_copy: | ||
84 | diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc | ||
85 | index 7e21c71..2e229bf 100644 | ||
86 | --- a/glib/poppler-page.cc | ||
87 | +++ b/glib/poppler-page.cc | ||
88 | @@ -1566,7 +1566,7 @@ void poppler_page_remove_annot(PopplerPage *page, PopplerAnnot *annot) | ||
89 | |||
90 | /* PopplerRectangle type */ | ||
91 | |||
92 | -POPPLER_DEFINE_BOXED_TYPE(PopplerRectangle, poppler_rectangle, poppler_rectangle_copy, poppler_rectangle_free) | ||
93 | +G_DEFINE_BOXED_TYPE(PopplerRectangle, poppler_rectangle, poppler_rectangle_copy, poppler_rectangle_free) | ||
94 | |||
95 | /** | ||
96 | * poppler_rectangle_new: | ||
97 | @@ -1608,7 +1608,7 @@ void poppler_rectangle_free(PopplerRectangle *rectangle) | ||
98 | |||
99 | /* PopplerPoint type */ | ||
100 | |||
101 | -POPPLER_DEFINE_BOXED_TYPE(PopplerPoint, poppler_point, poppler_point_copy, poppler_point_free) | ||
102 | +G_DEFINE_BOXED_TYPE(PopplerPoint, poppler_point, poppler_point_copy, poppler_point_free) | ||
103 | |||
104 | /** | ||
105 | * poppler_point_new: | ||
106 | @@ -1657,7 +1657,7 @@ void poppler_point_free(PopplerPoint *point) | ||
107 | |||
108 | /* PopplerQuadrilateral type */ | ||
109 | |||
110 | -POPPLER_DEFINE_BOXED_TYPE(PopplerQuadrilateral, poppler_quadrilateral, poppler_quadrilateral_copy, poppler_quadrilateral_free) | ||
111 | +G_DEFINE_BOXED_TYPE(PopplerQuadrilateral, poppler_quadrilateral, poppler_quadrilateral_copy, poppler_quadrilateral_free) | ||
112 | |||
113 | /** | ||
114 | * poppler_quadrilateral_new: | ||
115 | @@ -1705,7 +1705,7 @@ void poppler_quadrilateral_free(PopplerQuadrilateral *quad) | ||
116 | |||
117 | /* PopplerTextAttributes type */ | ||
118 | |||
119 | -POPPLER_DEFINE_BOXED_TYPE(PopplerTextAttributes, poppler_text_attributes, poppler_text_attributes_copy, poppler_text_attributes_free) | ||
120 | +G_DEFINE_BOXED_TYPE(PopplerTextAttributes, poppler_text_attributes, poppler_text_attributes_copy, poppler_text_attributes_free) | ||
121 | |||
122 | /** | ||
123 | * poppler_text_attributes_new: | ||
124 | @@ -1804,7 +1804,7 @@ void poppler_text_attributes_free(PopplerTextAttributes *text_attrs) | ||
125 | */ | ||
126 | |||
127 | /* PopplerColor type */ | ||
128 | -POPPLER_DEFINE_BOXED_TYPE(PopplerColor, poppler_color, poppler_color_copy, poppler_color_free) | ||
129 | +G_DEFINE_BOXED_TYPE(PopplerColor, poppler_color, poppler_color_copy, poppler_color_free) | ||
130 | |||
131 | /** | ||
132 | * poppler_color_new: | ||
133 | @@ -1848,7 +1848,7 @@ void poppler_color_free(PopplerColor *color) | ||
134 | } | ||
135 | |||
136 | /* PopplerLinkMapping type */ | ||
137 | -POPPLER_DEFINE_BOXED_TYPE(PopplerLinkMapping, poppler_link_mapping, poppler_link_mapping_copy, poppler_link_mapping_free) | ||
138 | +G_DEFINE_BOXED_TYPE(PopplerLinkMapping, poppler_link_mapping, poppler_link_mapping_copy, poppler_link_mapping_free) | ||
139 | |||
140 | /** | ||
141 | * poppler_link_mapping_new: | ||
142 | @@ -1900,7 +1900,7 @@ void poppler_link_mapping_free(PopplerLinkMapping *mapping) | ||
143 | } | ||
144 | |||
145 | /* Poppler Image mapping type */ | ||
146 | -POPPLER_DEFINE_BOXED_TYPE(PopplerImageMapping, poppler_image_mapping, poppler_image_mapping_copy, poppler_image_mapping_free) | ||
147 | +G_DEFINE_BOXED_TYPE(PopplerImageMapping, poppler_image_mapping, poppler_image_mapping_copy, poppler_image_mapping_free) | ||
148 | |||
149 | /** | ||
150 | * poppler_image_mapping_new: | ||
151 | @@ -1939,7 +1939,7 @@ void poppler_image_mapping_free(PopplerImageMapping *mapping) | ||
152 | } | ||
153 | |||
154 | /* Page Transition */ | ||
155 | -POPPLER_DEFINE_BOXED_TYPE(PopplerPageTransition, poppler_page_transition, poppler_page_transition_copy, poppler_page_transition_free) | ||
156 | +G_DEFINE_BOXED_TYPE(PopplerPageTransition, poppler_page_transition, poppler_page_transition_copy, poppler_page_transition_free) | ||
157 | |||
158 | /** | ||
159 | * poppler_page_transition_new: | ||
160 | @@ -1983,7 +1983,7 @@ void poppler_page_transition_free(PopplerPageTransition *transition) | ||
161 | } | ||
162 | |||
163 | /* Form Field Mapping Type */ | ||
164 | -POPPLER_DEFINE_BOXED_TYPE(PopplerFormFieldMapping, poppler_form_field_mapping, poppler_form_field_mapping_copy, poppler_form_field_mapping_free) | ||
165 | +G_DEFINE_BOXED_TYPE(PopplerFormFieldMapping, poppler_form_field_mapping, poppler_form_field_mapping_copy, poppler_form_field_mapping_free) | ||
166 | |||
167 | /** | ||
168 | * poppler_form_field_mapping_new: | ||
169 | @@ -2035,7 +2035,7 @@ void poppler_form_field_mapping_free(PopplerFormFieldMapping *mapping) | ||
170 | } | ||
171 | |||
172 | /* PopplerAnnot Mapping Type */ | ||
173 | -POPPLER_DEFINE_BOXED_TYPE(PopplerAnnotMapping, poppler_annot_mapping, poppler_annot_mapping_copy, poppler_annot_mapping_free) | ||
174 | +G_DEFINE_BOXED_TYPE(PopplerAnnotMapping, poppler_annot_mapping, poppler_annot_mapping_copy, poppler_annot_mapping_free) | ||
175 | |||
176 | /** | ||
177 | * poppler_annot_mapping_new: | ||
178 | diff --git a/glib/poppler-private.h b/glib/poppler-private.h | ||
179 | index d41b59c..1027271 100644 | ||
180 | --- a/glib/poppler-private.h | ||
181 | +++ b/glib/poppler-private.h | ||
182 | @@ -143,21 +143,6 @@ gboolean _poppler_convert_pdf_date_to_gtime(const GooString *date, time_t *gdate | ||
183 | GDateTime *_poppler_convert_pdf_date_to_date_time(const GooString *date); | ||
184 | GooString *_poppler_convert_date_time_to_pdf_date(GDateTime *datetime); | ||
185 | |||
186 | -/* | ||
187 | - * A convenience macro for boxed type implementations, which defines a | ||
188 | - * type_name_get_type() function registering the boxed type. | ||
189 | - */ | ||
190 | -#define POPPLER_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) \ | ||
191 | - GType type_name##_get_type(void) \ | ||
192 | - { \ | ||
193 | - static volatile gsize g_define_type_id__volatile = 0; \ | ||
194 | - if (g_once_init_enter(&g_define_type_id__volatile)) { \ | ||
195 | - GType g_define_type_id = g_boxed_type_register_static(g_intern_static_string(#TypeName), (GBoxedCopyFunc)copy_func, (GBoxedFreeFunc)free_func); \ | ||
196 | - g_once_init_leave(&g_define_type_id__volatile, g_define_type_id); \ | ||
197 | - } \ | ||
198 | - return g_define_type_id__volatile; \ | ||
199 | - } | ||
200 | - | ||
201 | void _poppler_error_cb(ErrorCategory category, Goffset pos, const char *message); | ||
202 | |||
203 | #endif | ||
204 | diff --git a/glib/poppler-structure-element.cc b/glib/poppler-structure-element.cc | ||
205 | index aec7cd1..29d3e5c 100644 | ||
206 | --- a/glib/poppler-structure-element.cc | ||
207 | +++ b/glib/poppler-structure-element.cc | ||
208 | @@ -581,7 +581,7 @@ struct _PopplerStructureElementIter | ||
209 | unsigned index; | ||
210 | }; | ||
211 | |||
212 | -POPPLER_DEFINE_BOXED_TYPE(PopplerStructureElementIter, poppler_structure_element_iter, poppler_structure_element_iter_copy, poppler_structure_element_iter_free) | ||
213 | +G_DEFINE_BOXED_TYPE(PopplerStructureElementIter, poppler_structure_element_iter, poppler_structure_element_iter_copy, poppler_structure_element_iter_free) | ||
214 | |||
215 | /** | ||
216 | * poppler_structure_element_iter_copy: | ||
217 | @@ -763,7 +763,7 @@ struct _PopplerTextSpan | ||
218 | PopplerColor color; | ||
219 | }; | ||
220 | |||
221 | -POPPLER_DEFINE_BOXED_TYPE(PopplerTextSpan, poppler_text_span, poppler_text_span_copy, poppler_text_span_free) | ||
222 | +G_DEFINE_BOXED_TYPE(PopplerTextSpan, poppler_text_span, poppler_text_span_copy, poppler_text_span_free) | ||
223 | |||
224 | enum | ||
225 | { | ||
226 | -- | ||
227 | 2.31.1 | ||
228 | |||
diff --git a/meta-oe/recipes-support/poppler/poppler/0002-glib-Remove-incorrecly-used-volatile-from-enum-type-.patch b/meta-oe/recipes-support/poppler/poppler/0002-glib-Remove-incorrecly-used-volatile-from-enum-type-.patch new file mode 100644 index 000000000..f4a54a184 --- /dev/null +++ b/meta-oe/recipes-support/poppler/poppler/0002-glib-Remove-incorrecly-used-volatile-from-enum-type-.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 8b0890e2d1623e580d8a849e56c1f3a2984e782d Mon Sep 17 00:00:00 2001 | ||
2 | From: Christian Persch <chpe@src.gnome.org> | ||
3 | Date: Fri, 26 Mar 2021 18:17:25 +0100 | ||
4 | Subject: [PATCH 2/2] glib: Remove incorrecly used volatile from enum type | ||
5 | registration code | ||
6 | |||
7 | Upstream-Status: Backport [https://github.com/freedesktop/poppler/commit/bdd110b45a38e8a4f80f522892e4c4a9e432abd5] | ||
8 | --- | ||
9 | glib/poppler-enums.c.template | 10 +++++----- | ||
10 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
11 | |||
12 | diff --git a/glib/poppler-enums.c.template b/glib/poppler-enums.c.template | ||
13 | index 26a51b4..eefc769 100644 | ||
14 | --- a/glib/poppler-enums.c.template | ||
15 | +++ b/glib/poppler-enums.c.template | ||
16 | @@ -15,9 +15,9 @@ | ||
17 | GType | ||
18 | @enum_name@_get_type (void) | ||
19 | { | ||
20 | - static volatile gsize g_define_type_id__volatile = 0; | ||
21 | + static volatile gsize g_define_type_id = 0; | ||
22 | |||
23 | - if (g_once_init_enter (&g_define_type_id__volatile)) { | ||
24 | + if (g_once_init_enter (&g_define_type_id)) { | ||
25 | static const G@Type@Value values[] = { | ||
26 | /*** END value-header ***/ | ||
27 | |||
28 | @@ -28,13 +28,13 @@ GType | ||
29 | /*** BEGIN value-tail ***/ | ||
30 | { 0, NULL, NULL } | ||
31 | }; | ||
32 | - GType g_define_type_id = | ||
33 | + GType type = | ||
34 | g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); | ||
35 | |||
36 | - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); | ||
37 | + g_once_init_leave (&g_define_type_id, type); | ||
38 | } | ||
39 | |||
40 | - return g_define_type_id__volatile; | ||
41 | + return g_define_type_id; | ||
42 | } | ||
43 | |||
44 | /*** END value-tail ***/ | ||
45 | -- | ||
46 | 2.31.1 | ||
47 | |||
diff --git a/meta-oe/recipes-support/poppler/poppler_21.03.0.bb b/meta-oe/recipes-support/poppler/poppler_21.03.0.bb index 52aa17021..b272bc82c 100644 --- a/meta-oe/recipes-support/poppler/poppler_21.03.0.bb +++ b/meta-oe/recipes-support/poppler/poppler_21.03.0.bb | |||
@@ -6,6 +6,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | |||
6 | SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \ | 6 | SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \ |
7 | file://0001-Do-not-overwrite-all-our-build-flags.patch \ | 7 | file://0001-Do-not-overwrite-all-our-build-flags.patch \ |
8 | file://basename-include.patch \ | 8 | file://basename-include.patch \ |
9 | file://0001-glib-Use-stock-glib-macro-to-define-boxed-type.patch \ | ||
10 | file://0002-glib-Remove-incorrecly-used-volatile-from-enum-type-.patch \ | ||
9 | " | 11 | " |
10 | SRC_URI[sha256sum] = "fd51ead4aac1d2f4684fa6e7b0ec06f0233ed21667e720a4e817e4455dd63d27" | 12 | SRC_URI[sha256sum] = "fd51ead4aac1d2f4684fa6e7b0ec06f0233ed21667e720a4e817e4455dd63d27" |
11 | 13 | ||