Add initial support for Tizen 3.0 TV platform
authorPiotr Tworek <p.tworek@samsung.com>
Wed, 21 Jan 2015 14:53:46 +0000 (15:53 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
This patch adds initial build system support for Tizen 3.0 for TV profile.
Due to missing, or sometimes broken multimedia support in the current repos
the current build disables support for it.

The code has been run tested on odroid board.

Change-Id: I9de86728cca255565b31972025db585831176487
Signed-off-by: Piotr Tworek <p.tworek@samsung.com>
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
tizen_src/build/build_tv.sh
tizen_src/build/common.sh
tizen_src/build/gbs.conf
tizen_src/build/gyp_chromiumefl.sh
tizen_src/impl/chromium-efl-deps.gyp
tizen_src/impl/chromium-efl.gypi
tizen_src/packaging/chromium-efl.spec

index eea0338..8bbae65 100755 (executable)
@@ -10,19 +10,27 @@ ${SCRIPTDIR}/apply_patches.sh ${SCRIPTDIR}/patches
 # "|| :" means "or always succeeding built-in command"
 PROFILE_NAME=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" || :)
 
-if [ "$PROFILE_NAME" == "" ]; then
-  PROFILE_NAME=tztv_v2.2.1_prehawk
-  PROFILE_FLAG="-P $PROFILE_NAME"
+TIZEN_VERSION="chromium_efl_tizen_version 2.2.1"
+if [ "$PROFILE_NAME" == "tztv_v3.0" ]; then
+  TIZEN_VERSION="chromium_efl_tizen_version 3.0"
+else
+  PROFILE_NAME="tztv_v2.2.1_prehawk"
 fi
 
-TIZEN_VERSION="chromium_efl_tizen_version 2.2.1"
+PROFILE_FLAG="-P $PROFILE_NAME"
 
 if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then
   CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
 fi
 
+EXTRA_PACK_OPTS="--extra-packs python-base-x86-arm,python-x86-arm,python-xml-x86-arm"
+if [ "$PROFILE_NAME" == "tztv_v3.0" ]; then
+  EXTRA_PACK_OPTS=""
+fi
+
 gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental \
-    --extra-packs python-base-x86-arm,python-x86-arm,python-xml-x86-arm \
+    --define 'TIZEN_PROFILE_TV 1' \
+    ${EXTRA_PACK_OPTS} \
     --define "${TIZEN_VERSION}" "$@"
 
 ${SCRIPTDIR}/apply_patches.sh -r ${SCRIPTDIR}/patches
index d2b9e4b..2356dd4 100644 (file)
@@ -153,3 +153,11 @@ function error_report() {
   echo "Error: File:$1 Line:$2"
   exit 1
 }
+
+function findElementInArray() {
+  local elm
+  for elm in "${@:2}"; do
+    [[ "$elm" = "$1" ]] && return 0;
+  done
+  return 1;
+}
index 733730c..39a9a93 100755 (executable)
@@ -117,3 +117,23 @@ url = http://10.251.52.177/tizenrepo/tv_repo/tizen-2.2.1-vd-4.8_20140822.1
 # which added new API (player_get_content_video_size).
 # If this package will be merged, I'll change this codes
 url = http://10.251.52.177/tizenrepo/tv_repo/supplement_tv_prehawk_player
+
+###############################################
+##
+## Tizen v3.0 for TV
+##
+
+[obs.tizen]
+url = https://api.tizen.org
+
+[profile.tztv_v3.0]
+obs = obs.tizen
+repos = repo.supplement, repo.tv_arm-x11
+buildroot=~/GBS-ROOT-3.0-TV
+
+# mirrored from http://download.tizen.org/snapshots/tizen/tv
+[repo.tv_arm-x11]
+url = http://10.251.52.177/tizenrepo/tv_repo/tizen-tv_v3.0/repos/arm-x11/packages
+
+[repo.supplement]
+url = http://10.251.52.177/tizenrepo/tv_repo/supplement_odroid_chromium_tizen_v3.0
index 0dd2ad5..95fa3ce 100755 (executable)
@@ -4,6 +4,8 @@ source $(dirname $0)/common.sh
 trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
 host_arch=$(getHostArch)
 
+supported_targets=("mobile" "tv" "desktop")
+
 if [ -z "$GYP_GENERATOR_OUTPUT" ]; then
   GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
 fi
@@ -14,12 +16,25 @@ EXTRA_GYP_ARGS="$@"
 # Otherwise we are called by gbs whch already passes the correct building_for_* flag.
 if [ "$__GYP_CHROMIUMEFL_TARGET" == "desktop" ]; then
   target=desktop
-elif echo "$@" | grep -cq '\-\Dbuilding_for_tizen_mobile=1'; then
-  target=mobile
-  buildType=gbs
-elif echo "$@" | grep -cq '\-\Dbuilding_for_tizen_tv=1'; then
-  target=tv
-  buildType=gbs
+fi
+
+while [[ $# > 0 ]]; do
+  case "$1" in
+    -Dbuilding_for_tizen_*=1)
+      buildType="gbs"
+      target=$(echo $1 | sed -e 's#-Dbuilding_for_tizen_\([a-z]*\)\=1#\1#')
+      ;;
+    -Dchromium_efl_tizen_version=*)
+      tizen_version=$(echo $1 | sed -e 's#-Dchromium_efl_tizen_version\=\([0-9.]*\)#\1#')
+      ;;
+  esac
+  shift;
+done
+
+findElementInArray "$target" "${supported_targets[@]}"
+if [[ $? == 1 ]]; then
+  echo "Unsupported target: $target"
+  exit 1
 fi
 
 if [ "$__GYP_CHROMIUMEFL_TARGET" == "crosscompile" ]; then
@@ -40,7 +55,6 @@ fi
 COMMON_GYP_PARAMETERS="
                       -Duse_libjpeg_turbo=1
                       -Dproprietary_codecs=1
-                      -Dtizen_multimedia_support=1
                       -Duse_aura=0
                       -Duse_efl=1
                       -Duse_gnome_keyring=0
@@ -52,6 +66,13 @@ if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
   COMMON_GYP_PARAMETERS+="-Dchromium_efl_library_type=static_library"
 fi
 
+# FIXME: 3.0 does not have any support for multimedia, yet
+if [ "$tizen_version" == "3.0" ]; then
+  COMMON_GYP_PARAMETERS+="-Dtizen_multimedia_support=0"
+else
+  COMMON_GYP_PARAMETERS+="-Dtizen_multimedia_support=1"
+fi
+
 add_desktop_flags() {
   ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0
                               -Dclang=${USE_CLANG}
index 4f9fe72..3fc835a 100644 (file)
   {
     'target_name': 'gstreamer',
     'type': 'none',
+    'variables': {
+      'dependent_pkgs': [
+        'glib-2.0',
+      ],
+    },
     'conditions': [
-      ['building_for_tizen_mobile==1', {
+      ['chromium_efl_tizen_version == "3.0"', {
         'variables': {
           'dependent_pkgs': [
-            'glib-2.0',
             'gstreamer-1.0',
             'gstreamer-base-1.0',
             'gstreamer-app-1.0',
             'gstreamer-video-1.0',
           ],
         },
-        'direct_dependent_settings': {
-          'cflags': [
-            '<!@(<(pkg-config) --cflags <(dependent_pkgs))',
-          ],
-        },
-        'link_settings': {
-          'ldflags': [
-            '<!@(<(pkg-config) --libs-only-L --libs-only-other <(dependent_pkgs))',
-          ],
-          'libraries': [
-            '<!@(<(pkg-config) --libs-only-l <(dependent_pkgs))',
-          ],
-        },
-      }],
-      ['building_for_tizen_tv==1 or building_for_tizen==0', {
+      },
+      { # for Tizen v2.X
         'variables': {
           'dependent_pkgs': [
-          'glib-2.0',
-          'gstreamer-0.10',
-          'gstreamer-base-0.10',
-          'gstreamer-app-0.10',
-          'gstreamer-pbutils-0.10',
-          'gstreamer-interfaces-0.10',
-          'gstreamer-video-0.10',
-          ],
-        },
-        'direct_dependent_settings': {
-          'cflags': [
-            '<!@(<(pkg-config) --cflags <(dependent_pkgs))',
+            'gstreamer-0.10',
+            'gstreamer-base-0.10',
+            'gstreamer-app-0.10',
+            'gstreamer-pbutils-0.10',
+            'gstreamer-interfaces-0.10',
+            'gstreamer-video-0.10',
           ],
         },
-        'link_settings': {
-          'ldflags': [
-            '<!@(<(pkg-config) --libs-only-L --libs-only-other <(dependent_pkgs))',
-          ],
-          'libraries': [
-            '<!@(<(pkg-config) --libs-only-l <(dependent_pkgs))',
-          ],
-        },
-      }],
+      }]
     ],
+    'direct_dependent_settings': {
+      'cflags': [
+        '<!@(<(pkg-config) --cflags <(dependent_pkgs))',
+      ],
+    },
+    'link_settings': {
+      'ldflags': [
+        '<!@(<(pkg-config) --libs-only-L --libs-only-other <(dependent_pkgs))',
+      ],
+      'libraries': [
+        '<!@(<(pkg-config) --libs-only-l <(dependent_pkgs))',
+      ],
+    },
   },
   ], # targets
 
             'capi-system-info',
             'capi-system-device',
             'capi-location-manager',
-            'capi-media-audio-io',
-            'capi-media-camera',
-            'capi-media-player',
             'vconf',
             'libtbm',
             'libdri2',
             'libdrm',
-            'gles20',
+            'glesv2',
             'ui-gadget-1',
             'feedback',
             'tts',
               ],
             },
           }],
+          ['tizen_multimedia_support==1', {
+            'variables': {
+              'dependent_pkgs': [
+                'capi-media-audio-io',
+                'capi-media-camera',
+                'capi-media-player',
+              ],
+            },
+          }],
           ['building_for_tizen_tv==1 and tizen_multimedia_support==1', {
             'variables': {
               'dependent_pkgs': [
index 4434b22..c53b7aa 100644 (file)
       ['exclude', 'x11_event_source_libevent\\.cc$'],
       ['exclude', 'x11_types\\.cc$'],
     ],
+    # FIXME(youngsoo): Needs to find out how Tizen v2.X works without this definition.
+    # It needed due to various std header wrappers in impl.
+    # Those headers are included directly from src code.
+    'include_dirs': [
+      '<(chrome_src_dir)/../impl',
+    ],
     'target_conditions': [
       ['_target_name=="content_renderer" and use_efl==1', {
         'sources': [
                'TIZEN_LEGACY_V_2_2_1=1',
              ],
            }],
+           ['chromium_efl_tizen_version=="3.0"', {
+             'defines': [
+               'TIZEN_V_3_0=1',
+             ],
+           }],
          ],
          'sources/': [
            ['exclude', 'browser/device_sensors/data_fetcher_shared_memory_default.cc$'],
index 3b93bcb..796c561 100644 (file)
@@ -78,13 +78,15 @@ BuildRequires: bzip2-devel
 BuildRequires: pkgconfig(efl-assist)
 BuildRequires: pkgconfig(ttrace)
 BuildRequires: pkgconfig(capi-network-connection)
-BuildRequires: pkgconfig(capi-system-sensor)
-BuildRequires: pkgconfig(gstreamer-1.0)
-BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
-BuildRequires: pkgconfig(gstreamer-app-1.0)
 %else # TIZEN_PROFILE_TV
 BuildRequires: pkgconfig(audio-session-mgr)
 BuildRequires: pkgconfig(mm-session)
+%endif
+%if "%{?chromium_efl_tizen_version:%{chromium_efl_tizen_version}}%{!?chromium_efl_tizen_version:0}" == "3.0"
+BuildRequires: pkgconfig(gstreamer-1.0)
+BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
+BuildRequires: pkgconfig(gstreamer-app-1.0)
+%else # for Tizen v2.X
 BuildRequires: pkgconfig(gstreamer-0.10)
 BuildRequires: pkgconfig(gstreamer-plugins-base-0.10)
 BuildRequires: pkgconfig(gstreamer-app-0.10)