Add build switch to separate onscreen and offscreen targets 84/285984/10
authorayush.k123 <ayush.k123@samsung.com>
Fri, 23 Dec 2022 11:07:31 +0000 (16:37 +0530)
committerAyush Kumar <ayush.k123@samsung.com>
Wed, 4 Jan 2023 05:07:04 +0000 (10:37 +0530)
The RPM size of the normal build is about 200MB. This size is due to
packaging of onscreen targets, chrome and content_shell, in the rpm.
This patch separates chrome and content_shell, and other targets
through a build switch.

Command line for onscreen build:
TV: ./tizen_src/build/build_tv.sh --nodebug --build-chrome
Desktop: ./tizen_src/build/build_desktop.sh --build-chrome

Reference:
1. https://review.tizen.org/gerrit/274726/
2. https://review.tizen.org/gerrit/274898/
3. https://review.tizen.org/gerrit/275228/
4. https://review.tizen.org/gerrit/276006/

Change-Id: I77fe89c4a10175b4f1b4ea28f21cba92b5e001f0
Signed-off-by: Ayush Kumar <ayush.k@samsung.com>
packaging/chromium-efl.spec
tizen_src/build/common.sh
tizen_src/build/config/tizen_features.gni
tizen_src/build/gn_chromiumefl.sh
tizen_src/ewk/BUILD.gn

index f44962f..1f6c3ee 100644 (file)
@@ -35,6 +35,12 @@ Source1: content_shell.in
 
 %define tizen_version %{tizen_version_major}%{tizen_version_minor}
 
+%if "%{?_build_chrome}" == "1"
+%define __build_chrome 1
+%else
+%define __build_chrome 0
+%endif
+
 %{?_use_system_icu: %define __use_system_icu %{_use_system_icu}}
 # Product tv can't utilize system icu due to nacl dependency.
 %if "%{?profile}" != "tv" && %{tizen_version} == 60 && %{?_use_system_icu: 0}%{!?_use_system_icu: 1}
@@ -176,15 +182,6 @@ Requires: %{name} = %{version}-%{release}
 %description devel
 Browser Engine dev library based on Chromium EFL (development files)
 
-%if 0%{?_enable_content_shell}
-%package shell
-Summary: Chromium EFL port of content_shell application
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-%description shell
-Chromium EFL version of content_shell application
-%endif
-
 %if 0%{?_enable_unittests}
 %package unittests
 Summary: Chromium unittests
@@ -306,16 +303,22 @@ fi
 %else
   "use_system_icu=false" \
 %endif
+%if %{__build_chrome} == 1
+  "build_chrome=true" \
+%else
+  "build_chrome=false" \
+%endif
 %endif  # _skip_gn
 
 ninja %{_smp_mflags} -C "%{OUTPUT_FOLDER}" \
-%if 0%{?_enable_content_shell}
-  content_shell \
-%endif
 %if 0%{?build_ewk_unittests}
   ewk_unittests \
 %endif
-  efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser content_shell chrome
+%if %{__build_chrome} == 1
+  content_shell chrome
+%else
+  efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser
+%endif
 
 %if 0%{?_enable_unittests}
 ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" angle_unittests env_chromium_unittests cacheinvalidation_unittests \
@@ -365,14 +368,11 @@ 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 -d "%{buildroot}"%{_libdir}/../local/lib/
 %if %{__use_clang} == 1
   install -m 0644 %{_libdir}/libatomic.so*         "%{buildroot}"%{_libdir}/../local/lib/
 %endif
 
-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}"/snapshot_blob.bin "%{buildroot}%{CHROMIUM_EXE_DIR}"
 install -m 0644 "%{OUTPUT_FOLDER}"/content_shell.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
@@ -381,12 +381,6 @@ install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj   "%{buildroot}%{CHROMIUM_DAT
 install -m 0644 "%{OUTPUT_FOLDER}"/locales/*.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"/locales
 install -m 0644 "%{OUTPUT_FOLDER}"/chrome_100_percent.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
 install -m 0644 "%{OUTPUT_FOLDER}"/resources.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
-install -m 0644 "%{OUTPUT_FOLDER}"/ui_resources_100_percent.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
-
-mkdir -p "%{buildroot}"/usr/apps/org.tizen.%{name}/bin
-install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app   "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
-install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser      "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
-install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser          "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
 
 install -d "%{OUTPUT_FOLDER}"/packages
 install -d %{buildroot}%{_xmldir}
@@ -407,16 +401,27 @@ install -m 0644 "%{OUTPUT_FOLDER}"/pkgconfig/*.pc    "%{buildroot}"%{_libdir}/pk
 install -m 0644 tizen_src/ewk/efl_integration/public/*.h                  "%{buildroot}"%{_includedir}/chromium-ewk/
 install -m 0644 v8/include/*.h "%{buildroot}"%{_includedir}/v8/
 
-install -m 0755 "%{OUTPUT_FOLDER}"/content_shell "%{buildroot}%{CHROMIUM_EXE_DIR}"/content_shell
-sed 's#@binary@#%{CHROMIUM_EXE_DIR}/content_shell#' %{SOURCE1} > "%{buildroot}"%{_bindir}/content_shell
-
 install -m 0755 "%{OUTPUT_FOLDER}"/libminigbm.so   "%{buildroot}"%{_libdir}
 
-install -m 0755 "%{OUTPUT_FOLDER}"/chrome "%{buildroot}%{CHROMIUM_EXE_DIR}"/chrome
-sed 's#@binary@#%{CHROMIUM_EXE_DIR}/chrome#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome
+%if %{__build_chrome} == 1
+  install -m 0755 "%{OUTPUT_FOLDER}"/content_shell "%{buildroot}%{CHROMIUM_EXE_DIR}"/content_shell
+  sed 's#@binary@#%{CHROMIUM_EXE_DIR}/content_shell#' %{SOURCE1} > "%{buildroot}"%{_bindir}/content_shell
+
+  install -m 0755 "%{OUTPUT_FOLDER}"/chrome "%{buildroot}%{CHROMIUM_EXE_DIR}"/chrome
+  sed 's#@binary@#%{CHROMIUM_EXE_DIR}/chrome#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome
 
-install -m 0755 "%{OUTPUT_FOLDER}"/chrome_crashpad_handler "%{buildroot}%{CHROMIUM_EXE_DIR}"/chrome_crashpad_handler
-sed 's#@binary@#%{CHROMIUM_EXE_DIR}/chrome_crashpad_handler#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome_crashpad_handler
+  install -m 0755 "%{OUTPUT_FOLDER}"/chrome_crashpad_handler "%{buildroot}%{CHROMIUM_EXE_DIR}"/chrome_crashpad_handler
+  sed 's#@binary@#%{CHROMIUM_EXE_DIR}/chrome_crashpad_handler#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome_crashpad_handler
+  install -m 0644 "%{OUTPUT_FOLDER}"/ui_resources_100_percent.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
+%else
+  install -m 0755 "%{OUTPUT_FOLDER}"/libchromium-ewk.so    "%{buildroot}"%{_libdir}
+  install -m 0755 "%{OUTPUT_FOLDER}"/efl_webprocess    "%{buildroot}%{CHROMIUM_EXE_DIR}"
+
+  mkdir -p "%{buildroot}"/usr/apps/org.tizen.%{name}/bin
+  install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app   "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
+  install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser      "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
+  install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser          "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
+%endif
 
 %if 0%{?_enable_unittests}
 install -d "%{INSTALL_ROOT}%{CHROMIUM_UNITTESTS_DIR}"
@@ -439,21 +444,12 @@ install -m 0755 tizen_src/ewk/utc_gtest_run.sh %{buildroot}/opt/usr/utc_exec/
 
 %files
 %manifest packaging/chromium-efl.manifest
-/usr/apps/org.tizen.%{name}/bin/efl_webview_app
-/usr/apps/org.tizen.%{name}/bin/mini_browser
-/usr/apps/org.tizen.%{name}/bin/ubrowser
 %{_icondir}/efl_webview_app.png
 %{_icondir}/mini_browser.png
 %{_icondir}/ubrowser.png
 %{_xmldir}/%{_pkgid}.xml
 %defattr(-,root,root,-)
-%{_libdir}/libchromium-ewk.so
 %{_libdir}/libminigbm.so
-%if "%{?tizen_profile_name}" == "tv"
-  %caps(cap_mac_admin,cap_mac_override,cap_setgid=ei) %{CHROMIUM_EXE_DIR}/efl_webprocess
-%else
-  %{CHROMIUM_EXE_DIR}/efl_webprocess
-%endif
 %if %{__use_clang} == 1
   %{_libdir}/../local/lib/libatomic.so*
 %endif
@@ -463,16 +459,29 @@ install -m 0755 tizen_src/ewk/utc_gtest_run.sh %{buildroot}/opt/usr/utc_exec/
 %{CHROMIUM_EXE_DIR}/locales/*.pak
 %{CHROMIUM_DATA_DIR}/themes/*.edj
 %{CHROMIUM_LOCALE_DIR}
-%{CHROMIUM_EXE_DIR}/content_shell
-%{_bindir}/content_shell
 %{CHROMIUM_EXE_DIR}/chrome_100_percent.pak
 %{CHROMIUM_EXE_DIR}/resources.pak
-%{CHROMIUM_EXE_DIR}/ui_resources_100_percent.pak
 %{CHROMIUM_EXE_DIR}/locales/*.pak
-%{CHROMIUM_EXE_DIR}/chrome
-%{_bindir}/chrome
-%{CHROMIUM_EXE_DIR}/chrome_crashpad_handler
-%{_bindir}/chrome_crashpad_handler
+
+%if %{__build_chrome} == 1
+  %{CHROMIUM_EXE_DIR}/ui_resources_100_percent.pak
+  %{CHROMIUM_EXE_DIR}/content_shell
+  %{_bindir}/content_shell
+  %{CHROMIUM_EXE_DIR}/chrome
+  %{_bindir}/chrome
+  %{CHROMIUM_EXE_DIR}/chrome_crashpad_handler
+  %{_bindir}/chrome_crashpad_handler
+%else
+  %{_libdir}/libchromium-ewk.so
+  %if "%{?tizen_profile_name}" == "tv"
+    %caps(cap_mac_admin,cap_mac_override,cap_setgid=ei) %{CHROMIUM_EXE_DIR}/efl_webprocess
+  %else
+    %{CHROMIUM_EXE_DIR}/efl_webprocess
+  %endif
+  /usr/apps/org.tizen.%{name}/bin/efl_webview_app
+  /usr/apps/org.tizen.%{name}/bin/mini_browser
+  /usr/apps/org.tizen.%{name}/bin/ubrowser
+%endif
 
 %files devel
 %defattr(-,root,root,-)
@@ -480,13 +489,6 @@ install -m 0755 tizen_src/ewk/utc_gtest_run.sh %{buildroot}/opt/usr/utc_exec/
 %{_libdir}/pkgconfig/*.pc
 %{_includedir}/v8/*
 
-%if 0%{?_enable_content_shell}
-%files shell
-%defattr(0755,root,root,-)
-%{CHROMIUM_EXE_DIR}/content_shell
-%{_bindir}/content_shell
-%endif
-
 %if 0%{?_enable_unittests}
 %files unittests
 %defattr(-,root,root,-)
index 267c264..579968b 100755 (executable)
@@ -84,7 +84,6 @@ OPTIONS:
    --build-ewk-unittests Build ewk unittests
    --ccache              Configure ccache installed in your system
    --clang               Use chromium's clang compiler to build the sources
-   --no-content-shell    Don't build content_shell application
    --debug               Build debug version of chromium-efl (out.${host_arch}/Debug instead of out.${host_arch}/Release)
    -jN                   Set number of jobs, just like with make or ninja
    --skip-ninja          Skip ninja step
@@ -112,7 +111,7 @@ function parseHostBuildScriptParams() {
   export FORCE_JHBUILD=0
   export SKIP_NINJA=0
   export BUILD_EWK_UNITTESTS=0
-  export BUILD_CONTENT_SHELL=1
+  export BUILD_CHROME=0
   export BUILD_SUBDIRECTORY=Release
   export COMPONENT_BUILD=0
 
@@ -135,8 +134,8 @@ function parseHostBuildScriptParams() {
       --gcc)
         export USE_CLANG=0
         ;;
-      --no-content-shell)
-        export BUILD_CONTENT_SHELL=0
+      --build-chrome)
+        export BUILD_CHROME=1
         ;;
       --force-jhbuild)
         export FORCE_JHBUILD=1
@@ -181,13 +180,14 @@ function hostGnChromiumEfl() {
 
 function hostNinja() {
   if [[ $SKIP_NINJA == 0 ]]; then
-    TARGETS="chromium-ewk efl_webprocess efl_webview_app ubrowser content_shell chrome"
+    if [[ $BUILD_CHROME == 1 ]]; then
+      TARGETS="content_shell chrome"
+    else
+      TARGETS="chromium-ewk efl_webprocess efl_webview_app ubrowser"
+    fi
     if [[ $BUILD_EWK_UNITTESTS == 1 ]]; then
       TARGETS="$TARGETS ewk_unittests"
     fi
-    if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
-      TARGETS="$TARGETS content_shell dump_syms minidump_stackwalk"
-    fi
     if [[ $BUILD_CHROMEDRIVER == 1 ]]; then
       TARGETS="$TARGETS chromedriver"
     fi
@@ -288,6 +288,9 @@ function setupAndExecuteTargetBuild() {
     ;;
     --tizen*)
     ;;
+    --build-chrome)
+        ARGS+=(--define "_build_chrome 1")
+    ;;
     *)
       ARGS+=("$1")
     ;;
index 650fb25..94b85b2 100644 (file)
@@ -39,6 +39,8 @@ declare_args() {
   tizen_version_minor = 0
   tizen_version_patch = 0
 
+  build_chrome = false
+
   # Tizen multimedia related
   tizen_multimedia_eme_support = false
   tizen_multimedia_support = false
index d11a662..d2e392a 100755 (executable)
@@ -127,6 +127,12 @@ add_desktop_flags() {
      ADDITIONAL_GN_PARAMETERS+="use_system_libjpeg=true
                                "
   fi
+
+  local build_chrome=false
+  if [ $BUILD_CHROME == 1 ]; then
+    build_chrome=true
+  fi
+
   ADDITIONAL_GN_PARAMETERS+="gcc_ver=\"$(getGccVersion)\"
                              is_clang=${is_clang}
                              is_tizen=false
@@ -137,6 +143,7 @@ add_desktop_flags() {
                              werror=false
                              dcheck_always_on=false
                              enable_nacl=false
+                             build_chrome=${build_chrome}
                             "
 }
 
index 9bff27b..75ec304 100644 (file)
@@ -2,11 +2,15 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//tizen_src/build/config/tizen_features.gni")
+
 group("chromium_efl_all") {
   testonly = true
   deps = [
-    "//chrome:chrome",
     "//tizen_src/ewk/efl_webview_app:efl_webview_app",
     "//tizen_src/ewk/ubrowser:ubrowser",
   ]
+  if (build_chrome) {
+    deps += [ "//chrome:chrome" ]
+  }
 }