Switch to Tizen 2.3
authorBalazs Kelemen <b.kelemen@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)
Minimal changes to be able to build with Tizen 2.3. Some features have been
disabled because of API changes. Fixing them is TODO.

The webrtc patch had to be resurrected to fix debug build (partially).

I switched to patching approach instead of copying patched files because
I believe it is more flexible and it shows if the patch is out-of-date more
directly.

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

Change-Id: I67606fca32e1af62552a084d3f850d556e2b848a
Signed-off-by: Balazs Kelemen <b.kelemen@samsung.com>
19 files changed:
tizen_src/build/apply_patches.sh [new file with mode: 0755]
tizen_src/build/build_mobile.sh
tizen_src/build/build_tv.sh
tizen_src/build/common.sh
tizen_src/build/copy_patched_files.sh [deleted file]
tizen_src/build/gbs.conf
tizen_src/build/patches/info.txt [new file with mode: 0644]
tizen_src/build/patches/webrtc.diff [new file with mode: 0644]
tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.cc
tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h
tizen_src/impl/browser/motion/MotionUI.cc
tizen_src/impl/browser/motion/MotionUI.h
tizen_src/impl/browser/motion/wkext_motion.cc
tizen_src/impl/chromium-efl.gyp
tizen_src/impl/chromium-efl.gypi
tizen_src/impl/common/version_info.cc
tizen_src/impl/eweb_view.cc
tizen_src/impl/eweb_view.h
tizen_src/packaging/chromium-efl.spec

diff --git a/tizen_src/build/apply_patches.sh b/tizen_src/build/apply_patches.sh
new file mode 100755 (executable)
index 0000000..346dee5
--- /dev/null
@@ -0,0 +1,34 @@
+. $(dirname $0)/common.sh
+
+function silentApply() {
+  PATCH=$(readlink -f $1)
+  patch -d ${CHROME_SRC} --forward --reject-file=- -p1 -i $PATCH >/dev/null
+  if [ "$?" -gt 1 ]; then
+    >&2 echo "failed applying $1"
+  fi
+}
+
+function silentDeapply() {
+  PATCH=$(readlink -f $1)
+  pushd ${CHROME_SRC} > /dev/null
+  patch --forward --reject-file=- -p1 --dry-run -i $PATCH >/dev/null
+  RET=$?
+  if [ "$RET" -gt 1 ]; then
+    >&2 echo "failed deapplying $1"
+  elif [ "$RET" == "1" ]; then
+    # exit status 1 means it's already applied so we revert
+    patch -p1 -R --reject-file=- -i $PATCH >/dev/null
+  fi
+  popd > /dev/null
+}
+
+echo "$@" | grep -q "\-r" && REVERSE=1
+
+patchdir=${TOPDIR}/build/patches
+for patch in "$patchdir/*.diff"; do
+  if [ -z "$REVERSE" ]; then
+    silentApply $patch
+  else
+    silentDeapply $patch
+  fi
+done
index 8e33941..2471a79 100755 (executable)
@@ -5,7 +5,13 @@ SCRIPTDIR=$(cd $(dirname $0); pwd -P)
 # source common functions and vars
 . `dirname ${BASH_SOURCE[0]}`/common.sh
 
-# copy patched files (for GCC 4.5)
-. ${SCRIPTDIR}/copy_patched_files.sh
+${SCRIPTDIR}/apply_patches.sh
 
-gbs build -A armv7l --incremental "$@"
+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 "$@"
+
+${SCRIPTDIR}/apply_patches.sh -r
index 53c0404..822f89a 100755 (executable)
@@ -5,8 +5,7 @@ SCRIPTDIR=$(cd $(dirname $0); pwd -P)
 # source common functions and vars
 . `dirname ${BASH_SOURCE[0]}`/common.sh
 
-# copy patched files (for GCC 4.5)
-. ${SCRIPTDIR}/copy_patched_files.sh
+${SCRIPTDIR}/apply_patches.sh
 
 GBS_CONF=$HOME/.gbs.conf
 if [ ! -f $GBS_CONF  ]; then
@@ -14,3 +13,5 @@ if [ ! -f $GBS_CONF  ]; then
 fi
 
 gbs --conf $GBS_CONF build -P tizentv_product -A armv7l --incremental "$@"
+
+${SCRIPTDIR}/apply_patches.sh -r
index d6db321..6ae5a8e 100644 (file)
@@ -4,10 +4,10 @@ pushd `dirname ${BASH_SOURCE[0]}` > /dev/null
 SCRIPTDIR=`pwd -L`
 popd > /dev/null
 
-PROJECT_ROOT_PATH="${SCRIPTDIR}/.."
+export TOPDIR="${SCRIPTDIR}/.."
 if [[ -z "${CHROME_SRC}" ]]; then
   # If $CHROME_SRC was not set, assume src subfolder in project directory is CHROME_SRC.
-  export CHROME_SRC="${PROJECT_ROOT_PATH}/src"
+  export CHROME_SRC="${TOPDIR}/src"
 fi
 
 function applyPatch {
diff --git a/tizen_src/build/copy_patched_files.sh b/tizen_src/build/copy_patched_files.sh
deleted file mode 100755 (executable)
index ea04e0e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-# source common functions and vars
-. `dirname ${BASH_SOURCE[0]}`/common.sh
-
-PATCHED_DIR=$SCRIPTDIR/patched_files
-
index bb9abca..779dff1 100755 (executable)
@@ -1,7 +1,28 @@
-[general]
-profile = profile.tizenmb
+###############################################
+#
+# Tizen v2.3 for mobile
+#
+[profile.tizenmb_v2.3]
+obs = obs.tizenmb
+# The order is IMPORTANT!
+repos = repo.tizenmb_supplement_v2.3, repo.tizenmb_supplement_chromium_v2.3, repo.tizenmb_base_v2.3
+buildroot=~/GBS-ROOT-2.3-DEV
+
+[repo.tizenmb_supplement_v2.3]
+url = http://10.251.52.177/tizenrepo/eur-open/supplement_v2.3
+
+[repo.tizenmb_base_v2.3]
+url = http://10.251.52.177/tizenrepo/eur-open/PtnZ910FXX_20140827.003
+
+# Supplementary repo for chromium
+[repo.tizenmb_supplement_chromium_v2.3]
+url = http://10.251.52.177/tizenrepo/eur-open/supplement_mobile_chromium_orange_v2.3
 
-[profile.tizenmb]
+###############################################
+#
+# Tizen v2.1 for mobile
+#
+[profile.tizenmb_v2.1]
 passwdx =
 obs = obs.tizenmb
 # The order is IMPORTANT!
@@ -14,32 +35,35 @@ url = http://slp-build.sec.samsung.net:81
 # base repo
 [repo.tizenmb_base]
 url = http://10.251.52.177/tizenrepo/jpn-dcm/Redwood8974JPNDCM_20131218.006
-#url = http://105.144.128.62/tizenrepo/jpn-dcm/Redwood8974JPNDCM_20131218.006
 
 # Supplementary repo for additional rpms packages required in gbs build
 [repo.tizenmb_supplement]
 url = http://10.251.52.177/tizenrepo/jpn-dcm/supplement
-#url = http://105.144.128.62/tizenrepo/jpn-dcm/supplement
 
+###############################################
+#
+# Tizen v2.2.1 for tv
+#
 [profile.tizentv_product]
 repos = repo.tizentv_supplement, repo.tztv_2.2.1_product, repo.tztv_2.2.1_profile, repo.tztv_2.2.1_product_i586, repo.tztv_2.2.1_profile_i586, repo.tizen_2.2.1
 buildroot = ~/GBS-TV-PRODUCT
 
-[repo.tztv_2.2.1_demo]
-url=http://168.219.241.168/snapshots/tztv-2.2.1-tdc14/product/latest/
 [repo.tztv_2.2.1_product]
-url=http://168.219.241.168/snapshots/tztv-2.2.1/product/latest/repos/product/armv7l/packages/
-#url=http://168.219.241.168/snapshots/tztv-2.2.1/product/tztv-2.2.1_20140526.4/
+url = http://10.251.52.177/tizenrepo/tv_repo/snapshots/tztv-2.2.1/product/tztv-2.2.1_20140807.3/repos/product/armv7l/packages/
+
 [repo.tztv_2.2.1_profile]
-url=http://168.219.241.168/snapshots/tztv-2.2.1/product/latest/repos/profile/armv7l/packages/
+url = http://10.251.52.177/tizenrepo/tv_repo/snapshots/tztv-2.2.1/product/tztv-2.2.1_20140807.3/repos/profile/armv7l/packages/
+
 [repo.tztv_2.2.1_product_i586]
-url=http://168.219.241.168/snapshots/tztv-2.2.1/product/latest/repos/product/ia32/packages/
+url = http://10.251.52.177/tizenrepo/tv_repo/snapshots/tztv-2.2.1/product/tztv-2.2.1_20140807.3/repos/product/ia32/packages/
+
 [repo.tztv_2.2.1_profile_i586]
-url=http://168.219.241.168/snapshots/tztv-2.2.1/product/latest/repos/profile/ia32/packages/
+url = http://10.251.52.177/tizenrepo/tv_repo/snapshots/tztv-2.2.1/product/tztv-2.2.1_20140807.3/repos/profile/ia32/packages/
+
 [repo.tizen_2.2.1]
-#url=http://168.219.241.168/tizen-rsa/tizen-2.2.1-vd-4.5/standard/tizen-2.2.1-vd-4.5_20140614.2
-url=http://168.219.241.168/tizen-rsa/tizen-2.2.1
+url = http://10.251.52.177/tizenrepo/tv_repo/tizen-rsa/tizen-2.2.1
 
 # Supplementary repo for additional rpms packages required in gbs build
 [repo.tizentv_supplement]
-url = http://10.251.52.177/tizenrepo/jpn-dcm/supplement_tv
+url = http://10.251.52.177/tizenrepo/tv_repo/supplement_tv
+
diff --git a/tizen_src/build/patches/info.txt b/tizen_src/build/patches/info.txt
new file mode 100644 (file)
index 0000000..cf2416d
--- /dev/null
@@ -0,0 +1,4 @@
+webrtc.diff
+    double slash (//) in include path leads to rpm error, fixed by patch
+    See: http://107.108.218.239/bugzilla/show_bug.cgi?id=6458
+    TODO(b.kelemen): upstream
diff --git a/tizen_src/build/patches/webrtc.diff b/tizen_src/build/patches/webrtc.diff
new file mode 100644 (file)
index 0000000..f403bed
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/third_party/webrtc/modules/video_render/incoming_video_stream.cc b/third_party/webrtc/modules/video_render/incoming_video_stream.cc
+index 71f30c3..1770569 100644
+--- a/third_party/webrtc/modules/video_render/incoming_video_stream.cc
++++ b/third_party/webrtc/modules/video_render/incoming_video_stream.cc
+@@ -8,7 +8,7 @@
+  *  be found in the AUTHORS file in the root of the source tree.
+  */
+-#include "webrtc/modules/video_render//incoming_video_stream.h"
++#include "webrtc/modules/video_render/incoming_video_stream.h"
+ #include <assert.h>
+@@ -22,7 +22,7 @@
+ #endif
+ #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
+-#include "webrtc/modules/video_render//video_render_frames.h"
++#include "webrtc/modules/video_render/video_render_frames.h"
+ #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
+ #include "webrtc/system_wrappers/interface/event_wrapper.h"
+ #include "webrtc/system_wrappers/interface/thread_wrapper.h"
index 3def73d..105fb59 100644 (file)
@@ -30,15 +30,20 @@ DataFetcherImplTizen::DataFetcherImplTizen()
       has_last_motion_data_(false),
       last_motion_timestamp_(0),
       is_orientation_buffer_ready_(false) {
+  // FIXME: sensor API's changed in Tizen 2.3, we have to adapt.
+#if !defined(EWK_BRINGUP)
   sensor_create(&handle_);
   sensor_orientation_set_cb(handle_, kInertialSensorIntervalMillis,
       DataFetcherImplTizen::onOrientationChanged, this);
   sensor_accelerometer_set_cb(handle_, kInertialSensorIntervalMillis,
       DataFetcherImplTizen::onAccelerationChanged, this);
+#endif
 }
 
 DataFetcherImplTizen::~DataFetcherImplTizen() {
+#if !defined(EWK_BRINGUP)
   sensor_destroy(handle_);
+#endif
 }
 
 DataFetcherImplTizen* DataFetcherImplTizen::GetInstance() {
@@ -46,6 +51,8 @@ DataFetcherImplTizen* DataFetcherImplTizen::GetInstance() {
                    LeakySingletonTraits<DataFetcherImplTizen> >::get();
 }
 
+#if !defined(EWK_BRINGUP)
+
 bool DataFetcherImplTizen::StartFetchingDeviceMotionData(
     DeviceMotionHardwareBuffer* buffer) {
   DCHECK(buffer);
@@ -219,4 +226,15 @@ void DataFetcherImplTizen::SetOrientationBufferReadyStatus(bool ready) {
   is_orientation_buffer_ready_ = ready;
 }
 
+#else
+
+bool DataFetcherImplTizen::StartFetchingDeviceMotionData(DeviceMotionHardwareBuffer* buffer) { return false; }
+void DataFetcherImplTizen::StopFetchingDeviceMotionData() {}
+bool DataFetcherImplTizen::StartFetchingDeviceOrientationData(DeviceOrientationHardwareBuffer* buffer) { return false; }
+void DataFetcherImplTizen::StopFetchingDeviceOrientationData() {}
+bool DataFetcherImplTizen::Start(ConsumerType) {}
+void DataFetcherImplTizen::Stop(ConsumerType) {}
+
+#endif // EWK_BRINGUP
+
 } // namespace content
index 4fec972..cc6602d 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef DATA_FETCHER_IMPL_TIZEN_H_
 #define DATA_FETCHER_IMPL_TIZEN_H_
 
-#include <sensors.h>
+#include <sensor.h>
 
 #include "base/memory/scoped_ptr.h"
 #include "base/synchronization/lock.h"
index 05d7fd4..5f8dbf1 100755 (executable)
@@ -17,6 +17,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
+// FIXME: need to adapt this code to sensor API changes in Tizen 2.3.
+#if !defined(EWK_BRINGUP)
+
 #include "MotionUI.h"
 #include "wkext_motion.h"
 #include "base/logging.h"
@@ -236,3 +239,5 @@ double MotionUI::syncScale(double scale, bool isTiltMode) {
 
   return m_syncScale;
 }
+
+#endif // EWK_BRINGUP
index 95567ad..4bc00ea 100755 (executable)
@@ -22,7 +22,7 @@
 
 #include <Ecore.h>
 #include <Ecore_Evas.h>
-#include <sensors.h>
+#include <sensor.h>
 
 class MotionUI {
  public:
index b137116..c151c0f 100755 (executable)
@@ -23,6 +23,7 @@
 #include "MotionUI.h"
 #include "base/logging.h"
 
+#if !defined(EWK_BRINGUP)
 void wkext_motion_tilt_enable_set(Evas_Object* view, int enable, unsigned int sensitivity) {
   LOG(ERROR)<<"wkext_motion_tilt_enable_set";
   MotionUI::motionUI().setTiltToZoom(view, enable, sensitivity);
@@ -55,3 +56,12 @@ double wkext_motion_tilt_scale_sync(double scale, Wkext_Motion_Type type) {
 
   return MotionUI::motionUI().syncScale(scale, isTiltMode);
 }
+#else
+void wkext_motion_tilt_enable_set(Evas_Object* view, int enable, unsigned int sensitivity) {}
+void wkext_motion_tilt_start(Evas_Object* view, const Evas_Coord_Point* position) {}
+void wkext_motion_tilt_stop() {}
+int wkext_motion_tilt_is_running() { return EINA_FALSE; }
+void wkext_motion_tilt_position_update(Evas_Coord_Point* position) {}
+void wkext_motion_tilt_scale_initialize(double scale) {}
+double wkext_motion_tilt_scale_sync(double scale, Wkext_Motion_Type type) { return 0.; }
+#endif
index 6002cb5..60152a8 100644 (file)
@@ -5,7 +5,6 @@
     'edje_dir%': '/usr/share/chromium-efl/themes/',
     'webdb_dir%': '/usr/share/chromium-efl/db/',
     'edje_compiler%': 'edje_cc',
-    'ewk_bringup%': 1,
   },
   'targets': [{
     'target_name': 'chromium-efl',
index ed2c0ca..14fbcbe 100644 (file)
@@ -1,5 +1,6 @@
 {
   'variables': {
+    'ewk_bringup%': 1,
     '__GCC_VERSION%': '<!(gcc -dumpversion)',
     'conditions': [
       ['building_for_tizen==1', {
           }],
         ],
       }],
+      ['ewk_bringup==1', {
+        'defines!': [
+          'TIZEN_CONTENTS_DETECTION=1',
+          'TIZEN_ENABLE_CAPI_SUPPORT=1',
+        ],
+      }]
     ],
   },
 }
index 79d09a1..a4ed21a 100644 (file)
@@ -16,6 +16,7 @@
 
 #if defined(OS_TIZEN)
 #include "system_info.h"
+#include "system_info_internal.h"
 #endif
 
 #include "common/version_info_efl.h"
index 7d63576..51d30e2 100644 (file)
@@ -1748,7 +1748,7 @@ bool EWebView::StopInspectorServer() {
   return true;
 }
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
 void EWebView::cameraResultCb(service_h request,
                               service_h reply,
                               service_result_e result,
index e556d41..70888a1 100644 (file)
 #define EWEB_VIEW_H
 
 #if defined(OS_TIZEN_MOBILE)
-#include <appfw/app_service.h>
+#if !defined(EWK_BRINGUP)
+// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to include instead.
+#include <appcore-agent/service_app.h>
+#endif
 #include <vector>
 #endif
 
@@ -411,7 +414,7 @@ class EWebView
   bool HandleTouchEvent(ui::TouchEvent* event);
 
  private:
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
   static void cameraResultCb(service_h request, service_h reply,
     service_result_e result, void* data);
 #endif
@@ -421,7 +424,7 @@ class EWebView
   virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE;
   virtual void DispatchGestureEvent(ui::GestureEvent*) OVERRIDE;
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
   bool LaunchCamera(base::string16 mimetype);
 #endif
   content::RenderWidgetHostViewEfl* rwhv() const;
index b8fce03..8348e6a 100755 (executable)
@@ -23,7 +23,7 @@ Requires(post): /sbin/ldconfig
 Requires(post): xkeyboard-config
 Requires(postun): /sbin/ldconfig
 BuildRequires: which, vi, python, python-xml, bison, flex, gperf, gettext, perl, edje-bin
-BuildRequires: libjpeg-turbo-devel, expat-devel, libasound-devel, libhaptic, libcap-devel
+BuildRequires: libjpeg-turbo-devel, expat-devel, libhaptic, libcap-devel
 BuildRequires: pkgconfig(glesv2)
 BuildRequires: pkgconfig(libpulse)
 BuildRequires: pkgconfig(recordproto)