[M69 Dev][Locale] Repack *.pak files for minimal string resource 70/195470/2
authoryh106.jung <yh106.jung@samsung.com>
Mon, 20 Mar 2017 08:06:47 +0000 (17:06 +0900)
committerBot Blink <blinkbot@samsung.com>
Mon, 17 Dec 2018 03:43:08 +0000 (03:43 +0000)
This patch reimplements repacking minimal string resources on GN
build system, but concept is same with GYP version.
It is expected to reduce the size of rpm about 14.6MB.

Reference:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/174584/

Change-Id: I35ac7c564b47a6e1fa935a4b8dd7a12727c0075d
Signed-off-by: yh106.jung <yh106.jung@samsung.com>
packaging/chromium-efl.spec
tizen_src/ewk/efl_integration/BUILD.gn
tizen_src/ewk/po_tizen/BUILD.gn
tizen_src/ewk/po_tizen/chromium_efl_repack_locales.gni [new file with mode: 0644]

index 29e07bd..ad97ef3 100644 (file)
@@ -330,17 +330,22 @@ install -d "%{buildroot}"%{_libdir}/pkgconfig
 install -d "%{buildroot}"%{_includedir}/chromium-ewk
 install -d "%{buildroot}"%{_includedir}/v8
 install -d "%{buildroot}%{CHROMIUM_EXE_DIR}"
+install -d "%{buildroot}%{CHROMIUM_EXE_DIR}"/locales
 install -d "%{buildroot}%{CHROMIUM_DATA_DIR}"/themes
 
+# locale for ewk layer
 cp -r "%{OUTPUT_FOLDER}/locale" "%{buildroot}/%{CHROMIUM_LOCALE_DIR}"
 
+# locale for chromium layer
+install -m 0644 "%{OUTPUT_FOLDER}"/locales/efl/*.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"/locales
+
 install -m 0755 "%{OUTPUT_FOLDER}"/libchromium-ewk.so    "%{buildroot}"%{_libdir}
 
 install -m 0755 "%{OUTPUT_FOLDER}"/efl_webprocess    "%{buildroot}%{CHROMIUM_EXE_DIR}"
 install -m 0755 "%{OUTPUT_FOLDER}"/icudtl.dat    "%{buildroot}%{CHROMIUM_EXE_DIR}"
 install -m 0755 "%{OUTPUT_FOLDER}"/natives_blob.bin  "%{buildroot}%{CHROMIUM_EXE_DIR}"
 install -m 0755 "%{OUTPUT_FOLDER}"/snapshot_blob.bin "%{buildroot}%{CHROMIUM_EXE_DIR}"
-install -m 0755 "%{OUTPUT_FOLDER}"/content_shell.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
+install -m 0644 "%{OUTPUT_FOLDER}"/content_shell.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
 install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj   "%{buildroot}%{CHROMIUM_DATA_DIR}"/themes
 
 mkdir -p "%{buildroot}"/usr/apps/org.tizen.%{name}/bin
@@ -407,6 +412,7 @@ install -m 0755 tizen_src/ewk/utc_gtest_run.sh %{buildroot}/opt/usr/utc_exec/
 %{CHROMIUM_EXE_DIR}/natives_blob.bin
 %{CHROMIUM_EXE_DIR}/snapshot_blob.bin
 %{CHROMIUM_EXE_DIR}/content_shell.pak
+%{CHROMIUM_EXE_DIR}/locales/*.pak
 %{CHROMIUM_DATA_DIR}/themes/*.edj
 %{CHROMIUM_LOCALE_DIR}
 
index e35777e..4fcf9da 100644 (file)
@@ -83,6 +83,7 @@ shared_library("chromium-ewk") {
     "//third_party/sqlite",
     "//tizen_src/chromium_impl/efl:efl-init",
     "//tizen_src/ewk/po_tizen:locale_efl",
+    "//tizen_src/ewk/po_tizen:packed_locales_efl",
     "//ui/compositor",
     "//ui/events",
     "//ui/events:events_base",
index c310fb6..ce9b6a8 100644 (file)
@@ -2,6 +2,9 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//build/config/locales.gni")
+import("//tizen_src/ewk/po_tizen/chromium_efl_repack_locales.gni")
+
 declare_args() {
   msgfmt = "/usr/bin/msgfmt"
 }
@@ -93,3 +96,8 @@ po_translations("locale_efl") {
     "zh_TW.po",
   ]
 }
+
+chromium_efl_repack_locales("packed_locales_efl") {
+  input_locales = locales
+  output_locales = locales
+}
diff --git a/tizen_src/ewk/po_tizen/chromium_efl_repack_locales.gni b/tizen_src/ewk/po_tizen/chromium_efl_repack_locales.gni
new file mode 100644 (file)
index 0000000..9cfbd27
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright 2017-2018 Samsung Electronics. All rights reserved.
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This is fork of //android_webview/webview_repack_locales.gni
+# This repacks only minimal set of strings which is need for Chromium-efl.
+# * components_strings
+# * content_strings
+# * bluetooth_strings
+# * libaddressinput_strings
+# * ui_strings
+# * extensions_strings (if chrome extensions are enabled)
+
+import("//extensions/buildflags/buildflags.gni")
+import("//tools/grit/repack.gni")
+
+# Wraps repack_locales(), setting the source_patterns and deps required for
+# EFL WebView.
+template("chromium_efl_repack_locales") {
+  repack_locales(target_name) {
+    forward_variables_from(invoker, "*")
+    if (!defined(deps)) {
+      deps = []
+    }
+
+    source_patterns = [
+      "${root_gen_dir}/components/strings/components_locale_settings_",
+      "${root_gen_dir}/components/strings/components_strings_",
+      "${root_gen_dir}/content/app/strings/content_strings_",
+      "${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
+      "${root_gen_dir}/third_party/libaddressinput/address_input_strings_",
+      "${root_gen_dir}/ui/strings/app_locale_settings_",
+      "${root_gen_dir}/ui/strings/ui_strings_",
+    ]
+    deps += [
+      "//components/strings:components_locale_settings",
+      "//components/strings:components_strings",
+      "//content/app/strings",
+      "//device/bluetooth/strings",
+      "//third_party/libaddressinput:strings",
+      "//ui/strings:app_locale_settings",
+      "//ui/strings:ui_strings",
+    ]
+    if (enable_extensions) {
+      source_patterns +=
+          [ "${root_gen_dir}/extensions/strings/extensions_strings_" ]
+      deps += [ "//extensions/strings" ]
+    }
+    output_dir = "$root_out_dir/locales/efl"
+  }
+}