remove icu header dependencies from harfbuzz header 31/220331/2 accepted/tizen/unified/20191218.121018 submit/tizen/20191218.032741
authorBowon Ryu <bowon.ryu@samsung.com>
Tue, 17 Dec 2019 08:38:52 +0000 (17:38 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Wed, 18 Dec 2019 02:19:13 +0000 (11:19 +0900)
Harfbuzz header include icu header that is not Tizen public API.
In order to remove icu header from rootstrap, icu header dependencies
should be removed.

This patch only applies to build-root for harfbuzz upstream compatibility.

Change-Id: Ic35645b2aee2a886f3ae594d86bbbbd17c8f05e0
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
packaging/harfbuzz.spec
patch/remove-icu-header-dependencies-from-harfbuzz-header.patch [new file with mode: 0644]

index 93dcd56..f2d623d 100644 (file)
@@ -45,6 +45,7 @@ HarfBuzz is an OpenType text shaping engine.
 %prep
 %setup -q
 cp %{SOURCE1001} .
+patch -p1 < %{_builddir}/%{name}-%{version}/patch/remove-icu-header-dependencies-from-harfbuzz-header.patch
 
 %build
 %configure \
diff --git a/patch/remove-icu-header-dependencies-from-harfbuzz-header.patch b/patch/remove-icu-header-dependencies-from-harfbuzz-header.patch
new file mode 100644 (file)
index 0000000..9bec5d5
--- /dev/null
@@ -0,0 +1,98 @@
+From 6bce537e813081511d7899a235872ff794dbce1a Mon Sep 17 00:00:00 2001
+From: Jongmin Lee <jm105.lee@samsung.com>
+Date: Wed, 4 Dec 2019 09:54:01 +0900
+Subject: [PATCH] remove icu header dependencies from harfbuzz header
+
+Harfbuzz header include icu header that is not Tizen public API.
+In order to remove icu header from rootstrap, icu header dependencies
+should be removed.
+
+@tizen_fix
+
+Change-Id: Ic73ee83de294c09fe3bf047eb3ed7f7c85bdc8c3
+---
+ src/hb-icu.cc | 17 ++++++++++-------
+ src/hb-icu.h  |  5 ++---
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/src/hb-icu.cc b/src/hb-icu.cc
+index c26c91d..7e89f78 100644
+--- a/src/hb-icu.cc
++++ b/src/hb-icu.cc
+@@ -38,6 +38,7 @@
+ #include <unicode/ustring.h>
+ #include <unicode/utf16.h>
+ #include <unicode/uversion.h>
++#include <unicode/uscript.h>
+ /**
+@@ -51,26 +52,28 @@
+ hb_script_t
+-hb_icu_script_to_script (UScriptCode script)
++hb_icu_script_to_script (unsigned int numScript)
+ {
++  UScriptCode script = (UScriptCode) numScript;
++
+   if (unlikely (script == USCRIPT_INVALID_CODE))
+     return HB_SCRIPT_INVALID;
+   return hb_script_from_string (uscript_getShortName (script), -1);
+ }
+-UScriptCode
++unsigned int
+ hb_icu_script_from_script (hb_script_t script)
+ {
+   if (unlikely (script == HB_SCRIPT_INVALID))
+-    return USCRIPT_INVALID_CODE;
++    return (unsigned int) USCRIPT_INVALID_CODE;
+   unsigned int numScriptCode = 1 + u_getIntPropertyMaxValue (UCHAR_SCRIPT);
+   for (unsigned int i = 0; i < numScriptCode; i++)
+-    if (unlikely (hb_icu_script_to_script ((UScriptCode) i) == script))
+-      return (UScriptCode) i;
++    if (unlikely (hb_icu_script_to_script (i) == script))
++      return i;
+-  return USCRIPT_UNKNOWN;
++  return (unsigned int) USCRIPT_UNKNOWN;
+ }
+@@ -153,7 +156,7 @@ hb_icu_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED,
+   if (unlikely (U_FAILURE (status)))
+     return HB_SCRIPT_UNKNOWN;
+-  return hb_icu_script_to_script (scriptCode);
++  return hb_icu_script_to_script ((unsigned int) scriptCode);
+ }
+ static hb_bool_t
+diff --git a/src/hb-icu.h b/src/hb-icu.h
+index 2db6a7b..dc6d7aa 100644
+--- a/src/hb-icu.h
++++ b/src/hb-icu.h
+@@ -31,15 +31,14 @@
+ #include "hb.h"
+-#include <unicode/uscript.h>
+ HB_BEGIN_DECLS
+ HB_EXTERN hb_script_t
+-hb_icu_script_to_script (UScriptCode script);
++hb_icu_script_to_script (unsigned int numScript);
+-HB_EXTERN UScriptCode
++HB_EXTERN unsigned int
+ hb_icu_script_from_script (hb_script_t script);
+-- 
+2.7.4
+