[Tizen][dev] Fix TV build
authorAntonio Gomes <a1.gomes@samsung.com>
Tue, 23 Sep 2014 22:51:11 +0000 (18:51 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
TV profile builds with "legacy" Tizen 2.2.1
packages.

Patch adapts our build so mobile (now with Tizen 2.3)
and TV profiles able to co-exist.

Additionally, since common trunk switched to m39-based
chromium sourcebase, ld step fails with "memory exhausted"
error (bug 6629) and cpio fails to create dev packages off
of the 2.1Gb libchromium-efl.so (bug 6457).
In order to unblock developers, patch extends the solution
used in debug builds already: set 'no-keep-memory' linker option.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=5676

Change-Id: I56108fe50abb7296c0fc27be7bd055fa237c84ca
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/build/build_mobile.sh
tizen_src/build/build_tv.sh
tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h
tizen_src/impl/browser/motion/MotionUI.h
tizen_src/impl/chromium-efl.gypi
tizen_src/impl/common/version_info.cc
tizen_src/packaging/chromium-efl.spec

index bc4f54b..af91540 100755 (executable)
@@ -7,11 +7,14 @@ SCRIPTDIR=$(cd $(dirname $0); pwd -P)
 
 ${SCRIPTDIR}/apply_patches.sh
 
+TIZEN_VERSION="chromium_efl_tizen_version 2.3"
+
 if [ ! -f "$HOME/.gbs.conf" ]; then
     CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
     PROFILE_FLAG="-P tizenmb_v2.3"
 fi
 
-gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental "$@"
+gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental \
+    --define "${TIZEN_VERSION}" "$@"
 
 ${SCRIPTDIR}/apply_patches.sh -r
index 822f89a..f6daf6a 100755 (executable)
@@ -7,11 +7,14 @@ SCRIPTDIR=$(cd $(dirname $0); pwd -P)
 
 ${SCRIPTDIR}/apply_patches.sh
 
-GBS_CONF=$HOME/.gbs.conf
-if [ ! -f $GBS_CONF  ]; then
-    GBS_CONF=${SCRIPTDIR}/gbs.conf
+TIZEN_VERSION="chromium_efl_tizen_version 2.2.1"
+
+if [ ! -f "$HOME/.gbs.conf" ]; then
+    CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
+    PROFILE_FLAG="-P tizentv_product"
 fi
 
-gbs --conf $GBS_CONF build -P tizentv_product -A armv7l --incremental "$@"
+gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental \
+    --define "${TIZEN_VERSION}" "$@"
 
 ${SCRIPTDIR}/apply_patches.sh -r
index cc6602d..ba44ae8 100644 (file)
 #ifndef DATA_FETCHER_IMPL_TIZEN_H_
 #define DATA_FETCHER_IMPL_TIZEN_H_
 
-#include <sensor.h>
+#ifndef TIZEN_LEGACY_V_2_2_1
+#include <sensor/sensor.h>
+#else
+#include <sensors.h>
+#endif
 
 #include "base/memory/scoped_ptr.h"
 #include "base/synchronization/lock.h"
index 4bc00ea..a6f5bc4 100755 (executable)
 
 #include <Ecore.h>
 #include <Ecore_Evas.h>
-#include <sensor.h>
+#ifndef TIZEN_LEGACY_V_2_2_1
+#include <sensor/sensor.h>
+#else
+#include <sensors.h>
+#endif
+
 
 class MotionUI {
  public:
index 14fbcbe..1f274cc 100644 (file)
@@ -7,6 +7,7 @@
         'clang': 0,
       }],
     ],
+   'chromium_efl_tizen_version%': '2.3',
   },
   'target_defaults': {
     'defines': [
          # Non-arm builds will ingore it in any case.
          '__ARM_PCS',
          ],
+        'conditions': [
+           ['chromium_efl_tizen_version=="2.3"', {
+             'defines': [
+               'TIZEN_V_2_3=1',
+             ],
+           }],
+           ['chromium_efl_tizen_version=="2.2.1"', {
+             'defines': [
+               'TIZEN_LEGACY_V_2_2_1=1',
+             ],
+           }],
+         ],
          'sources/': [
            ['exclude', 'browser/device_sensors/data_fetcher_shared_memory_default.cc$'],
          ],
index a4ed21a..dd6eab3 100644 (file)
 #include "common/version_info.h"
 
 #if defined(OS_TIZEN)
-#include "system_info.h"
+#ifndef TIZEN_LEGACY_V_2_2_1
 #include "system_info_internal.h"
+#else
+#include "system_info.h"
+#endif
 #endif
-
 #include "common/version_info_efl.h"
 
 namespace EflWebView {
index eeaaeca..2d54aef 100755 (executable)
@@ -161,16 +161,19 @@ export LD_RUN_PATH=%{_libdir}
 #set build mode
 %if 0%{?_debug_mode}
   %global OUTPUT_FOLDER %{OUTPUT_BASE_FOLDER}/Debug
-  # Building the RPM in the GBS chroot fails with errors such as
-  #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
-  #       failed to set dynamic section sizes: Memory exhausted
-  # For now, work around it by passing a GNU ld-specific flag that optimizes the
-  # linker for memory usage.
-  export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
 %else
   %global OUTPUT_FOLDER %{OUTPUT_BASE_FOLDER}/Release
 %endif
 
+# Building the RPM in the GBS chroot fails with errors such as
+#   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
+#       failed to set dynamic section sizes: Memory exhausted
+# For now, work around it by passing a GNU ld-specific flag that optimizes the
+# linker for memory usage. See bugs:
+#   - http://107.108.218.239/bugzilla/show_bug.cgi?id=6457
+#   - http://107.108.218.239/bugzilla/show_bug.cgi?id=6629
+export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
 if type ccache &> /dev/null; then
   source build/ccache_env.sh %{OUTPUT_BUILD_PROFILE_TARGET}
 fi
@@ -185,6 +188,9 @@ fi
 %if 0%{?_remove_webcore_debug_symbols:1}
   -Dremove_webcore_debug_symbols=1 \
 %endif
+%if 0%{?chromium_efl_tizen_version:1}
+  -Dchromium_efl_tizen_version=%{chromium_efl_tizen_version} \
+%endif
   -Dwebdb_dir="%{CHROMIUM_WEBDB_DIR}"/data/db \
   -Dbuilding_for_tizen_"%{OUTPUT_BUILD_PROFILE_TARGET}"=1
 %endif