Browse Source

Adds patch resolving a build failure against harfbuzz 2.0

Based on https://bugs.gentoo.org/669034
Seppia 6 years ago
parent
commit
395d5745a5
3 changed files with 63 additions and 2 deletions
  1. 2 0
      .SRCINFO
  2. 6 2
      PKGBUILD
  3. 55 0
      chromium-harfbuzz-2.0.patch

+ 2 - 0
.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
 

+ 6 - 2
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'

+ 55 - 0
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<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);
+--- 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);
+--