From 395d5745a540ee3e197834b7af6feb2fb094083e Mon Sep 17 00:00:00 2001 From: Seppia Date: Fri, 2 Nov 2018 11:45:50 +0100 Subject: Adds patch resolving a build failure against harfbuzz 2.0 Based on https://bugs.gentoo.org/669034 --- .SRCINFO | 2 ++ PKGBUILD | 8 +++++-- chromium-harfbuzz-2.0.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 chromium-harfbuzz-2.0.patch diff --git a/.SRCINFO b/.SRCINFO index 995e103..5d865aa 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -61,9 +61,11 @@ pkgbase = ungoogled-chromium source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-70.0.3538.77.tar.xz source = chromium-launcher-6.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v6.tar.gz source = https://github.com/Eloston/ungoogled-chromium/archive/70.0.3538.77-1.tar.gz + source = chromium-harfbuzz-2.0.patch sha256sums = c914f86c4c8375b719eca89ea89dbec4ae3d09df3f758d5f7c91d4914d290449 sha256sums = 04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1 sha256sums = 9731ddfc654bd74d2da26ccecdbe9262aed7f3ff6ad5b91571ae4b83ecf19159 + sha256sums = bad4d4a3065f1432d5f9189e29c6bf1d7fe1d365b6c7c4ff51b294569b20e962 pkgname = ungoogled-chromium diff --git a/PKGBUILD b/PKGBUILD index ae1dd73..5421b57 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -26,10 +26,12 @@ provides=('chromium') conflicts=('chromium') source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz - https://github.com/Eloston/ungoogled-chromium/archive/$pkgver-$pkgrel.tar.gz) + https://github.com/Eloston/ungoogled-chromium/archive/$pkgver-$pkgrel.tar.gz + chromium-harfbuzz-2.0.patch) sha256sums=('c914f86c4c8375b719eca89ea89dbec4ae3d09df3f758d5f7c91d4914d290449' '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1' - '9731ddfc654bd74d2da26ccecdbe9262aed7f3ff6ad5b91571ae4b83ecf19159') + '9731ddfc654bd74d2da26ccecdbe9262aed7f3ff6ad5b91571ae4b83ecf19159' + 'bad4d4a3065f1432d5f9189e29c6bf1d7fe1d365b6c7c4ff51b294569b20e962') # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py # Keys are the names in the above script; values are the dependencies in Arch @@ -66,6 +68,8 @@ prepare() { cd "$srcdir/chromium-$pkgver" + patch -Np1 -i ../chromium-harfbuzz-2.0.patch + msg2 'Pruning binaries' python "$_buildkit_cli" prune -b "$_config_bundle" ./ msg2 'Applying patches' diff --git a/chromium-harfbuzz-2.0.patch b/chromium-harfbuzz-2.0.patch new file mode 100644 index 0000000..bbf4d3d --- /dev/null +++ b/chromium-harfbuzz-2.0.patch @@ -0,0 +1,55 @@ +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -139,7 +139,7 @@ static hb_position_t HarfBuzzGetGlyphHorizontalAdvance(hb_font_t* hb_font, + static void HarfBuzzGetGlyphHorizontalAdvances(hb_font_t* font, + void* font_data, + unsigned count, +- hb_codepoint_t* first_glyph, ++ const hb_codepoint_t* first_glyph, + unsigned int glyph_stride, + hb_position_t* first_advance, + unsigned int advance_stride, +--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc ++++ a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc +@@ -18,6 +18,11 @@ T* advance_by_byte_size(T* p, unsigned byte_size) { + return reinterpret_cast(reinterpret_cast(p) + byte_size); + } + ++template ++T* advance_by_byte_size_const(T* p, unsigned byte_size) { ++ return reinterpret_cast(reinterpret_cast(p) + byte_size); ++} ++ + } // namespace + + SkiaTextMetrics::SkiaTextMetrics(const SkPaint* paint) : paint_(paint) { +@@ -39,7 +44,7 @@ void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(hb_codepoint_t codepoint, + } + + void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(unsigned count, +- hb_codepoint_t* glyphs, ++ const hb_codepoint_t* glyphs, + unsigned glyph_stride, + hb_position_t* advances, + unsigned advance_stride) { +@@ -48,7 +53,7 @@ void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(unsigned count, + // array that copy them to a regular array. + Vector glyph_array(count); + for (unsigned i = 0; i < count; +- i++, glyphs = advance_by_byte_size(glyphs, glyph_stride)) { ++ i++, glyphs = advance_by_byte_size_const(glyphs, glyph_stride)) { + glyph_array[i] = *glyphs; + } + Vector sk_width_array(count); +--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h ++++ a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h +@@ -19,7 +19,7 @@ class SkiaTextMetrics final { + + void GetGlyphWidthForHarfBuzz(hb_codepoint_t, hb_position_t* width); + void GetGlyphWidthForHarfBuzz(unsigned count, +- hb_codepoint_t* first_glyph, ++ const hb_codepoint_t* first_glyph, + unsigned glyph_stride, + hb_position_t* first_advance, + unsigned advance_stride); +-- -- cgit v1.2.3