From 46ca3ee658b0f3a8ff29bd43e449f2d2016263a8 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 3 Feb 2023 15:54:59 +0100 Subject: [PATCH] cairo: Update to 1.17.8 --- ...ix-scaled_glyph-hash-lookup-on-Win64.patch | 37 -------------- .../0002-fix-dwrite-font-crash.patch | 13 ----- ...0040-revert-dwrite-measuring-default.patch | 13 +++++ mingw-w64-cairo/302.patch | 31 ------------ mingw-w64-cairo/PKGBUILD | 49 ++++++++++--------- 5 files changed, 39 insertions(+), 104 deletions(-) delete mode 100644 mingw-w64-cairo/0001-Fix-scaled_glyph-hash-lookup-on-Win64.patch delete mode 100644 mingw-w64-cairo/0002-fix-dwrite-font-crash.patch create mode 100644 mingw-w64-cairo/0040-revert-dwrite-measuring-default.patch delete mode 100644 mingw-w64-cairo/302.patch diff --git a/mingw-w64-cairo/0001-Fix-scaled_glyph-hash-lookup-on-Win64.patch b/mingw-w64-cairo/0001-Fix-scaled_glyph-hash-lookup-on-Win64.patch deleted file mode 100644 index 151ab346d5..0000000000 --- a/mingw-w64-cairo/0001-Fix-scaled_glyph-hash-lookup-on-Win64.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 90938531a9fe0fef1873c790d648bd0410cdf72e Mon Sep 17 00:00:00 2001 -From: Luca Bacci -Date: Sat, 3 Sep 2022 17:29:51 +0200 -Subject: [PATCH] Fix scaled_glyph hash lookup on Win64 - -Backport of https://gitlab.freedesktop.org/cairo/cairo/-/commit/1cc23206bde186d4aef948bba11e591120c99dcd -to 1.17.6 ---- - src/cairo-scaled-font.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c -index e0b586589..30611dca4 100755 ---- a/src/cairo-scaled-font.c -+++ b/src/cairo-scaled-font.c -@@ -3001,6 +3001,7 @@ _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font, - cairo_int_status_t status = CAIRO_INT_STATUS_SUCCESS; - cairo_scaled_glyph_t *scaled_glyph; - cairo_scaled_glyph_info_t need_info; -+ cairo_hash_entry_t key; - - *scaled_glyph_ret = NULL; - -@@ -3019,8 +3020,8 @@ _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font, - /* - * Check cache for glyph - */ -- scaled_glyph = _cairo_hash_table_lookup (scaled_font->glyphs, -- (cairo_hash_entry_t *) &index); -+ key.hash = index; -+ scaled_glyph = _cairo_hash_table_lookup (scaled_font->glyphs, &key); - if (scaled_glyph == NULL) { - status = _cairo_scaled_font_allocate_glyph (scaled_font, &scaled_glyph); - if (unlikely (status)) --- -2.36.1.windows.1 - diff --git a/mingw-w64-cairo/0002-fix-dwrite-font-crash.patch b/mingw-w64-cairo/0002-fix-dwrite-font-crash.patch deleted file mode 100644 index dfef2e9b16..0000000000 --- a/mingw-w64-cairo/0002-fix-dwrite-font-crash.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- cairo-b43e7c6f3cf7855e16170a06d3a9c7234c60ca94/src/win32/cairo-dwrite-font.cpp.orig 2022-03-18 18:40:07.000000000 +0000 -+++ cairo-b43e7c6f3cf7855e16170a06d3a9c7234c60ca94/src/win32/cairo-dwrite-font.cpp 2023-01-29 19:40:09.256720800 +0000 -@@ -1705,6 +1705,10 @@ - } - - cairo_font_face_t *face = cairo_scaled_font_get_font_face (scaled_font); -+ if (cairo_font_face_get_type(face) != CAIRO_FONT_TYPE_DWRITE) { -+ return CAIRO_INT_STATUS_UNSUPPORTED; -+ } -+ - cairo_dwrite_font_face_t *dwface = reinterpret_cast(face); - - RefPtr gdiInterop; diff --git a/mingw-w64-cairo/0040-revert-dwrite-measuring-default.patch b/mingw-w64-cairo/0040-revert-dwrite-measuring-default.patch new file mode 100644 index 0000000000..e362919398 --- /dev/null +++ b/mingw-w64-cairo/0040-revert-dwrite-measuring-default.patch @@ -0,0 +1,13 @@ +diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp +index 994889e21..8f7b6d703 100644 +--- a/src/win32/cairo-dwrite-font.cpp ++++ b/src/win32/cairo-dwrite-font.cpp +@@ -1453,7 +1453,7 @@ cairo_dwrite_font_face_create_for_dwrite_fontface (IDWriteFontFace *dwrite_font_ + face->dwriteface = dwriteface; + face->have_color = false; + face->rendering_params = NULL; +- face->measuring_mode = DWRITE_MEASURING_MODE_NATURAL; ++ face->measuring_mode = DWRITE_MEASURING_MODE_GDI_CLASSIC; + + /* Ensure IDWriteFactory4 is available before enabling color fonts */ + if (DWriteFactory::Instance4()) { diff --git a/mingw-w64-cairo/302.patch b/mingw-w64-cairo/302.patch deleted file mode 100644 index 2aef4149fd..0000000000 --- a/mingw-w64-cairo/302.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 36d75971dde8dffd80311b0e67de53b5dd919e3b Mon Sep 17 00:00:00 2001 -From: Adrian Johnson -Date: Sun, 20 Mar 2022 11:15:12 +1030 -Subject: [PATCH] Ensure DWrite toy fonts can not fail if font name not found - ---- - src/win32/cairo-dwrite-font.cpp | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp -index afa859fbd..575d46642 100644 ---- a/src/win32/cairo-dwrite-font.cpp -+++ b/src/win32/cairo-dwrite-font.cpp -@@ -327,8 +327,12 @@ _cairo_dwrite_font_face_create_for_toy (cairo_toy_font_face_t *toy_face, - IDWriteFontFamily *family = DWriteFactory::FindSystemFontFamily(face_name); - delete face_name; - if (!family) { -- *font_face = (cairo_font_face_t*)&_cairo_font_face_nil; -- return CAIRO_STATUS_FONT_TYPE_MISMATCH; -+ /* If the family is not found, pick a default that should work to avoid failing. */ -+ family = DWriteFactory::FindSystemFontFamily(L"Arial"); -+ if (!family) { -+ *font_face = (cairo_font_face_t*)&_cairo_font_face_nil; -+ return CAIRO_STATUS_FONT_TYPE_MISMATCH; -+ } - } - - DWRITE_FONT_WEIGHT weight; --- -GitLab - diff --git a/mingw-w64-cairo/PKGBUILD b/mingw-w64-cairo/PKGBUILD index a604d50145..928089eef7 100644 --- a/mingw-w64-cairo/PKGBUILD +++ b/mingw-w64-cairo/PKGBUILD @@ -5,8 +5,8 @@ _realname=cairo pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" _commit='b43e7c6f3cf7855e16170a06d3a9c7234c60ca94' -pkgver=1.17.6 -pkgrel=4 +pkgver=1.17.8 +pkgrel=1 pkgdesc="Cairo vector graphics library (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -17,7 +17,6 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-pkg-config" "${MINGW_PACKAGE_PREFIX}-meson" "${MINGW_PACKAGE_PREFIX}-ninja" - "git" ) depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-freetype" @@ -28,36 +27,41 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-zlib" ) optdepends=("${MINGW_PACKAGE_PREFIX}-glib2: libcairo-gobject") -options=('strip' 'staticlibs') -source=("https://gitlab.freedesktop.org/cairo/cairo/-/archive/${_commit}/cairo-${_commit}.tar.gz" +source=("https://cairographics.org/snapshots/cairo-${pkgver}.tar.xz" 0026-create-argb-fonts.all.patch 0030-ucrt-clang-fixes.patch - 302.patch - 0002-fix-dwrite-font-crash.patch - 0001-Fix-scaled_glyph-hash-lookup-on-Win64.patch) -sha256sums=('e65ca82c44308e36ff07ad860db4eb8b066223277a0f7c9440c839ff204ce86e' + https://gitlab.freedesktop.org/cairo/cairo/-/commit/71eb6396c497541118d4c85f97cb9d05aeb94a7e.patch + https://gitlab.freedesktop.org/cairo/cairo/-/commit/5e42a5277eddafd312a73e355d7775a4401dae4e.patch + https://gitlab.freedesktop.org/cairo/cairo/-/commit/db4c941c34617c1a1ee0519387b94936491fa860.patch + https://gitlab.freedesktop.org/cairo/cairo/-/commit/b1bc11f646a5345e61ebd5c58305c536bd6a4207.patch + 0040-revert-dwrite-measuring-default.patch) +sha256sums=('5b10c8892d1b58d70d3f0ba5b47863a061262fa56b9dc7944161f8c8b783bc64' '6db6c44fbdb4926d09afa978fe80430186c4b7b7d255059602b1f94c6a079975' '86c1af2878a20bd3608fc476e4ba1f2451458a5f6f12e457e37b61082c38db82' - '86401dee68cdd9463d5f520863d56caa336d06aead90a848e715ab64e11e469e' - '94740af15d3bc8c1f85a3ced7bd9d8e49e93604f8cdcae435ce0669aa01dc12e' - '51118597719e81c5b2a8a49626866c6c2356d5a56901747a848903e217d0ab6e') + '3fc6704e75bd93ae6551448e3a9761918069786ff84ecb114831e45e5fd06c35' + '43a92df715dfdfdcc09294bc8c663bfc1b81c8712ef1f71f350c8b880ec714e8' + 'e9b58e4554d498003c7df9656e50147a30a76b5f102577763a8f79dac78f5236' + '3fc6704e75bd93ae6551448e3a9761918069786ff84ecb114831e45e5fd06c35' + '3f61530d96c6f2de5a6dd05db63f2e89edcdc3b061ee54cf66c4d69666405809') prepare() { - mv "${srcdir}/${_realname}-${_commit}" "${srcdir}/${_realname}-${pkgver}" cd "${srcdir}/${_realname}-${pkgver}" patch -p1 -i ${srcdir}/0026-create-argb-fonts.all.patch - patch -p1 -i ${srcdir}/0030-ucrt-clang-fixes.patch - # https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/302 - patch -p1 -i ${srcdir}/302.patch - - # https://gitlab.freedesktop.org/cairo/cairo/-/issues/632 - patch -p1 -i ${srcdir}/0002-fix-dwrite-font-crash.patch + # https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/441 + patch -p1 -i "${srcdir}/71eb6396c497541118d4c85f97cb9d05aeb94a7e.patch" + # https://gitlab.freedesktop.org/cairo/cairo/-/issues/634 + patch -p1 -i "${srcdir}/5e42a5277eddafd312a73e355d7775a4401dae4e.patch" + # https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/451 + patch -p1 -i "${srcdir}/db4c941c34617c1a1ee0519387b94936491fa860.patch" - # https://gitlab.freedesktop.org/cairo/cairo/-/commit/1cc23206bde186d4aef948bba11e591120c99dcd - patch -p1 -i ${srcdir}/0001-Fix-scaled_glyph-hash-lookup-on-Win64.patch + # https://gitlab.freedesktop.org/cairo/cairo/-/issues/637#note_1762681 + patch -R -p1 -i "${srcdir}/b1bc11f646a5345e61ebd5c58305c536bd6a4207.patch" + + # https://gitlab.freedesktop.org/cairo/cairo/-/issues/637#note_1760511 + patch -p1 -i "${srcdir}/0040-revert-dwrite-measuring-default.patch" } build() { @@ -66,7 +70,7 @@ build() { cd build-${MINGW_CHOST} MSYS2_ARG_CONV_EXCL="--prefix=" \ - ${MINGW_PREFIX}/bin/meson \ + ${MINGW_PREFIX}/bin/meson setup \ --prefix=${MINGW_PREFIX} \ --buildtype=plain \ --wrap-mode=nofallback \ @@ -74,7 +78,6 @@ build() { -Dauto_features=enabled \ -Dxlib=disabled \ -Dxcb=disabled \ - -Dgl-backend=disabled \ -Dtests=disabled \ -Dspectre=disabled \ -Dtee=enabled \