Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/files/, www-client/chromium/
Date: Sun, 21 Oct 2018 15:17:14
Message-Id: 1540135022.71fefc9233564d56103ad143ff8e768d18bcf89b.floppym@gentoo
1 commit: 71fefc9233564d56103ad143ff8e768d18bcf89b
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 21 15:16:26 2018 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 21 15:17:02 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71fefc92
7
8 www-client/chromium: fix build with harfbuzz-2
9
10 Bug: https://bugs.gentoo.org/669034
11 Package-Manager: Portage-2.3.51_p1, Repoman-2.3.11_p26
12 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
13
14 ...8.67.ebuild => chromium-70.0.3538.67-r1.ebuild} | 5 +-
15 www-client/chromium/chromium-70.0.3538.67.ebuild | 3 +-
16 .../chromium/files/chromium-harfbuzz-r0.patch | 80 ++++++++++++++++++++++
17 3 files changed, 85 insertions(+), 3 deletions(-)
18
19 diff --git a/www-client/chromium/chromium-70.0.3538.67.ebuild b/www-client/chromium/chromium-70.0.3538.67-r1.ebuild
20 similarity index 99%
21 copy from www-client/chromium/chromium-70.0.3538.67.ebuild
22 copy to www-client/chromium/chromium-70.0.3538.67-r1.ebuild
23 index 8e3b1d83b85..6d86b451b47 100644
24 --- a/www-client/chromium/chromium-70.0.3538.67.ebuild
25 +++ b/www-client/chromium/chromium-70.0.3538.67-r1.ebuild
26 @@ -16,7 +16,7 @@ SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}
27
28 LICENSE="BSD"
29 SLOT="0"
30 -KEYWORDS="amd64 ~x86"
31 +KEYWORDS="~amd64 ~x86"
32 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"
33 RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
34
35 @@ -37,7 +37,7 @@ COMMON_DEPEND="
36 >=media-libs/alsa-lib-1.0.19:=
37 media-libs/fontconfig:=
38 media-libs/freetype:=
39 - >=media-libs/harfbuzz-1.8.8:=[icu(-)]
40 + >=media-libs/harfbuzz-2.0.0:0=[icu(-)]
41 media-libs/libjpeg-turbo:=
42 media-libs/libpng:=
43 system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
44 @@ -142,6 +142,7 @@ PATCHES=(
45 "${FILESDIR}/chromium-math.h-r0.patch"
46 "${FILESDIR}/chromium-stdint.patch"
47 "${FILESDIR}/chromium-pdfium-stdlib-r0.patch"
48 + "${FILESDIR}/chromium-harfbuzz-r0.patch"
49 )
50
51 pre_build_checks() {
52
53 diff --git a/www-client/chromium/chromium-70.0.3538.67.ebuild b/www-client/chromium/chromium-70.0.3538.67.ebuild
54 index 8e3b1d83b85..5bcc2602215 100644
55 --- a/www-client/chromium/chromium-70.0.3538.67.ebuild
56 +++ b/www-client/chromium/chromium-70.0.3538.67.ebuild
57 @@ -37,7 +37,8 @@ COMMON_DEPEND="
58 >=media-libs/alsa-lib-1.0.19:=
59 media-libs/fontconfig:=
60 media-libs/freetype:=
61 - >=media-libs/harfbuzz-1.8.8:=[icu(-)]
62 + >=media-libs/harfbuzz-1.8.8:0=[icu(-)]
63 + <media-libs/harfbuzz-2.0.0:0
64 media-libs/libjpeg-turbo:=
65 media-libs/libpng:=
66 system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
67
68 diff --git a/www-client/chromium/files/chromium-harfbuzz-r0.patch b/www-client/chromium/files/chromium-harfbuzz-r0.patch
69 new file mode 100644
70 index 00000000000..2d5602de280
71 --- /dev/null
72 +++ b/www-client/chromium/files/chromium-harfbuzz-r0.patch
73 @@ -0,0 +1,80 @@
74 +From 7ae38170a117e909bb28e1470842b68de3501197 Mon Sep 17 00:00:00 2001
75 +From: Mike Gilbert <floppymaster@×××××.com>
76 +Date: Sun, 21 Oct 2018 10:06:53 -0400
77 +Subject: [PATCH] blink: add 'const' modifier for harfbuzz hb_codepoint_t
78 + pointers
79 +
80 +This resolves a build failure against harfbuzz 2.0.
81 +
82 +Based on a patch by Alexandre Fierreira.
83 +
84 +Bug: https://bugs.gentoo.org/669034
85 +---
86 + .../renderer/platform/fonts/shaping/harfbuzz_face.cc | 2 +-
87 + .../renderer/platform/fonts/skia/skia_text_metrics.cc | 9 +++++++--
88 + .../renderer/platform/fonts/skia/skia_text_metrics.h | 2 +-
89 + 3 files changed, 9 insertions(+), 4 deletions(-)
90 +
91 +diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
92 +index 8e7d91ca371f..e279a5876cb3 100644
93 +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
94 ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
95 +@@ -139,7 +139,7 @@ static hb_position_t HarfBuzzGetGlyphHorizontalAdvance(hb_font_t* hb_font,
96 + static void HarfBuzzGetGlyphHorizontalAdvances(hb_font_t* font,
97 + void* font_data,
98 + unsigned count,
99 +- hb_codepoint_t* first_glyph,
100 ++ const hb_codepoint_t* first_glyph,
101 + unsigned int glyph_stride,
102 + hb_position_t* first_advance,
103 + unsigned int advance_stride,
104 +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
105 +index 77ec6209fab9..9f9070921448 100644
106 +--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
107 ++++ b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
108 +@@ -18,6 +18,11 @@ T* advance_by_byte_size(T* p, unsigned byte_size) {
109 + return reinterpret_cast<T*>(reinterpret_cast<uint8_t*>(p) + byte_size);
110 + }
111 +
112 ++template <class T>
113 ++T* advance_by_byte_size_const(T* p, unsigned byte_size) {
114 ++ return reinterpret_cast<T*>(reinterpret_cast<const uint8_t*>(p) + byte_size);
115 ++}
116 ++
117 + } // namespace
118 +
119 + SkiaTextMetrics::SkiaTextMetrics(const SkPaint* paint) : paint_(paint) {
120 +@@ -39,7 +44,7 @@ void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(hb_codepoint_t codepoint,
121 + }
122 +
123 + void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(unsigned count,
124 +- hb_codepoint_t* glyphs,
125 ++ const hb_codepoint_t* glyphs,
126 + unsigned glyph_stride,
127 + hb_position_t* advances,
128 + unsigned advance_stride) {
129 +@@ -48,7 +53,7 @@ void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(unsigned count,
130 + // array that copy them to a regular array.
131 + Vector<Glyph, 256> glyph_array(count);
132 + for (unsigned i = 0; i < count;
133 +- i++, glyphs = advance_by_byte_size(glyphs, glyph_stride)) {
134 ++ i++, glyphs = advance_by_byte_size_const(glyphs, glyph_stride)) {
135 + glyph_array[i] = *glyphs;
136 + }
137 + Vector<SkScalar, 256> sk_width_array(count);
138 +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
139 +index 787d8af0375a..3bc4407c641b 100644
140 +--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
141 ++++ b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
142 +@@ -19,7 +19,7 @@ class SkiaTextMetrics final {
143 +
144 + void GetGlyphWidthForHarfBuzz(hb_codepoint_t, hb_position_t* width);
145 + void GetGlyphWidthForHarfBuzz(unsigned count,
146 +- hb_codepoint_t* first_glyph,
147 ++ const hb_codepoint_t* first_glyph,
148 + unsigned glyph_stride,
149 + hb_position_t* first_advance,
150 + unsigned advance_stride);
151 +--
152 +2.19.1
153 +