From 87a4391698f02bc84f9979286a57410c37709292 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 15 Jul 2022 06:17:33 +0530 Subject: [PATCH] meson: Fix compile failures on macOS in harfbuzz and pango These patches are taken from upstream, and they fix compile failures with latest clang. These can be dropped when upgrading these wraps. This is currently causing a warning because we do not require the version of meson that ships with this feature: 0.63.0. The version has not been bumped because older Meson versions gracefully ignore the wrap field, this fix is optional and only needed on macOS, and 0.63.0 is a very new release with a bug that partially breaks this feature: https://github.com/mesonbuild/meson/pull/10602 We can consider bumping the requirement once 0.63.1 is released. Also switch from git to tarballs, no reason to use git here anymore. Part-of: --- subprojects/harfbuzz.wrap | 10 ++--- ...ariable-supp_size-from-plan_subset_e.patch | 42 +++++++++++++++++++ ...001-Coretext-fix-clang-build-failure.patch | 30 +++++++++++++ subprojects/pango.wrap | 10 +++-- 4 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 subprojects/packagefiles/harfbuzz-2.8.2/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch create mode 100644 subprojects/packagefiles/pango-1.48.9/0001-Coretext-fix-clang-build-failure.patch diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap index f7f31732d1..6ca329730c 100644 --- a/subprojects/harfbuzz.wrap +++ b/subprojects/harfbuzz.wrap @@ -1,6 +1,6 @@ [wrap-git] -directory=harfbuzz -url=https://github.com/harfbuzz/harfbuzz.git -push-url=git@github.com:harfbuzz/harfbuzz.git -revision=2.8.1 -depth=1 +directory = harfbuzz-2.8.2 +source_url = https://github.com/harfbuzz/harfbuzz/releases/download/2.8.2/harfbuzz-2.8.2.tar.xz +source_filename = harfbuzz-2.8.2.tar.xz +source_hash = d58461395ce28b9dc03903254374dd70c38c8c28c5046db123c08f7ab9417be7 +diff_files = harfbuzz-2.8.2/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch diff --git a/subprojects/packagefiles/harfbuzz-2.8.2/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch b/subprojects/packagefiles/harfbuzz-2.8.2/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch new file mode 100644 index 0000000000..df9747c667 --- /dev/null +++ b/subprojects/packagefiles/harfbuzz-2.8.2/0001-Removed-unused-variable-supp_size-from-plan_subset_e.patch @@ -0,0 +1,42 @@ +From 243d056ff1c2af583ceb67e5dfbfaac51dc96e63 Mon Sep 17 00:00:00 2001 +From: Andi-Bogdan Postelnicu +Date: Wed, 2 Jun 2021 14:08:11 +0300 +Subject: [PATCH] Removed unused variable `supp_size` from + plan_subset_encoding(...). + +--- + src/hb-subset-cff1.cc | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc +index df322f845..35dae7b1f 100644 +--- a/src/hb-subset-cff1.cc ++++ b/src/hb-subset-cff1.cc +@@ -402,7 +402,7 @@ struct cff_subset_plan { + void plan_subset_encoding (const OT::cff1::accelerator_subset_t &acc, hb_subset_plan_t *plan) + { + const Encoding *encoding = acc.encoding; +- unsigned int size0, size1, supp_size; ++ unsigned int size0, size1; + hb_codepoint_t code, last_code = CFF_UNDEF_CODE; + hb_vector_t supp_codes; + +@@ -412,7 +412,6 @@ struct cff_subset_plan { + return; + } + +- supp_size = 0; + supp_codes.init (); + + subset_enc_num_codes = plan->num_output_glyphs () - 1; +@@ -448,7 +447,6 @@ struct cff_subset_plan { + code_pair_t pair = { supp_codes[i], sid }; + subset_enc_supp_codes.push (pair); + } +- supp_size += SuppEncoding::static_size * supp_codes.length; + } + } + supp_codes.fini (); +-- +2.32.1 (Apple Git-133) + diff --git a/subprojects/packagefiles/pango-1.48.9/0001-Coretext-fix-clang-build-failure.patch b/subprojects/packagefiles/pango-1.48.9/0001-Coretext-fix-clang-build-failure.patch new file mode 100644 index 0000000000..1ddd400e1e --- /dev/null +++ b/subprojects/packagefiles/pango-1.48.9/0001-Coretext-fix-clang-build-failure.patch @@ -0,0 +1,30 @@ +From 9093ffd69850b630622a3fc8dcf09c45c51ae2f9 Mon Sep 17 00:00:00 2001 +From: John Ralls +Date: Tue, 22 Mar 2022 12:09:09 -0700 +Subject: [PATCH] Coretext: fix clang build failure. + +Recent versions of clang notice that pango_core_text_fontset_load_font's +`key` local variable isn't used and errors out. Remove it. +--- + pango/pangocoretext-fontmap.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c +index 40e62eed..e090bfc4 100644 +--- a/pango/pangocoretext-fontmap.c ++++ b/pango/pangocoretext-fontmap.c +@@ -1696,11 +1696,8 @@ static PangoFont * + pango_core_text_fontset_load_font (PangoCoreTextFontset *ctfontset, + CTFontDescriptorRef ctdescriptor) + { +- PangoCoreTextFontsetKey *key; + PangoCoreTextFont *font; + +- key = pango_core_text_fontset_get_key (ctfontset); +- + /* For now, we will default the fallbacks to not have synthetic italic, + * in the future this may be improved. + */ +-- +2.32.1 (Apple Git-133) + diff --git a/subprojects/pango.wrap b/subprojects/pango.wrap index 7da354c912..0f5b8b480a 100644 --- a/subprojects/pango.wrap +++ b/subprojects/pango.wrap @@ -1,4 +1,6 @@ -[wrap-git] -url=https://gitlab.gnome.org/GNOME/pango.git -push-url=git@gitlab.gnome.org:GNOME/pango.git -revision=1.48.7 +[wrap-file] +directory = pango-1.48.11 +source_url = https://download.gnome.org/sources/pango/1.48/pango-1.48.11.tar.xz +source_filename = pango-1.48.11.tar.xz +source_hash = 084fd0a74fad05b1b299d194a7366b6593063d370b40272a5d3a1888ceb9ac40 +diff_files = pango-1.48.11/0001-Coretext-fix-clang-build-failure.patch