summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-04 12:46:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-04 21:08:12 +0200
commit86132d8188e5e76623dc8053e5a43c1d69eb0831 (patch)
treec861dc2bb3db595d8a50e92cb35c13d86cb5da9f /external
parent36aa242429ca992b20574f4974d471d544247362 (diff)
upgrade to cairo 1.17.6
Change-Id: Ibdf84df380c89d3a0713163920a576bf1c47873a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133825 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/cairo/UnpackedTarball_cairo.mk10
-rw-r--r--external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.154
-rw-r--r--external/cairo/cairo/0025-libtool-pass-use-ld.patch16
-rw-r--r--external/cairo/cairo/cairo-fix_function_signature.patch.1334
-rw-r--r--external/cairo/cairo/cairo-libtool-rpath.patch.112
-rw-r--r--external/cairo/cairo/cairo.buildfix.patch24
-rw-r--r--external/cairo/cairo/san.patch.065
7 files changed, 40 insertions, 475 deletions
diff --git a/external/cairo/UnpackedTarball_cairo.mk b/external/cairo/UnpackedTarball_cairo.mk
index a2e9eb894d75..a30285d0a1bd 100644
--- a/external/cairo/UnpackedTarball_cairo.mk
+++ b/external/cairo/UnpackedTarball_cairo.mk
@@ -11,15 +11,17 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,cairo))
$(eval $(call gb_UnpackedTarball_set_tarball,cairo,$(CAIRO_TARBALL),,cairo))
+# cairo >= 1.17.6 was probably created in Fedora where
+# https://salsa.debian.org/mckinstry/libtool/-/commit/26c23f951d049241128e5e04a7bbc263e5b145f1
+# isn't applied, so add that in to avoid: /usr/bin/ld: unrecognized option '--gdb-index'
+
$(eval $(call gb_UnpackedTarball_add_patches,cairo,\
external/cairo/cairo/cairo.buildfix.patch \
external/cairo/cairo/cairo.RGB24_888.patch \
external/cairo/cairo/cairo-libtool-rpath.patch.1 \
external/cairo/cairo/cairo.oldfreetype.patch \
- external/cairo/cairo/san.patch.0 \
- external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1 \
- external/cairo/cairo/cairo-fix_function_signature.patch.1 \
- external/cairo/cairo/cairo.ofz46165.patch.1 \
+ external/cairo/cairo/cairo.ofz46165.patch.1 \
+ external/cairo/cairo/0025-libtool-pass-use-ld.patch \
))
ifeq ($(OS),iOS)
diff --git a/external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1 b/external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1
deleted file mode 100644
index c0431555b09a..000000000000
--- a/external/cairo/cairo/0001-Fix-mask-usage-in-image-compositor.patch.1
+++ /dev/null
@@ -1,54 +0,0 @@
-From 03a820b173ed1fdef6ff14b4468f5dbc02ff59be Mon Sep 17 00:00:00 2001
-From: Heiko Lewin <heiko.lewin@worldiety.de>
-Date: Tue, 15 Dec 2020 16:48:19 +0100
-Subject: [PATCH] Fix mask usage in image-compositor
-
----
- src/cairo-image-compositor.c | 8 ++--
- test/Makefile.sources | 1 +
- test/bug-image-compositor.c | 39 ++++++++++++++++++++
- test/reference/bug-image-compositor.ref.png | Bin 0 -> 185 bytes
- 4 files changed, 44 insertions(+), 4 deletions(-)
- create mode 100644 test/bug-image-compositor.c
- create mode 100644 test/reference/bug-image-compositor.ref.png
-
-diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
-index 79ad69f68..4f8aaed99 100644
---- a/src/cairo-image-compositor.c
-+++ b/src/cairo-image-compositor.c
-@@ -2610,14 +2610,14 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
- unsigned num_spans)
- {
- cairo_image_span_renderer_t *r = abstract_renderer;
-- uint8_t *m;
-+ uint8_t *m, *base = (uint8_t*)pixman_image_get_data(r->mask);
- int x0;
-
- if (num_spans == 0)
- return CAIRO_STATUS_SUCCESS;
-
- x0 = spans[0].x;
-- m = r->_buf;
-+ m = base;
- do {
- int len = spans[1].x - spans[0].x;
- if (len >= r->u.composite.run_length && spans[0].coverage == 0xff) {
-@@ -2655,7 +2655,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
- spans[0].x, y,
- spans[1].x - spans[0].x, h);
-
-- m = r->_buf;
-+ m = base;
- x0 = spans[1].x;
- } else if (spans[0].coverage == 0x0) {
- if (spans[0].x != x0) {
-@@ -2684,7 +2684,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
- #endif
- }
-
-- m = r->_buf;
-+ m = base;
- x0 = spans[1].x;
- } else {
- *m++ = spans[0].coverage;
-[test code changes removed]
diff --git a/external/cairo/cairo/0025-libtool-pass-use-ld.patch b/external/cairo/cairo/0025-libtool-pass-use-ld.patch
new file mode 100644
index 000000000000..c5558ff736a1
--- /dev/null
+++ b/external/cairo/cairo/0025-libtool-pass-use-ld.patch
@@ -0,0 +1,16 @@
+--- a/cairo/build/ltmain.sh 2022-05-04 16:12:17.409012360 +0100
++++ b/cairo/build/ltmain.sh 2022-05-04 16:12:42.510870063 +0100
+@@ -7273,11 +7273,12 @@
+ # --sysroot=* for sysroot support
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -specs=* GCC specs files
++ # -fuse-ld=* Linker select flags for GCC
+ # -stdlib=* select c++ std lib with clang
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+- -specs=*)
++ -specs=*|-fuse-ld=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
diff --git a/external/cairo/cairo/cairo-fix_function_signature.patch.1 b/external/cairo/cairo/cairo-fix_function_signature.patch.1
deleted file mode 100644
index 41cbc6ffbeab..000000000000
--- a/external/cairo/cairo/cairo-fix_function_signature.patch.1
+++ /dev/null
@@ -1,334 +0,0 @@
-diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c
-index aaddeb7..0d85051 100644
---- a/src/cairo-clip-boxes.c
-+++ b/src/cairo-clip-boxes.c
-@@ -481,8 +481,9 @@ _add_edge (struct reduce *r,
- }
-
- static cairo_status_t
--_reduce_line_to (void *closure,
-- const cairo_point_t *point)
-+_reduce_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- struct reduce *r = closure;
-
-@@ -492,6 +493,13 @@ _reduce_line_to (void *closure,
- return CAIRO_STATUS_SUCCESS;
- }
-
-+static cairo_status_t
-+_reduce_line_to (void *closure,
-+ const cairo_point_t *point)
-+{
-+ return _reduce_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- _reduce_close (void *closure)
- {
-@@ -547,6 +555,7 @@ _cairo_clip_reduce_to_boxes (cairo_clip_t *clip)
- status = _cairo_path_fixed_interpret_flat (&clip_path->path,
- _reduce_move_to,
- _reduce_line_to,
-+ _reduce_add_point,
- _reduce_close,
- &r,
- clip_path->tolerance);
-diff --git a/src/cairo-path-fill.c b/src/cairo-path-fill.c
-index 4000c9c..dd11a91 100644
---- a/src/cairo-path-fill.c
-+++ b/src/cairo-path-fill.c
-@@ -54,8 +54,9 @@ typedef struct cairo_filler {
- } cairo_filler_t;
-
- static cairo_status_t
--_cairo_filler_line_to (void *closure,
-- const cairo_point_t *point)
-+_cairo_filler_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- cairo_filler_t *filler = closure;
- cairo_status_t status;
-@@ -69,6 +70,13 @@ _cairo_filler_line_to (void *closure,
- return status;
- }
-
-+static cairo_status_t
-+_cairo_filler_line_to (void *closure,
-+ const cairo_point_t *point)
-+{
-+ return _cairo_filler_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- _cairo_filler_close (void *closure)
- {
-@@ -113,7 +121,7 @@ _cairo_filler_curve_to (void *closure,
- }
-
- if (! _cairo_spline_init (&spline,
-- (cairo_spline_add_point_func_t)_cairo_filler_line_to, filler,
-+ _cairo_filler_add_point, filler,
- &filler->current_point, p1, p2, p3))
- {
- return _cairo_filler_line_to (closure, p3);
-@@ -164,8 +172,9 @@ typedef struct cairo_filler_rectilinear_aligned {
- } cairo_filler_ra_t;
-
- static cairo_status_t
--_cairo_filler_ra_line_to (void *closure,
-- const cairo_point_t *point)
-+_cairo_filler_ra_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- cairo_filler_ra_t *filler = closure;
- cairo_status_t status;
-@@ -183,6 +192,13 @@ _cairo_filler_ra_line_to (void *closure,
- return status;
- }
-
-+static cairo_status_t
-+_cairo_filler_ra_line_to (void *closure,
-+ const cairo_point_t *point)
-+{
-+ return _cairo_filler_ra_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- _cairo_filler_ra_close (void *closure)
- {
-@@ -234,6 +250,7 @@ _cairo_path_fixed_fill_rectilinear_to_polygon (const cairo_path_fixed_t *path,
- status = _cairo_path_fixed_interpret_flat (path,
- _cairo_filler_ra_move_to,
- _cairo_filler_ra_line_to,
-+ _cairo_filler_ra_add_point,
- _cairo_filler_ra_close,
- &filler,
- 0.);
-diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
-index d741823..ea7fb9e 100644
---- a/src/cairo-path-fixed.c
-+++ b/src/cairo-path-fixed.c
-@@ -1108,6 +1108,7 @@ typedef struct cairo_path_flattener {
- cairo_point_t current_point;
- cairo_path_fixed_move_to_func_t *move_to;
- cairo_path_fixed_line_to_func_t *line_to;
-+ cairo_spline_add_point_func_t add_point;
- cairo_path_fixed_close_path_func_t *close_path;
- void *closure;
- } cpf_t;
-@@ -1124,8 +1125,9 @@ _cpf_move_to (void *closure,
- }
-
- static cairo_status_t
--_cpf_line_to (void *closure,
-- const cairo_point_t *point)
-+_cpf_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- cpf_t *cpf = closure;
-
-@@ -1134,6 +1136,13 @@ _cpf_line_to (void *closure,
- return cpf->line_to (cpf->closure, point);
- }
-
-+static cairo_status_t
-+_cpf_line_to (void *closure,
-+ const cairo_point_t *point)
-+{
-+ return _cpf_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- _cpf_curve_to (void *closure,
- const cairo_point_t *p1,
-@@ -1146,7 +1155,7 @@ _cpf_curve_to (void *closure,
- cairo_point_t *p0 = &cpf->current_point;
-
- if (! _cairo_spline_init (&spline,
-- (cairo_spline_add_point_func_t)cpf->line_to,
-+ cpf->add_point,
- cpf->closure,
- p0, p1, p2, p3))
- {
-@@ -1170,6 +1179,7 @@ cairo_status_t
- _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
- cairo_path_fixed_move_to_func_t *move_to,
- cairo_path_fixed_line_to_func_t *line_to,
-+ cairo_spline_add_point_func_t add_point,
- cairo_path_fixed_close_path_func_t *close_path,
- void *closure,
- double tolerance)
-@@ -1188,6 +1198,7 @@ _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
- flattener.tolerance = tolerance;
- flattener.move_to = move_to;
- flattener.line_to = line_to;
-+ flattener.add_point = *add_point;
- flattener.close_path = close_path;
- flattener.closure = closure;
- return _cairo_path_fixed_interpret (path,
-diff --git a/src/cairo-path-in-fill.c b/src/cairo-path-in-fill.c
-index 1787fb1..e61500b 100644
---- a/src/cairo-path-in-fill.c
-+++ b/src/cairo-path-in-fill.c
-@@ -169,8 +169,9 @@ _cairo_in_fill_move_to (void *closure,
- }
-
- static cairo_status_t
--_cairo_in_fill_line_to (void *closure,
-- const cairo_point_t *point)
-+_cairo_in_fill_spline_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- cairo_in_fill_t *in_fill = closure;
-
-@@ -183,6 +184,13 @@ _cairo_in_fill_line_to (void *closure,
- return CAIRO_STATUS_SUCCESS;
- }
-
-+static cairo_status_t
-+_cairo_in_fill_line_to (void *closure,
-+ const cairo_point_t *point)
-+{
-+ return _cairo_in_fill_spline_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- _cairo_in_fill_curve_to (void *closure,
- const cairo_point_t *b,
-@@ -217,7 +225,7 @@ _cairo_in_fill_curve_to (void *closure,
-
- /* XXX Investigate direct inspection of the inflections? */
- if (! _cairo_spline_init (&spline,
-- (cairo_spline_add_point_func_t)_cairo_in_fill_line_to,
-+ _cairo_in_fill_spline_add_point,
- in_fill,
- &in_fill->current_point, b, c, d))
- {
-diff --git a/src/cairo-path-stroke-traps.c b/src/cairo-path-stroke-traps.c
-index 1363ffa..6377bc1 100644
---- a/src/cairo-path-stroke-traps.c
-+++ b/src/cairo-path-stroke-traps.c
-@@ -817,7 +817,9 @@ line_to (void *closure, const cairo_point_t *point)
- * Dashed lines. Cap each dash end, join around turns when on
- */
- static cairo_status_t
--line_to_dashed (void *closure, const cairo_point_t *point)
-+_cairo_in_dashed_spline_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- struct stroker *stroker = closure;
- double mag, remain, step_length = 0;
-@@ -930,6 +932,12 @@ line_to_dashed (void *closure, const cairo_point_t *point)
- return CAIRO_STATUS_SUCCESS;
- }
-
-+static cairo_status_t
-+line_to_dashed (void *closure, const cairo_point_t *point)
-+{
-+ return _cairo_in_dashed_spline_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- spline_to (void *closure,
- const cairo_point_t *point,
-@@ -1042,7 +1050,7 @@ curve_to_dashed (void *closure,
- cairo_spline_add_point_func_t func;
- cairo_status_t status;
-
-- func = (cairo_spline_add_point_func_t)line_to_dashed;
-+ func = _cairo_in_dashed_spline_add_point;
-
- if (stroker->has_bounds &&
- ! _cairo_spline_intersects (&stroker->current_face.point, b, c, d,
-diff --git a/src/cairo-path.c b/src/cairo-path.c
-index 566e86f..5a8f5d6 100644
---- a/src/cairo-path.c
-+++ b/src/cairo-path.c
-@@ -70,8 +70,9 @@ _cpc_move_to (void *closure,
- }
-
- static cairo_status_t
--_cpc_line_to (void *closure,
-- const cairo_point_t *point)
-+_cpc_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- cpc_t *cpc = closure;
-
-@@ -80,6 +81,13 @@ _cpc_line_to (void *closure,
- return CAIRO_STATUS_SUCCESS;
- }
-
-+static cairo_status_t
-+_cpc_line_to (void *closure,
-+ const cairo_point_t *point)
-+{
-+ return _cpc_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- _cpc_curve_to (void *closure,
- const cairo_point_t *p1,
-@@ -118,6 +126,7 @@ _cairo_path_count (cairo_path_t *path,
- status = _cairo_path_fixed_interpret_flat (path_fixed,
- _cpc_move_to,
- _cpc_line_to,
-+ _cpc_add_point,
- _cpc_close_path,
- &cpc,
- tolerance);
-@@ -168,8 +177,9 @@ _cpp_move_to (void *closure,
- }
-
- static cairo_status_t
--_cpp_line_to (void *closure,
-- const cairo_point_t *point)
-+_cpp_add_point (void *closure,
-+ const cairo_point_t *point,
-+ const struct _cairo_slope *slope)
- {
- cpp_t *cpp = closure;
- cairo_path_data_t *data = cpp->data;
-@@ -192,6 +202,13 @@ _cpp_line_to (void *closure,
- return CAIRO_STATUS_SUCCESS;
- }
-
-+static cairo_status_t
-+_cpp_line_to (void *closure,
-+ const cairo_point_t *point)
-+{
-+ return _cpp_add_point(closure, point, NULL);
-+}
-+
- static cairo_status_t
- _cpp_curve_to (void *closure,
- const cairo_point_t *p1,
-@@ -264,6 +281,7 @@ _cairo_path_populate (cairo_path_t *path,
- status = _cairo_path_fixed_interpret_flat (path_fixed,
- _cpp_move_to,
- _cpp_line_to,
-+ _cpp_add_point,
- _cpp_close_path,
- &cpp,
- cairo_get_tolerance (cr));
-diff --git a/src/cairoint.h b/src/cairoint.h
-index 7f6a252..edbfe52 100644
---- a/src/cairoint.h
-+++ b/src/cairoint.h
-@@ -1022,6 +1022,7 @@ cairo_private cairo_status_t
- _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
- cairo_path_fixed_move_to_func_t *move_to,
- cairo_path_fixed_line_to_func_t *line_to,
-+ cairo_spline_add_point_func_t add_point,
- cairo_path_fixed_close_path_func_t *close_path,
- void *closure,
- double tolerance);
diff --git a/external/cairo/cairo/cairo-libtool-rpath.patch.1 b/external/cairo/cairo/cairo-libtool-rpath.patch.1
index dffa25414f61..18a3507a9506 100644
--- a/external/cairo/cairo/cairo-libtool-rpath.patch.1
+++ b/external/cairo/cairo/cairo-libtool-rpath.patch.1
@@ -2,11 +2,11 @@ Prevent libtool from adding annoying stuff to RPATH
--- cairo/configure.orig 2018-10-19 22:20:08.000000000 +0200
+++ cairo/configure 2019-09-04 17:53:00.927539686 +0200
-@@ -16592,6 +16592,7 @@
- esac
- ;;
- esac
+@@ -10432,6 +10432,7 @@
+ else
+ ld_shlibs=no
+ fi
+hardcode_libdir_flag_spec=
- ;;
+ ;;
- lynxos*)
+ netbsd*)
diff --git a/external/cairo/cairo/cairo.buildfix.patch b/external/cairo/cairo/cairo.buildfix.patch
index 070dc8317244..5b64dfb593f2 100644
--- a/external/cairo/cairo/cairo.buildfix.patch
+++ b/external/cairo/cairo/cairo.buildfix.patch
@@ -13,7 +13,7 @@ diff -ru cairo-1.17.4.orig/build/Makefile.win32.features cairo-1.17.4/build/Make
diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure
--- misc/cairo-1.17.4.orig/configure 2021-08-29 19:43:26.966436173 +0100
+++ misc/build/cairo-1.17.4/configure 2021-08-29 19:43:47.500506604 +0100
-@@ -21080,61 +21080,12 @@
+@@ -17149,61 +17149,12 @@
rm -f confcache
@@ -75,7 +75,7 @@ diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure
save_LIBS="$LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo2a_decompress in -llzo2" >&5
$as_echo_n "checking for lzo2a_decompress in -llzo2... " >&6; }
-@@ -30670,7 +30621,7 @@
+@@ -24319,7 +24270,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - OK" >&5
$as_echo "$FREETYPE_VERSION - OK" >&6; }
ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags`
@@ -84,7 +84,7 @@ diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure
else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - Too old" >&5
$as_echo "$FREETYPE_VERSION - Too old" >&6; }
use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)"
-@@ -30680,7 +30631,7 @@
+@@ -24329,7 +24280,7 @@
fi
ft_CFLAGS="$FREETYPE_CFLAGS"
@@ -93,7 +93,7 @@ diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's FreeType font backend feature could be enabled" >&5
-@@ -31321,7 +31272,7 @@
+@@ -24962,7 +24913,7 @@
# The ps backend requires zlib.
use_ps=$have_libz
@@ -102,7 +102,7 @@ diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PostScript surface backend feature could be enabled" >&5
-@@ -31718,7 +31669,7 @@
+@@ -25355,7 +25306,7 @@
# The pdf backend requires zlib.
use_pdf=$have_libz
@@ -111,12 +111,12 @@ diff -ru cairo-1.17.4.orig/configure cairo-1.17.4/configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's PDF surface backend feature could be enabled" >&5
-@@ -33610,7 +33561,7 @@
-
-
- use_xml=$have_libz
-- xml_NONPKGCONFIG_LIBS=-lz
-+ xml_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+@@ -27218,7 +27169,7 @@
+ use_xml="no (requires --enable-png)"
+ else
+ use_xml=$have_libz
+- xml_NONPKGCONFIG_LIBS=-lz
++ xml_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's xml surface backend feature could be enabled" >&5
diff --git a/external/cairo/cairo/san.patch.0 b/external/cairo/cairo/san.patch.0
index e6c98859244b..272fef628aee 100644
--- a/external/cairo/cairo/san.patch.0
+++ b/external/cairo/cairo/san.patch.0
@@ -38,23 +38,6 @@
num_clusters * sizeof (cairo_text_cluster_t));
} else {
const cairo_glyph_t *cur_glyph;
---- src/cairo-image-compositor.c
-+++ src/cairo-image-compositor.c
-@@ -130,10 +130,10 @@
- color_to_uint32 (const cairo_color_t *color)
- {
- return
-- (color->alpha_short >> 8 << 24) |
-- (color->red_short >> 8 << 16) |
-- (color->green_short & 0xff00) |
-- (color->blue_short >> 8);
-+ ((uint32_t)color->alpha_short >> 8 << 24) |
-+ ((uint32_t)color->red_short >> 8 << 16) |
-+ ((uint32_t)color->green_short & 0xff00) |
-+ ((uint32_t)color->blue_short >> 8);
- }
-
- static inline cairo_bool_t
--- src/cairo-image-source.c
+++ src/cairo-image-source.c
@@ -509,7 +509,7 @@
@@ -66,43 +49,6 @@
pixel &= 0x00ffffff; /* ignore next pixel bits */
if (pixel == 0)
return _pixman_black_image ();
---- src/cairo-spans-compositor.c
-+++ src/cairo-spans-compositor.c
-@@ -1041,14 +1041,14 @@
- if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
- cairo_polygon_t polygon;
- cairo_fill_rule_t fill_rule = CAIRO_FILL_RULE_WINDING;
-+ cairo_box_t limits;
-
- if (! _cairo_rectangle_contains_rectangle (&extents->unbounded,
- &extents->mask))
- {
- if (extents->clip->num_boxes == 1) {
- _cairo_polygon_init (&polygon, extents->clip->boxes, 1);
- } else {
-- cairo_box_t limits;
- _cairo_box_from_rectangle (&limits, &extents->unbounded);
- _cairo_polygon_init (&polygon, &limits, 1);
- }
-@@ -1128,17 +1128,17 @@
- }
- if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
- cairo_polygon_t polygon;
-+ cairo_box_t limits;
-
- TRACE((stderr, "%s - polygon\n", __FUNCTION__));
-
- if (! _cairo_rectangle_contains_rectangle (&extents->unbounded,
- &extents->mask))
- {
- TRACE((stderr, "%s - clipping to bounds\n", __FUNCTION__));
- if (extents->clip->num_boxes == 1) {
- _cairo_polygon_init (&polygon, extents->clip->boxes, 1);
- } else {
-- cairo_box_t limits;
- _cairo_box_from_rectangle (&limits, &extents->unbounded);
- _cairo_polygon_init (&polygon, &limits, 1);
- }
--- src/cairo-surface.c
+++ src/cairo-surface.c
@@ -2849,7 +2849,7 @@
@@ -138,17 +84,6 @@
for (i = 0; i < traps->num_traps; i++) {
cairo_trapezoid_t *t = &traps->traps[i];
---- src/cairo-xlib-source.c
-+++ src/cairo-xlib-source.c
-@@ -567,7 +567,7 @@
- {
- cairo_xlib_display_t *display = dst->display;
- uint32_t pixel =
-- color->alpha_short >> 8 << 24 |
-+ (uint32_t)(color->alpha_short >> 8) << 24 |
- color->red_short >> 8 << 16 |
- color->green_short >> 8 << 8 |
- color->blue_short >> 8 << 0;
--- src/cairo-xlib-surface-shm.c
+++ src/cairo-xlib-surface-shm.c
@@ -1152,9 +1152,11 @@