commit:     71fefc9233564d56103ad143ff8e768d18bcf89b
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 21 15:16:26 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Oct 21 15:17:02 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71fefc92

www-client/chromium: fix build with harfbuzz-2

Bug: https://bugs.gentoo.org/669034
Package-Manager: Portage-2.3.51_p1, Repoman-2.3.11_p26
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 ...8.67.ebuild => chromium-70.0.3538.67-r1.ebuild} |  5 +-
 www-client/chromium/chromium-70.0.3538.67.ebuild   |  3 +-
 .../chromium/files/chromium-harfbuzz-r0.patch      | 80 ++++++++++++++++++++++
 3 files changed, 85 insertions(+), 3 deletions(-)

diff --git a/www-client/chromium/chromium-70.0.3538.67.ebuild 
b/www-client/chromium/chromium-70.0.3538.67-r1.ebuild
similarity index 99%
copy from www-client/chromium/chromium-70.0.3538.67.ebuild
copy to www-client/chromium/chromium-70.0.3538.67-r1.ebuild
index 8e3b1d83b85..6d86b451b47 100644
--- a/www-client/chromium/chromium-70.0.3538.67.ebuild
+++ b/www-client/chromium/chromium-70.0.3538.67-r1.ebuild
@@ -16,7 +16,7 @@ 
SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}
 
 LICENSE="BSD"
 SLOT="0"
-KEYWORDS="amd64 ~x86"
+KEYWORDS="~amd64 ~x86"
 IUSE="component-build cups gnome-keyring +hangouts jumbo-build kerberos neon 
pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu 
+system-libvpx +tcmalloc widevine"
 RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
 
@@ -37,7 +37,7 @@ COMMON_DEPEND="
        >=media-libs/alsa-lib-1.0.19:=
        media-libs/fontconfig:=
        media-libs/freetype:=
-       >=media-libs/harfbuzz-1.8.8:=[icu(-)]
+       >=media-libs/harfbuzz-2.0.0:0=[icu(-)]
        media-libs/libjpeg-turbo:=
        media-libs/libpng:=
        system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
@@ -142,6 +142,7 @@ PATCHES=(
        "${FILESDIR}/chromium-math.h-r0.patch"
        "${FILESDIR}/chromium-stdint.patch"
        "${FILESDIR}/chromium-pdfium-stdlib-r0.patch"
+       "${FILESDIR}/chromium-harfbuzz-r0.patch"
 )
 
 pre_build_checks() {

diff --git a/www-client/chromium/chromium-70.0.3538.67.ebuild 
b/www-client/chromium/chromium-70.0.3538.67.ebuild
index 8e3b1d83b85..5bcc2602215 100644
--- a/www-client/chromium/chromium-70.0.3538.67.ebuild
+++ b/www-client/chromium/chromium-70.0.3538.67.ebuild
@@ -37,7 +37,8 @@ COMMON_DEPEND="
        >=media-libs/alsa-lib-1.0.19:=
        media-libs/fontconfig:=
        media-libs/freetype:=
-       >=media-libs/harfbuzz-1.8.8:=[icu(-)]
+       >=media-libs/harfbuzz-1.8.8:0=[icu(-)]
+       <media-libs/harfbuzz-2.0.0:0
        media-libs/libjpeg-turbo:=
        media-libs/libpng:=
        system-libvpx? ( media-libs/libvpx:=[postproc,svc] )

diff --git a/www-client/chromium/files/chromium-harfbuzz-r0.patch 
b/www-client/chromium/files/chromium-harfbuzz-r0.patch
new file mode 100644
index 00000000000..2d5602de280
--- /dev/null
+++ b/www-client/chromium/files/chromium-harfbuzz-r0.patch
@@ -0,0 +1,80 @@
+From 7ae38170a117e909bb28e1470842b68de3501197 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppymas...@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
+

Reply via email to