commit f860d53fa8fc2746862079cba30bcc65eda15ad9
Author: Tom Callaway <spot(a)fedoraproject.org>
Date: Tue Nov 6 10:21:34 2018 -0500
fix build with harfbuzz2 in rawhide
Signed-off-by: Akarshan Biswas <akarshan.biswas(a)protonmail.com>
chromium-70.0.3538.77-harfbuzz2-fix.patch | 80 +++++++++++++++++++++++++++++++
chromium-freeworld.spec | 12 ++++-
2 files changed, 91 insertions(+), 1 deletion(-)
---
diff --git a/chromium-70.0.3538.77-harfbuzz2-fix.patch
b/chromium-70.0.3538.77-harfbuzz2-fix.patch
new file mode 100644
index 0000000..2d5602d
--- /dev/null
+++ b/chromium-70.0.3538.77-harfbuzz2-fix.patch
@@ -0,0 +1,80 @@
+From 7ae38170a117e909bb28e1470842b68de3501197 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppymaster(a)gmail.com>
+Date: Sun, 21 Oct 2018 10:06:53 -0400
+Subject: [PATCH] blink: add 'const' modifier for harfbuzz hb_codepoint_t
+ pointers
+
+This resolves a build failure against harfbuzz 2.0.
+
+Based on a patch by Alexandre Fierreira.
+
+Bug:
https://bugs.gentoo.org/669034
+---
+ .../renderer/platform/fonts/shaping/harfbuzz_face.cc | 2 +-
+ .../renderer/platform/fonts/skia/skia_text_metrics.cc | 9 +++++++--
+ .../renderer/platform/fonts/skia/skia_text_metrics.h | 2 +-
+ 3 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
+index 8e7d91ca371f..e279a5876cb3 100644
+--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
++++ b/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,
+diff --git a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
+index 77ec6209fab9..9f9070921448 100644
+--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
++++ b/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<T*>(reinterpret_cast<uint8_t*>(p) + byte_size);
+ }
+
++template <class T>
++T* advance_by_byte_size_const(T* p, unsigned byte_size) {
++ return reinterpret_cast<T*>(reinterpret_cast<const uint8_t*>(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, 256> 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<SkScalar, 256> sk_width_array(count);
+diff --git a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
+index 787d8af0375a..3bc4407c641b 100644
+--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
++++ b/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);
+--
+2.19.1
+
diff --git a/chromium-freeworld.spec b/chromium-freeworld.spec
index b348a4b..f432195 100644
--- a/chromium-freeworld.spec
+++ b/chromium-freeworld.spec
@@ -146,7 +146,7 @@ Name: chromium%{chromium_channel}%{?freeworld:-freeworld}
Name: chromium%{chromium_channel}
%endif
Version: %{majorversion}.0.3538.77
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A WebKit (Blink) powered web browser
Url:
http://www.chromium.org/Home
License: BSD and LGPLv2+ and ASL 2.0 and IJG and MIT and GPLv2+ and ISC and OpenSSL and
(MPLv1.1 or GPLv2 or LGPLv2)
@@ -283,6 +283,9 @@ Patch115: chromium-gcc8-r589614.patch
Patch116: chromium-gcc8-r591015.patch
# Disable fontconfig cache magic that breaks remoting
Patch117: chromium-70.0.3538.67-disable-fontconfig-cache-magic.patch
+# Fix build against harfbuzz2
+Patch118: chromium-70.0.3538.77-harfbuzz2-fix.patch
+
# Use chromium-latest.py to generate clean tarball from released build tarballs, found
here:
#
http://build.chromium.org/buildbot/official/
@@ -824,6 +827,10 @@ udev.
%patch115 -p1 -b .r589614
%patch116 -p1 -b .r591015
%patch117 -p1 -b .nofc
+%if 0%{?fedora} >= 30
+%patch118 -p1 -b .harfbuzz2
+%endif
+
# Change shebang in all relevant files in this directory and all subdirectories
# See `man find` for how the `-exec command {} +` syntax works
@@ -1790,6 +1797,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r
chrome-remote-deskt
%changelog
+* Tue Nov 6 2018 Tom Callaway <spot(a)fedoraproject.org> - 70.0.3538.77-3
+- fix build with harfbuzz2 in rawhide
+
* Mon Nov 5 2018 Tom Callaway <spot(a)fedoraproject.org> - 70.0.3538.77-2
- drop jumbo_file_merge_limit to 8 to (hopefully) avoid OOMs on aarch64