Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package nodejs-electron for openSUSE:Factory 
checked in at 2021-12-10 21:52:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-electron (Old)
 and      /work/SRC/openSUSE:Factory/.nodejs-electron.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nodejs-electron"

Fri Dec 10 21:52:23 2021 rev:13 rq:937741 version:13.6.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-electron/nodejs-electron.changes  
2021-12-02 02:18:41.585980919 +0100
+++ 
/work/SRC/openSUSE:Factory/.nodejs-electron.new.2520/nodejs-electron.changes    
    2021-12-10 21:52:27.970894715 +0100
@@ -1,0 +2,9 @@
+Wed Dec  8 23:33:01 UTC 2021 - Dominik Heidler <dheid...@suse.de>
+
+- Fix harfbuzz 3.0.0 related build fails
+  https://github.com/electron/electron/issues/31129
+  * Added skia_harfbuzz_roll.patch
+  * Added skia_harfbuzz_api.patch
+  * Added harfbuzz_roll.patch
+
+-------------------------------------------------------------------

New:
----
  harfbuzz_roll.patch
  skia_harfbuzz_api.patch
  skia_harfbuzz_roll.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nodejs-electron.spec ++++++
--- /var/tmp/diff_new_pack.J6JgWM/_old  2021-12-10 21:52:33.126896996 +0100
+++ /var/tmp/diff_new_pack.J6JgWM/_new  2021-12-10 21:52:33.130896998 +0100
@@ -100,6 +100,10 @@
 # Fix blink nodestructor
 Patch24:        electron-13-blink-gcc-ambiguous-nodestructor.patch
 Patch26:        a9831f1cbf93fb18dd951453635f488037454ce9.patch
+# Fix missing harfbuzz symbols
+Patch27:        skia_harfbuzz_roll.patch
+Patch28:        skia_harfbuzz_api.patch
+Patch29:        harfbuzz_roll.patch
 BuildRequires:  SDL-devel
 BuildRequires:  binutils-gold
 BuildRequires:  bison


++++++ harfbuzz_roll.patch ++++++
diff --git a/components/paint_preview/common/subset_font.cc 
b/components/paint_preview/common/subset_font.cc
index 8ff0540d9a913..20a7d374741b6 100644
--- a/components/paint_preview/common/subset_font.cc
+++ b/components/paint_preview/common/subset_font.cc
@@ -72,9 +72,11 @@ sk_sp<SkData> SubsetFont(SkTypeface* typeface, const 
GlyphUsage& usage) {
   hb_set_t* glyphs =
       hb_subset_input_glyph_set(input.get());  // Owned by |input|.
   usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs)));
-  hb_subset_input_set_retain_gids(input.get(), true);
+  hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
 
-  HbScoped<hb_face_t> subset_face(hb_subset(face.get(), input.get()));
+  HbScoped<hb_face_t> subset_face(hb_subset_or_fail(face.get(), input.get()));
+  if (!subset_face)
+    return nullptr;
   HbScoped<hb_blob_t> subset_blob(hb_face_reference_blob(subset_face.get()));
   if (!subset_blob)
     return nullptr;
diff --git a/third_party/harfbuzz-ng/BUILD.gn b/third_party/harfbuzz-ng/BUILD.gn
index be6f93b56915a..45630bc80e4bb 100644
--- a/third_party/harfbuzz-ng/BUILD.gn
+++ b/third_party/harfbuzz-ng/BUILD.gn
@@ -108,6 +108,8 @@ if (use_system_harfbuzz) {
       "src/src/hb-map.cc",
       "src/src/hb-map.hh",
       "src/src/hb-meta.hh",
+      "src/src/hb-ms-feature-ranges.cc",
+      "src/src/hb-ms-feature-ranges.hh",
       "src/src/hb-mutex.hh",
       "src/src/hb-number-parser.hh",
       "src/src/hb-number.cc",
@@ -159,6 +161,7 @@ if (use_system_harfbuzz) {
       "src/src/hb-ot-name.cc",
       "src/src/hb-ot-os2-unicode-ranges.hh",
       "src/src/hb-ot-post-macroman.hh",
+      "src/src/hb-ot-post-table-v2subset.hh",
       "src/src/hb-ot-shape-complex-arabic-fallback.hh",
       "src/src/hb-ot-shape-complex-arabic-joining-list.hh",
       "src/src/hb-ot-shape-complex-arabic-table.hh",
++++++ skia_harfbuzz_api.patch ++++++
>From 51d83abcd24aae1b2e8e653f26af531c58b59a45 Mon Sep 17 00:00:00 2001
From: Ben Wagner <bunge...@google.com>
Date: Thu, 5 Aug 2021 23:31:44 -0400
Subject: [PATCH] Ease HarfBuzz API change with feature detection

Skia has been using the not entirely public HarfBuzz subsetting API.
This API is changing for public release. In order to make the transition
from old to new build flags were added, which would require build
changes as HarfBuzz is updated downstream. Instead detect the existence
of the old or new API and use whichever is present automatically.

Change-Id: I0727f97ad7d394dfb24553076d4b383570cf0002
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437121
Reviewed-by: Garret Rieger <grie...@google.com>
Commit-Queue: Ben Wagner <bunge...@google.com>
---
 BUILD.gn                               |  3 --
 gn/gn_to_bp.py                         |  3 --
 gn/skia.gni                            |  1 -
 src/pdf/SkPDFSubsetFont.cpp            | 46 ++++++++++++++++++--------
 third_party/harfbuzz/config-override.h |  1 +
 5 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/BUILD.gn b/BUILD.gn
index f737ef039145..aeb46b466412 100644
--- a/third_party/skia/BUILD.gn
+++ b/third_party/skia/BUILD.gn
@@ -1047,9 +1047,6 @@ optional("pdf") {
   if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
     deps += [ "//third_party/harfbuzz" ]
     defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
-    if (skia_subset_harfbuzz_new_api) {
-      defines += [ "SK_HARFBUZZ_SUBSET_NEW_API" ]
-    }
   } else if (skia_use_icu && skia_use_sfntly) {
     deps += [ "//third_party/sfntly" ]
     defines = [ "SK_PDF_USE_SFNTLY" ]
diff --git a/gn/skia.gni b/gn/skia.gni
index fdb0935de96a..199335d5c404 100644
--- a/third_party/skia/gn/skia.gni
+++ b/third_party/skia/gn/skia.gni
@@ -99,7 +99,6 @@ declare_args() {
 
 declare_args() {
   skia_pdf_subset_harfbuzz = skia_use_harfbuzz
-  skia_subset_harfbuzz_new_api = !is_fuchsia
 }
 
 declare_args() {
diff --git a/src/pdf/SkPDFSubsetFont.cpp b/src/pdf/SkPDFSubsetFont.cpp
index 3289940c712e..2340a7937b77 100644
--- a/third_party/skia/src/pdf/SkPDFSubsetFont.cpp
+++ b/third_party/skia/src/pdf/SkPDFSubsetFont.cpp
@@ -49,6 +49,37 @@ static sk_sp<SkData> to_data(HBBlob blob) {
                                 blob.release());
 }
 
+template<typename...> using void_t = void;
+template<typename T, typename = void>
+struct SkPDFHarfBuzzSubset {
+    // This is the HarfBuzz 3.0 interface.
+    // hb_subset_flags_t does not exist in 2.0. It isn't dependent on T, so 
inline the value of
+    // HB_SUBSET_FLAGS_RETAIN_GIDS until 2.0 is no longer supported.
+    static HBFace Make(T input, hb_face_t* face) {
+        // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
+        // If it isn't known if a font is 'tricky', retain the hints.
+        hb_subset_input_set_flags(input, 2/*HB_SUBSET_FLAGS_RETAIN_GIDS*/);
+        return HBFace(hb_subset_or_fail(face, input));
+    }
+};
+template<typename T>
+struct SkPDFHarfBuzzSubset<T, void_t<
+    decltype(hb_subset_input_set_retain_gids(std::declval<T>(), 
std::declval<bool>())),
+    decltype(hb_subset_input_set_drop_hints(std::declval<T>(), 
std::declval<bool>())),
+    decltype(hb_subset(std::declval<hb_face_t*>(), std::declval<T>()))
+    >>
+{
+    // This is the HarfBuzz 2.0 (non-public) interface, used if it exists.
+    // This code should be removed as soon as all users are migrated to the 
newer API.
+    static HBFace Make(T input, hb_face_t* face) {
+        hb_subset_input_set_retain_gids(input, true);
+        // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
+        // If it isn't known if a font is 'tricky', retain the hints.
+        hb_subset_input_set_drop_hints(input, false);
+        return HBFace(hb_subset(face, input));
+    }
+};
+
 static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
                                      const SkPDFGlyphUse& glyphUsage,
                                      int ttcIndex) {
@@ -71,20 +102,9 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
     hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
     glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, 
gid);});
 
-#if defined(SK_HARFBUZZ_SUBSET_NEW_API)
-    // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
-    // If it isn't known if a font is 'tricky', retain the hints.
-    hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
-    HBFace subset(hb_subset_or_fail(face.get(), input.get()));
-#else
-    hb_subset_input_set_retain_gids(input.get(), true);
-    // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
-    // If it isn't known if a font is 'tricky', retain the hints.
-    hb_subset_input_set_drop_hints(input.get(), false);
-    HBFace subset(hb_subset(face.get(), input.get()));
-#endif
+    HBFace subset = SkPDFHarfBuzzSubset<hb_subset_input_t*>::Make(input.get(), 
face.get());
     if (!subset) {
-      return nullptr;
+        return nullptr;
     }
     HBBlob result(hb_face_reference_blob(subset.get()));
     return to_data(std::move(result));
diff --git a/third_party/harfbuzz/config-override.h 
b/third_party/harfbuzz/config-override.h
index 62a7af4066ed..899a59436192 100644
--- a/third_party/skia/third_party/harfbuzz/config-override.h
+++ b/third_party/skia/third_party/harfbuzz/config-override.h
@@ -4,6 +4,7 @@
 #include <mutex>
 
 using hb_mutex_impl_t = std::mutex;
+#define HB_MUTEX_IMPL_INIT      UNUSED
 #define hb_mutex_impl_init(M)   HB_STMT_START { new (M) hb_mutex_impl_t;  } 
HB_STMT_END
 #define hb_mutex_impl_lock(M)   (M)->lock ()
 #define hb_mutex_impl_unlock(M) (M)->unlock ()
++++++ skia_harfbuzz_roll.patch ++++++
>From 66684b17b382fdfe6cc3d18bbbe46658115e8628 Mon Sep 17 00:00:00 2001
From: Garret Rieger <grie...@google.com>
Date: Tue, 3 Aug 2021 16:25:09 -0700
Subject: [PATCH] Roll HarfBuzz from 2.6.4 to 2.8.2-147

https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git/+log/3a74ee528255cc027d84b204a87b5c25e47bff79..368e9578873798e2d17ed78a0474dec7d4e9d6c0

Additionally adds a build option that switches to the new
harfbuzz subsetting api which is coming in the next version
of harfbuzz.

Change-Id: I924a7b4978412d636d4c8d19f5c6021ea3c73d21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433737
Reviewed-by: Ben Wagner <bunge...@google.com>
Commit-Queue: Ben Wagner <bunge...@google.com>
---
 BUILD.gn                               |  3 +++
 DEPS                                   |  2 +-
 gn/gn_to_bp.py                         |  3 +++
 gn/skia.gni                            |  7 +++++--
 src/pdf/SkPDFSubsetFont.cpp            | 11 ++++++++++-
 third_party/harfbuzz/BUILD.gn          |  9 +++++++--
 third_party/harfbuzz/config-override.h | 10 ++++++++++
 7 files changed, 39 insertions(+), 6 deletions(-)
 create mode 100644 third_party/harfbuzz/config-override.h

diff --git a/BUILD.gn b/BUILD.gn
index aeb46b466412..f737ef039145 100644
--- a/third_party/skia/BUILD.gn
+++ b/third_party/skia/BUILD.gn
@@ -1047,6 +1047,9 @@ optional("pdf") {
   if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
     deps += [ "//third_party/harfbuzz" ]
     defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
+    if (skia_subset_harfbuzz_new_api) {
+      defines += [ "SK_HARFBUZZ_SUBSET_NEW_API" ]
+    }
   } else if (skia_use_icu && skia_use_sfntly) {
     deps += [ "//third_party/sfntly" ]
     defines = [ "SK_PDF_USE_SFNTLY" ]
diff --git a/gn/skia.gni b/gn/skia.gni
index d98fdc19eecf..fdb0935de96a 100644
--- a/third_party/skia/gn/skia.gni
+++ b/third_party/skia/gn/skia.gni
@@ -34,8 +34,6 @@ declare_args() {
   skia_include_multiframe_procs = false
   skia_lex = false
   skia_libgifcodec_path = "third_party/externals/libgifcodec"
-  skia_pdf_subset_harfbuzz =
-      false  # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
   skia_qt_path = getenv("QT_PATH")
   skia_skqp_global_error_tolerance = 0
   skia_tools_require_resources = false
@@ -99,6 +97,11 @@ declare_args() {
   skia_use_libfuzzer_defaults = true
 }
 
+declare_args() {
+  skia_pdf_subset_harfbuzz = skia_use_harfbuzz
+  skia_subset_harfbuzz_new_api = !is_fuchsia
+}
+
 declare_args() {
   skia_compile_sksl_tests = skia_compile_processors
   skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
diff --git a/src/pdf/SkPDFSubsetFont.cpp b/src/pdf/SkPDFSubsetFont.cpp
index 81c37eef3a10..3289940c712e 100644
--- a/third_party/skia/src/pdf/SkPDFSubsetFont.cpp
+++ b/third_party/skia/src/pdf/SkPDFSubsetFont.cpp
@@ -71,11 +71,21 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
     hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
     glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, 
gid);});
 
+#if defined(SK_HARFBUZZ_SUBSET_NEW_API)
+    // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
+    // If it isn't known if a font is 'tricky', retain the hints.
+    hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
+    HBFace subset(hb_subset_or_fail(face.get(), input.get()));
+#else
     hb_subset_input_set_retain_gids(input.get(), true);
     // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
     // If it isn't known if a font is 'tricky', retain the hints.
     hb_subset_input_set_drop_hints(input.get(), false);
     HBFace subset(hb_subset(face.get(), input.get()));
+#endif
+    if (!subset) {
+      return nullptr;
+    }
     HBBlob result(hb_face_reference_blob(subset.get()));
     return to_data(std::move(result));
 }
@@ -178,4 +188,3 @@ sk_sp<SkData> SkPDFSubsetFont(sk_sp<SkData>, const 
SkPDFGlyphUse&, SkPDF::Metada
     return nullptr;
 }
 #endif  // defined(SK_PDF_USE_SFNTLY)
-
diff --git a/third_party/harfbuzz/BUILD.gn b/third_party/harfbuzz/BUILD.gn
index 173830de623d..4156607ef9da 100644
--- a/third_party/skia/third_party/harfbuzz/BUILD.gn
+++ b/third_party/skia/third_party/harfbuzz/BUILD.gn
@@ -181,9 +184,10 @@ if (skia_use_system_harfbuzz) {
       "$_src/hb-ot-shape-complex-myanmar-machine.hh",
       "$_src/hb-ot-shape-complex-myanmar.cc",
       "$_src/hb-ot-shape-complex-myanmar.hh",
+      "$_src/hb-ot-shape-complex-syllabic.cc",
+      "$_src/hb-ot-shape-complex-syllabic.hh",
       "$_src/hb-ot-shape-complex-thai.cc",
       "$_src/hb-ot-shape-complex-use-machine.hh",
-      "$_src/hb-ot-shape-complex-use-table.cc",
       "$_src/hb-ot-shape-complex-use.cc",
       "$_src/hb-ot-shape-complex-use.hh",
       "$_src/hb-ot-shape-complex-vowel-constraints.cc",
@@ -241,6 +245,7 @@ if (skia_use_system_harfbuzz) {
       "$_src/hb-utf.hh",
       "$_src/hb-vector.hh",
       "$_src/hb.hh",
+      "config-override.h",
     ]
   }
 }
diff --git a/third_party/harfbuzz/config-override.h 
b/third_party/harfbuzz/config-override.h
new file mode 100644
index 000000000000..62a7af4066ed
--- /dev/null
+++ b/third_party/skia/third_party/harfbuzz/config-override.h
@@ -0,0 +1,10 @@
+/*
+ * Adds a mutex implementation based on c++ mutex to harfbuzz.
+ */
+#include <mutex>
+
+using hb_mutex_impl_t = std::mutex;
+#define hb_mutex_impl_init(M)   HB_STMT_START { new (M) hb_mutex_impl_t;  } 
HB_STMT_END
+#define hb_mutex_impl_lock(M)   (M)->lock ()
+#define hb_mutex_impl_unlock(M) (M)->unlock ()
+#define hb_mutex_impl_finish(M) HB_STMT_START { (M)->~hb_mutex_impl_t(); } 
HB_STMT_END

Reply via email to