From 599c0df4390823c008750e0ef7fd80d36751f430 Mon Sep 17 00:00:00 2001 From: Balazs Kelemen Date: Tue, 23 Sep 2014 18:51:11 -0400 Subject: [PATCH] Switch to Tizen 2.3 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 --- tizen_src/build/apply_patches.sh | 34 ++++++++++++++ tizen_src/build/build_mobile.sh | 12 +++-- tizen_src/build/build_tv.sh | 5 +- tizen_src/build/common.sh | 4 +- tizen_src/build/copy_patched_files.sh | 7 --- tizen_src/build/gbs.conf | 54 ++++++++++++++++------ tizen_src/build/patches/info.txt | 4 ++ tizen_src/build/patches/webrtc.diff | 22 +++++++++ .../device_sensors/data_fetcher_impl_tizen.cc | 18 ++++++++ .../device_sensors/data_fetcher_impl_tizen.h | 2 +- tizen_src/impl/browser/motion/MotionUI.cc | 5 ++ tizen_src/impl/browser/motion/MotionUI.h | 2 +- tizen_src/impl/browser/motion/wkext_motion.cc | 10 ++++ tizen_src/impl/chromium-efl.gyp | 1 - tizen_src/impl/chromium-efl.gypi | 7 +++ tizen_src/impl/common/version_info.cc | 1 + tizen_src/impl/eweb_view.cc | 2 +- tizen_src/impl/eweb_view.h | 9 ++-- tizen_src/packaging/chromium-efl.spec | 2 +- 19 files changed, 164 insertions(+), 37 deletions(-) create mode 100755 tizen_src/build/apply_patches.sh delete mode 100755 tizen_src/build/copy_patched_files.sh create mode 100644 tizen_src/build/patches/info.txt create mode 100644 tizen_src/build/patches/webrtc.diff diff --git a/tizen_src/build/apply_patches.sh b/tizen_src/build/apply_patches.sh new file mode 100755 index 0000000..346dee5 --- /dev/null +++ b/tizen_src/build/apply_patches.sh @@ -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 diff --git a/tizen_src/build/build_mobile.sh b/tizen_src/build/build_mobile.sh index 8e33941..2471a79 100755 --- a/tizen_src/build/build_mobile.sh +++ b/tizen_src/build/build_mobile.sh @@ -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 diff --git a/tizen_src/build/build_tv.sh b/tizen_src/build/build_tv.sh index 53c0404..822f89a 100755 --- a/tizen_src/build/build_tv.sh +++ b/tizen_src/build/build_tv.sh @@ -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 diff --git a/tizen_src/build/common.sh b/tizen_src/build/common.sh index d6db321..6ae5a8e 100644 --- a/tizen_src/build/common.sh +++ b/tizen_src/build/common.sh @@ -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 index ea04e0e..0000000 --- a/tizen_src/build/copy_patched_files.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# source common functions and vars -. `dirname ${BASH_SOURCE[0]}`/common.sh - -PATCHED_DIR=$SCRIPTDIR/patched_files - diff --git a/tizen_src/build/gbs.conf b/tizen_src/build/gbs.conf index bb9abca..779dff1 100755 --- a/tizen_src/build/gbs.conf +++ b/tizen_src/build/gbs.conf @@ -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 index 0000000..cf2416d --- /dev/null +++ b/tizen_src/build/patches/info.txt @@ -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 index 0000000..f403bed --- /dev/null +++ b/tizen_src/build/patches/webrtc.diff @@ -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 + +@@ -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" diff --git a/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.cc b/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.cc index 3def73d..105fb59 100644 --- a/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.cc +++ b/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.cc @@ -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 >::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 diff --git a/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h b/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h index 4fec972..cc6602d 100644 --- a/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h +++ b/tizen_src/impl/browser/device_sensors/data_fetcher_impl_tizen.h @@ -20,7 +20,7 @@ #ifndef DATA_FETCHER_IMPL_TIZEN_H_ #define DATA_FETCHER_IMPL_TIZEN_H_ -#include +#include #include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" diff --git a/tizen_src/impl/browser/motion/MotionUI.cc b/tizen_src/impl/browser/motion/MotionUI.cc index 05d7fd4..5f8dbf1 100755 --- a/tizen_src/impl/browser/motion/MotionUI.cc +++ b/tizen_src/impl/browser/motion/MotionUI.cc @@ -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 diff --git a/tizen_src/impl/browser/motion/MotionUI.h b/tizen_src/impl/browser/motion/MotionUI.h index 95567ad..4bc00ea 100755 --- a/tizen_src/impl/browser/motion/MotionUI.h +++ b/tizen_src/impl/browser/motion/MotionUI.h @@ -22,7 +22,7 @@ #include #include -#include +#include class MotionUI { public: diff --git a/tizen_src/impl/browser/motion/wkext_motion.cc b/tizen_src/impl/browser/motion/wkext_motion.cc index b137116..c151c0f 100755 --- a/tizen_src/impl/browser/motion/wkext_motion.cc +++ b/tizen_src/impl/browser/motion/wkext_motion.cc @@ -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 diff --git a/tizen_src/impl/chromium-efl.gyp b/tizen_src/impl/chromium-efl.gyp index 6002cb5..60152a8 100644 --- a/tizen_src/impl/chromium-efl.gyp +++ b/tizen_src/impl/chromium-efl.gyp @@ -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', diff --git a/tizen_src/impl/chromium-efl.gypi b/tizen_src/impl/chromium-efl.gypi index ed2c0ca..14fbcbe 100644 --- a/tizen_src/impl/chromium-efl.gypi +++ b/tizen_src/impl/chromium-efl.gypi @@ -1,5 +1,6 @@ { 'variables': { + 'ewk_bringup%': 1, '__GCC_VERSION%': ' +#if !defined(EWK_BRINGUP) +// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to include instead. +#include +#endif #include #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; diff --git a/tizen_src/packaging/chromium-efl.spec b/tizen_src/packaging/chromium-efl.spec index b8fce03..8348e6a 100755 --- a/tizen_src/packaging/chromium-efl.spec +++ b/tizen_src/packaging/chromium-efl.spec @@ -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) -- 2.7.4