From 31e8f84408519633fb141d64ee118621c8eaa041 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sat, 7 Oct 2023 07:25:26 +0000 Subject: [PATCH] pango: update to 1.51.0 Remove upstream patches --- ...Write-Check-length-of-the-font-table.patch | 69 ------------------- mingw-w64-pango/693.patch | 40 ----------- mingw-w64-pango/694.patch | 36 ---------- mingw-w64-pango/PKGBUILD | 20 ++---- 4 files changed, 4 insertions(+), 161 deletions(-) delete mode 100644 mingw-w64-pango/0001-DWrite-Check-length-of-the-font-table.patch delete mode 100644 mingw-w64-pango/693.patch delete mode 100644 mingw-w64-pango/694.patch diff --git a/mingw-w64-pango/0001-DWrite-Check-length-of-the-font-table.patch b/mingw-w64-pango/0001-DWrite-Check-length-of-the-font-table.patch deleted file mode 100644 index 1cafeb465c..0000000000 --- a/mingw-w64-pango/0001-DWrite-Check-length-of-the-font-table.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 6d8e0e28956840759553372fbe604ac7e93563c4 Mon Sep 17 00:00:00 2001 -From: Luca Bacci -Date: Tue, 18 Apr 2023 19:16:27 +0200 -Subject: [PATCH] DWrite: Check length of the font table - -Improved patch - -Fixes https://gitlab.com/inkscape/inkscape/-/issues/4224 ---- - pango/pangowin32-dwrite-fontmap.cpp | 24 +++++++++++++++++++----- - 1 file changed, 19 insertions(+), 5 deletions(-) - -diff --git a/pango/pangowin32-dwrite-fontmap.cpp b/pango/pangowin32-dwrite-fontmap.cpp -index 2db0972a..8aeee338 100644 ---- a/pango/pangowin32-dwrite-fontmap.cpp -+++ b/pango/pangowin32-dwrite-fontmap.cpp -@@ -499,7 +499,13 @@ pango_win32_dwrite_font_check_is_hinted (PangoWin32Font *font) - - if (dwrite_font_face != NULL) - { -- UINT32 gasp_tag = DWRITE_MAKE_OPENTYPE_TAG ('g', 'a', 's', 'p'); -+ const UINT32 gasp_tag = DWRITE_MAKE_OPENTYPE_TAG ('g', 'a', 's', 'p'); -+ /* The The 'gasp' table consists of a header (4 bytes) followed -+ * by a sequence of fixed-size entries (4 bytes each) */ -+ /* header: struct { ushort version; ushort numRanges; } */ -+ const UINT32 TABLE_HEADER_SIZE = 4; -+ /* entry: struct { ushort rangeMaxPPEM; ushort rangeGaspBehavior; } */ -+ const UINT32 TABLE_ENTRY_SIZE = 4; - UINT32 table_size; - const unsigned short *table_data; - void *table_ctx; -@@ -512,22 +518,30 @@ pango_win32_dwrite_font_check_is_hinted (PangoWin32Font *font) - &table_ctx, - &exists))) - { -- if (exists) -+ if (exists && table_size > TABLE_HEADER_SIZE) - { - guint16 version = DWRITE_NEXT_USHORT (table_data); - - if (version == 0 || version == 1) - { - guint16 num_ranges = DWRITE_NEXT_USHORT (table_data); -- guint16 i; -+ UINT32 max_ranges = (table_size - TABLE_HEADER_SIZE) / TABLE_ENTRY_SIZE; -+ guint16 i = 0; - -- for (i = 0; !result && i < num_ranges && i < (table_size / sizeof (guint16)); i ++) -+ if (num_ranges > max_ranges) -+ num_ranges = max_ranges; -+ -+ for (i = 0; i < num_ranges; i++) - { -+ G_GNUC_UNUSED - guint16 ppem = DWRITE_NEXT_USHORT (table_data); - guint16 behavior = DWRITE_NEXT_USHORT (table_data); - - if (behavior & (GASP_GRIDFIT | GASP_SYMMETRIC_GRIDFIT)) -- result = TRUE; -+ { -+ result = TRUE; -+ break; -+ } - } - } - } --- -2.39.1.windows.1 - diff --git a/mingw-w64-pango/693.patch b/mingw-w64-pango/693.patch deleted file mode 100644 index f5a1ffda57..0000000000 --- a/mingw-w64-pango/693.patch +++ /dev/null @@ -1,40 +0,0 @@ -From a31602144ff6fc05ff2a26e3c78d618896dc45e5 Mon Sep 17 00:00:00 2001 -From: Chun-wei Fan -Date: Wed, 10 May 2023 12:33:14 +0800 -Subject: [PATCH] pangocairo-win32font.c: Work around Cairo API becoming C++ - -Without adding a small C++ source file in order to include cairo-dwrite.h, -where cairo_dwrite_font_face_create_for_dwrite_fontface() now resides and have -thus become a C++ API, work around this by adding a wrapper prototype for our -own purposes so that we can continue to call that function directly from C. ---- - pango/pangocairo-win32font.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c -index 9d52dbcf3..74dfeab1e 100644 ---- a/pango/pangocairo-win32font.c -+++ b/pango/pangocairo-win32font.c -@@ -32,6 +32,19 @@ - - #include - -+#if defined (HAVE_CAIRO_WIN32_DIRECTWRITE) && \ -+ ((CAIRO_VERSION_MAJOR > 1) || \ -+ (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR > 17) || \ -+ (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR == 17 && CAIRO_VERSION_MICRO > 6)) -+/* -+ * We are using C here, so use a workaround as cairo-dwrite.h from 1.17.8 -+ * can only be used in C++, which replaces the C-friendly version of -+ * cairo_dwrite_font_face_create_for_dwrite_fontface() -+ */ -+extern cairo_font_face_t * -+cairo_dwrite_font_face_create_for_dwrite_fontface (void *dwrite_font_face); -+#endif -+ - #define PANGO_TYPE_CAIRO_WIN32_FONT (pango_cairo_win32_font_get_type ()) - #define PANGO_CAIRO_WIN32_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32Font)) - #define PANGO_CAIRO_WIN32_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CAIRO_WIN32_FONT, PangoCairoWin32FontClass)) --- -GitLab - diff --git a/mingw-w64-pango/694.patch b/mingw-w64-pango/694.patch deleted file mode 100644 index 01119cb276..0000000000 --- a/mingw-w64-pango/694.patch +++ /dev/null @@ -1,36 +0,0 @@ -From b4c5e9ff7e5c0b70b8a4549fc89931b58034c426 Mon Sep 17 00:00:00 2001 -From: Seungha Yang -Date: Fri, 26 May 2023 20:23:47 +0900 -Subject: [PATCH] win32: Fix 32bit build crash on DeleteDC() - -Calling convention mismatch will result in crash or so - -Fixes: https://gitlab.gnome.org/GNOME/pango/-/issues/749 ---- - pango/pangowin32.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/pango/pangowin32.c b/pango/pangowin32.c -index 7b6325a5c..4e9dc6c44 100644 ---- a/pango/pangowin32.c -+++ b/pango/pangowin32.c -@@ -126,7 +126,15 @@ _pango_win32_font_init (PangoWin32Font *win32font) - win32font->glyph_info = g_hash_table_new_full (NULL, NULL, NULL, g_free); - } - --static GPrivate display_dc_key = G_PRIVATE_INIT ((GDestroyNotify) DeleteDC); -+static void -+_delete_dc (HDC dc) -+{ -+ /* Don't pass DeleteDC func pointer to the GDestroyNotify. -+ * 32bit build requires matching calling convention (__cdecl vs __stdcall) */ -+ DeleteDC (dc); -+} -+ -+static GPrivate display_dc_key = G_PRIVATE_INIT ((GDestroyNotify) _delete_dc); - static GPrivate dwrite_items = G_PRIVATE_INIT ((GDestroyNotify) pango_win32_dwrite_items_destroy); - - HDC --- -GitLab - diff --git a/mingw-w64-pango/PKGBUILD b/mingw-w64-pango/PKGBUILD index ed286869b3..e36e77b6c9 100644 --- a/mingw-w64-pango/PKGBUILD +++ b/mingw-w64-pango/PKGBUILD @@ -5,8 +5,8 @@ _realname=pango pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-docs") -pkgver=1.50.14 -pkgrel=4 +pkgver=1.51.0 +pkgrel=1 pkgdesc="A library for layout and rendering of text (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -26,24 +26,12 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-harfbuzz" "${MINGW_PACKAGE_PREFIX}-fribidi" "${MINGW_PACKAGE_PREFIX}-libthai") -options=('staticlibs' 'strip' 'emptydirs') -source=("https://download.gnome.org/sources/pango/${pkgver:0:4}/${_realname}-${pkgver}.tar.xz" - "0001-DWrite-Check-length-of-the-font-table.patch" - "https://gitlab.gnome.org/GNOME/pango/-/merge_requests/693.patch" - "https://gitlab.gnome.org/GNOME/pango/-/merge_requests/694.patch") -sha256sums=('1d67f205bfc318c27a29cfdfb6828568df566795df0cb51d2189cde7f2d581e8' - '9a21e1aa158610975922b355faa0a89908d5ad066284a749e05dda309d6f0776' - 'bcffc93e63b12c0d168e5694531e4122ff142dfbe475708573c1150b133c8636' - '44c1233b81ecab73947836012ccaff1b1a7e73245ba05b2c1a5dd17fcdc035aa') +source=("https://download.gnome.org/sources/pango/${pkgver:0:4}/${_realname}-${pkgver}.tar.xz") +sha256sums=('74efc109ae6f903bbe6af77eaa2ac6094b8ee245a2e23f132a7a8f0862d1a9f5') prepare() { cd "${srcdir}/${_realname}-${pkgver}" - # https://gitlab.gnome.org/GNOME/pango/-/merge_requests/689 - patch -p1 -i "${srcdir}/0001-DWrite-Check-length-of-the-font-table.patch" - - patch -p1 -i "${srcdir}/693.patch" - patch -p1 -i "${srcdir}/694.patch" } build() {