[Tizen] Remove emulator build dependencies 21/123221/9
authorhk57.kim <hk57.kim@samsung.com>
Wed, 5 Apr 2017 04:14:59 +0000 (13:14 +0900)
committerjerry kim <hk57.kim@samsung.com>
Thu, 13 Apr 2017 05:11:18 +0000 (22:11 -0700)
- This is for Tizen 4.0.

- When you SR this, you need to create JIRA-TRE issue of:
  : add webapi-plugins-mobile-extension-emulator for mobile emulator
  : add webapi-plugins-wearable-extension-emulator for wearable emulator

(It's add, not replace.)

Change-Id: Ifed917e8f1d35194d09fd415e6e587bdf593c5a4
Signed-off-by: hk57.kim <hk57.kim@samsung.com>
packaging/webapi-plugins.spec
src/systeminfo/systeminfo.gyp
src/systeminfo/systeminfo_device_capability.cc

index bafeeb1..5801759 100644 (file)
@@ -15,23 +15,6 @@ Group:      Development/Libraries
 Summary:    Tizen Web APIs implemented
 Source0:    %{name}-%{version}.tar.gz
 
-# TODO: x86/x64 may be non-emulator. please fix it. (and arm emulator may exist)
-%ifarch %{arm} aarch64
-# ARM
-%define tizen_is_emulator           0
-%else
-# I586
-%define tizen_is_emulator           1
-%endif
-
-%ifarch aarch64
-# 64bit
-%define tizen_is_arm64           1
-%else
-# 32bit
-%define tizen_is_arm64           0
-%endif
-
 ####################################################################
 #       Common Profile : artik                                     #
 ####################################################################
@@ -101,11 +84,7 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_mobile_feature_application_support             1
 %define tizen_mobile_feature_archive_support                 1
 %define tizen_mobile_feature_badge_support                   1
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_bluetooth_support               0
-%else
 %define tizen_mobile_feature_bluetooth_support               1
-%endif
 %define tizen_mobile_feature_bookmark_support                1
 %define tizen_mobile_feature_calendar_support                1
 %define tizen_mobile_feature_contact_support                 1
@@ -117,41 +96,27 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_mobile_feature_feedback_support                1
 %define tizen_mobile_feature_filesystem_support              1
 
-# FM radio feature
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_fm_radio_support                1
-%else
-%if 0%{?tizen_is_arm64}
+%ifarch aarch64
 %define tizen_mobile_feature_fm_radio_support                0
 %else
 %define tizen_mobile_feature_fm_radio_support                1
 %endif
-%endif
 
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_ham_support                     1
-%else
 %define tizen_mobile_feature_ham_support                     0
-%endif
+
 %define tizen_mobile_feature_iotcon_support                  1
 %define tizen_mobile_feature_location_batch                  0
 %define tizen_mobile_feature_key_manager_support             1
 %define tizen_mobile_feature_media_controller_support        1
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_media_key_support               0
-%else
+
 %define tizen_mobile_feature_media_key_support               1
-%endif
+
 %define tizen_mobile_feature_message_port_support            1
 %define tizen_mobile_feature_messaging_support               1
 
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_nfc_emulation_support           0
-%define tizen_mobile_feature_nfc_support                     1
-%else
 %define tizen_mobile_feature_nfc_emulation_support           0
 %define tizen_mobile_feature_nfc_support                     0
-%endif
+
 %define tizen_mobile_feature_notification_support            1
 %define tizen_mobile_feature_package_support                 1
 %define tizen_mobile_feature_player_util_support             1
@@ -160,15 +125,11 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_mobile_feature_push_support                    1
 
 # secure element feature
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_se_support                      0
-%else
-%if 0%{?tizen_is_arm64}
+%ifarch aarch64
 %define tizen_mobile_feature_se_support                      0
 %else
 %define tizen_mobile_feature_se_support                      1
 %endif
-%endif
 
 %define tizen_mobile_feature_sensor_support                  1
 %define tizen_mobile_feature_sound_support                   1
@@ -176,33 +137,23 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_mobile_feature_system_setting_support          1
 
 # telephony feature
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_telephony_support               1
-%else
-%if 0%{?tizen_is_arm64}
+%ifarch aarch64
 %define tizen_mobile_feature_telephony_support               0
+%define tizen_mobile_feature_callhistory_support             0
+%define tizen_mobile_feature_nbs_support                     0
 %else
 %define tizen_mobile_feature_telephony_support               1
-%endif
+%define tizen_mobile_feature_callhistory_support             1
+%define tizen_mobile_feature_nbs_support                     1
 %endif
 
 %define tizen_mobile_feature_time_support                    1
 %define tizen_mobile_feature_web_setting_support             1
 %define tizen_mobile_feature_widget_service_support          1
-%if 0%{?tizen_is_emulator}
-%define tizen_mobile_feature_wi_fi_support                   0
-%else
+
 %define tizen_mobile_feature_wi_fi_support                   1
-%endif
-%define tizen_mobile_feature_inputdevice_support             1
 
-%if 0%{?tizen_mobile_feature_telephony_support}
-%define tizen_mobile_feature_callhistory_support             1
-%define tizen_mobile_feature_nbs_support                     1
-%else
-%define tizen_mobile_feature_callhistory_support             0
-%define tizen_mobile_feature_nbs_support                     0
-%endif
+%define tizen_mobile_feature_inputdevice_support             1
 
 %define tizen_mobile_feature_tvinputdevice_support           0
 
@@ -228,11 +179,7 @@ Source0:    %{name}-%{version}.tar.gz
 # Badge API is mandatory in Tizen Wearable Profile.
 %define tizen_wearable_feature_badge_support                   1
 
-%if 0%{?tizen_is_emulator}
-%define tizen_wearable_feature_bluetooth_support               0
-%else
 %define tizen_wearable_feature_bluetooth_support               1
-%endif
 
 # Bookmark API is optional in Tizen Wearable Profile.
 %define tizen_wearable_feature_bookmark_support                0
@@ -255,11 +202,7 @@ Source0:    %{name}-%{version}.tar.gz
 
 # MediayKey API is optional in Tizen Wearable Profile.
 # tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API
-%if 0%{?tizen_is_emulator}
-%define tizen_wearable_feature_media_key_support               0
-%else
 %define tizen_wearable_feature_media_key_support               1
-%endif
 %define tizen_wearable_feature_key_manager_support             1
 %define tizen_wearable_feature_message_port_support            1
 %define tizen_wearable_feature_messaging_support               0
@@ -271,20 +214,19 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_wearable_feature_power_support                   1
 %define tizen_wearable_feature_preference_support              1
 %define tizen_wearable_feature_push_support                    1
-%if 0%{?tizen_is_emulator}
-%define tizen_wearable_feature_se_support                      0
-%else
 %define tizen_wearable_feature_se_support                      1
-%endif
 %define tizen_wearable_feature_sensor_support                  1
 %define tizen_wearable_feature_sound_support                   1
 %define tizen_wearable_feature_system_info_support             1
 %define tizen_wearable_feature_system_setting_support          1
-%if 0%{?tizen_is_emulator}
-%define tizen_wearable_feature_telephony_support               1
-%else
+
+#- telephony related APIs
+# CallHistory API is optional in Tizen Wearable Profile.
+# NetworkBearerSelection API is optional in Tizen Wearable Profile.
 %define tizen_wearable_feature_telephony_support               0
-%endif
+%define tizen_wearable_feature_callhistory_support             0
+%define tizen_wearable_feature_nbs_support                     0
+
 %define tizen_wearable_feature_time_support                    1
 %define tizen_wearable_feature_web_setting_support             0
 %define tizen_wearable_feature_widget_service_support          1
@@ -292,17 +234,6 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_wearable_feature_inputdevice_support             1
 %define tizen_wearable_feature_tvinputdevice_support           0
 
-#- telephony related APIs
-# CallHistory API is optional in Tizen Wearable Profile.
-# NetworkBearerSelection API is optional in Tizen Wearable Profile.
-%if 0%{?tizen_wearable_feature_telephony_support}
-%define    tizen_wearable_feature_callhistory_support          1
-%define    tizen_wearable_feature_nbs_support                  1
-%else
-%define    tizen_wearable_feature_callhistory_support          0
-%define    tizen_wearable_feature_nbs_support                  0
-%endif
-
 %define tizen_wearable_feature_convergence_support             1
 
 
@@ -423,7 +354,6 @@ Source0:    %{name}-%{version}.tar.gz
 %define tizen_feature_convergence_support             %{expand:%tizen_%{?profile}_feature_convergence_support}
 %endif
 
-
 BuildRequires: pkgconfig(security-privilege-manager)
 BuildRequires: ninja
 BuildRequires: pkgconfig(appcore-common)
@@ -654,6 +584,14 @@ Conflicts:     %{name}-profile_ivi
 %description profile_mobile
 Tizen Web API implementation binaries for Tizen mobile profile.
 
+%ifarch %{ix86} x86_64
+%package mobile-extension-emulator
+Summary:       webapi-plugin binaries for mobile emulator
+Requires:      %{name}-profile_mobile = %{version}-%{release}
+%description mobile-extension-emulator
+Tizen Web API implementation binaries for Tizen mobile emulator.
+%endif
+
 %package profile_wearable
 Summary:       webapi-plugin binaries for wearable profile
 Provides:      %{name}-compat = %{version}-%{release}
@@ -664,6 +602,14 @@ Conflicts:     %{name}-profile_ivi
 %description profile_wearable
 Tizen Web API implementation binaries for Tizen wearable profile.
 
+%ifarch %{ix86} x86_64
+%package wearable-extension-emulator
+Summary:       webapi-plugin binaries for wearable emulator
+Requires:      %{name}-profile_wearable = %{version}-%{release}
+%description wearable-extension-emulator
+Tizen Web API implementation binaries for Tizen wearable emulator.
+%endif
+
 %package profile_tv
 Summary:       webapi-plugin binaries for tv profile
 Provides:      %{name}-compat = %{version}-%{release}
@@ -708,7 +654,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
 GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
 
 # feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_mobile_feature_account_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_mobile_feature_alarm_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_mobile_feature_app_control_settings_support}"
@@ -767,13 +712,99 @@ pushd out
 mv Default bin_mobile
 popd
 
+# mobile-extension-emulator
+%ifarch %{ix86} x86_64
+
+%define tizen_mobile_feature_bluetooth_support               0
+
+# FM radio feature
+%define tizen_mobile_feature_fm_radio_support                1
+
+%define tizen_mobile_feature_ham_support                     1
+%define tizen_mobile_feature_media_key_support               0
+%define tizen_mobile_feature_nfc_emulation_support           0
+%define tizen_mobile_feature_nfc_support                     1
+
+# secure element feature
+%define tizen_mobile_feature_se_support                      0
+
+# telephony feature
+%define tizen_mobile_feature_telephony_support               1
+%define tizen_mobile_feature_callhistory_support             1
+%define tizen_mobile_feature_nbs_support                     1
+
+%define tizen_mobile_feature_wi_fi_support                   0
+
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=mobile -Dprivilege_engine=%{tizen_mobile_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_mobile_feature_account_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_mobile_feature_alarm_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_mobile_feature_app_control_settings_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_mobile_feature_application_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_mobile_feature_archive_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_mobile_feature_badge_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_mobile_feature_bluetooth_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_mobile_feature_bookmark_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_mobile_feature_calendar_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_mobile_feature_callhistory_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_mobile_feature_contact_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_mobile_feature_content_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_mobile_feature_datacontrol_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_mobile_feature_datasync_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_mobile_feature_download_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_mobile_feature_exif_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_mobile_feature_feedback_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_mobile_feature_filesystem_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_mobile_feature_fm_radio_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_mobile_feature_ham_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_mobile_feature_iotcon_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_mobile_feature_location_batch}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_mobile_feature_key_manager_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobile_feature_media_controller_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_feature_notification_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}"
+#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_mobile_feature_sensor_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_mobile_feature_se_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_mobile_feature_sound_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_mobile_feature_system_info_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_mobile_feature_system_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_mobile_feature_telephony_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_mobile_feature_time_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_mobile_feature_inputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_mobile_feature_web_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile_feature_widget_service_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_mobile_feature_convergence_support}"
+
+./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
+
+ninja -C out/Default %{?_smp_mflags}
+pushd out
+mv Default bin_mobile_emulator
+popd
+%endif
+
 # WEARABLE
 GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=wearable -Dprivilege_engine=%{tizen_wearable_privilege_engine}"
 GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
 GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
 
 # feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_wearable_feature_account_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_wearable_feature_alarm_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_wearable_feature_app_control_settings_support}"
@@ -832,13 +863,93 @@ pushd out
 mv Default bin_wearable
 popd
 
+# wearable-extension-emulator
+%ifarch %{ix86} x86_64
+
+%define tizen_wearable_feature_bluetooth_support             0
+
+# MediayKey API is optional in Tizen Wearable Profile.
+# tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API
+%define tizen_wearable_feature_media_key_support             0
+
+#- telephony related APIs
+# CallHistory API is optional in Tizen Wearable Profile.
+# NetworkBearerSelection API is optional in Tizen Wearable Profile.
+%define tizen_wearable_feature_se_support                    0
+%define tizen_wearable_feature_telephony_support             1
+%define tizen_wearable_feature_callhistory_support           1
+%define tizen_wearable_feature_nbs_support                   1
+
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=wearable -Dprivilege_engine=%{tizen_wearable_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_wearable_feature_account_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_wearable_feature_alarm_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_wearable_feature_app_control_settings_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_wearable_feature_application_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_wearable_feature_archive_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_wearable_feature_badge_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_wearable_feature_bluetooth_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_wearable_feature_bookmark_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_wearable_feature_calendar_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_wearable_feature_callhistory_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_wearable_feature_contact_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_wearable_feature_content_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_wearable_feature_datacontrol_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_wearable_feature_datasync_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_wearable_feature_download_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_wearable_feature_exif_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_wearable_feature_feedback_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_wearable_feature_filesystem_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_wearable_feature_fm_radio_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_wearable_feature_ham_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_wearable_feature_iotcon_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_wearable_feature_location_batch}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_wearable_feature_key_manager_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wearable_feature_media_controller_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable_feature_notification_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}"
+#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_wearable_feature_sensor_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_wearable_feature_se_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_wearable_feature_sound_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_wearable_feature_system_info_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_wearable_feature_system_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_wearable_feature_telephony_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_wearable_feature_time_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_wearable_feature_inputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_wearable_feature_web_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearable_feature_widget_service_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_wearable_feature_convergence_support}"
+
+./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
+
+ninja -C out/Default %{?_smp_mflags}
+pushd out
+mv Default bin_wearable_emulator
+popd
+%endif
+
 # TV
 GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=tv -Dprivilege_engine=%{tizen_tv_privilege_engine}"
 GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
 GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
 
 # feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_tv_feature_account_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_tv_feature_alarm_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_tv_feature_app_control_settings_support}"
@@ -899,7 +1010,6 @@ popd
 
 %endif
 
-
 # Unified: common/ Others: its own profile
 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
 GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=common -Dprivilege_engine=%{tizen_privilege_engine}"
@@ -910,7 +1020,6 @@ GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
 GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
 
 # feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_feature_account_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_feature_alarm_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_feature_app_control_settings_support}"
@@ -1010,7 +1119,21 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile
 
 # temporary plugins description for lazy loading
 install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile/plugins.json
-%endif
+
+# mobile-extension-emulator
+%ifarch %{ix86} x86_64
+mkdir -p %{buildroot}%{crosswalk_extensions_path}/mobile_emulator
+install -p -m 644 out/bin_mobile_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/mobile_emulator
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \
+       %{crosswalk_extensions_path}/mobile_emulator \
+       %{buildroot}%{crosswalk_extensions_path}/mobile_emulator > plugins.json
+
+# temporary plugins description for lazy loading
+install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile_emulator/plugins.json
+%endif // mobile-extension-emulator
+
+%endif // mobile
 
 %if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
 mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable
@@ -1022,7 +1145,21 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/wearab
 
 # temporary plugins description for lazy loading
 install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable/plugins.json
-%endif
+
+# wearable-extension-emulator
+%ifarch %{ix86} x86_64
+mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable_emulator
+install -p -m 644 out/bin_wearable_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/wearable_emulator
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \
+       %{crosswalk_extensions_path}/wearable_emulator \
+       %{buildroot}%{crosswalk_extensions_path}/wearable_emulator > plugins.json
+
+# temporary plugins description for lazy loading
+install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable_emulator/plugins.json
+%endif // wearable-extension-emulator
+
+%endif // wearable
 
 %if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
 mkdir -p %{buildroot}%{crosswalk_extensions_path}/tv
@@ -1101,7 +1238,24 @@ fi
 %{crosswalk_extensions_path}/mobile/libtizen*.so
 %{crosswalk_extensions_path}/mobile/plugins.json
 %manifest webapi-plugins.manifest
-%endif
+
+# mobile-extension-emulator
+%ifarch %{ix86} x86_64
+%post mobile-extension-emulator
+ln -sf %{crosswalk_extensions_path}/mobile_emulator/* %{crosswalk_extensions_path}
+%preun mobile-extension-emulator
+# This is an un-installation.
+if [ "$1" == "0" ]; then
+  rm %{crosswalk_extensions_path}/libtizen*.so
+  rm %{crosswalk_extensions_path}/plugins.json
+fi
+%files mobile-extension-emulator
+%dir %{crosswalk_extensions_path}/mobile_emulator/
+%{crosswalk_extensions_path}/mobile_emulator/libtizen*.so
+%{crosswalk_extensions_path}/mobile_emulator/plugins.json
+%manifest webapi-plugins.manifest
+%endif // mobile-extension-emulator
+%endif // mobile
 
 %if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
 %post profile_wearable
@@ -1117,7 +1271,24 @@ fi
 %{crosswalk_extensions_path}/wearable/libtizen*.so
 %{crosswalk_extensions_path}/wearable/plugins.json
 %manifest webapi-plugins.manifest
-%endif
+
+# wearable-extension-emulator
+%ifarch %{ix86} x86_64
+%post wearable-extension-emulator
+ln -sf %{crosswalk_extensions_path}/wearable_emulator/* %{crosswalk_extensions_path}
+%preun wearable-extension-emulator
+# This is an un-installation.
+if [ "$1" == "0" ]; then
+  rm %{crosswalk_extensions_path}/libtizen*.so
+  rm %{crosswalk_extensions_path}/plugins.json
+fi
+%files wearable-extension-emulator
+%dir %{crosswalk_extensions_path}/wearable_emulator/
+%{crosswalk_extensions_path}/wearable_emulator/libtizen*.so
+%{crosswalk_extensions_path}/wearable_emulator/plugins.json
+%manifest webapi-plugins.manifest
+%endif // wearable-extension-emulator
+%endif // wearable
 
 %if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
 %post profile_tv
index ae9d39f..5822c00 100644 (file)
@@ -47,9 +47,6 @@
             ]
           },
         }],
-        ['tizen_is_emulator == 1', {
-          'defines': ['TIZEN_IS_EMULATOR'],
-        }],
       ],
     },
   ],
index 65675fc..cec92de 100644 (file)
@@ -566,17 +566,44 @@ bool SystemInfoDeviceCapability::IsScreen() {
   return true;
 }
 
+
+#define MODEL_NAME      "http://tizen.org/system/model_name"
+#define MODEL_EMULATOR  "Emulator"
+bool _is_emulator(void)
+{
+  int ret;
+  char *model_name = NULL;
+  static bool emul = false;
+  static int set = 0;
+
+  if (set)
+    return emul;
+
+  ret = system_info_get_platform_string(MODEL_NAME, &model_name);
+  if (ret < 0) {
+    LoggerD("Cannot get model name(%d)", ret);
+    return emul;
+  }
+
+  if (!strncmp(MODEL_EMULATOR, model_name, strlen(model_name) + 1))
+    emul = true;
+
+  set = 1;
+  free(model_name);
+
+  return emul;
+}
+
 PlatformResult SystemInfoDeviceCapability::GetPlatformCoreCpuFrequency(int* return_value) {
   LoggerD("Entered");
 
   std::string freq;
   std::string file_name;
 
-#ifdef TIZEN_IS_EMULATOR
-  file_name = "/proc/cpuinfo";
-#else
-  file_name = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
-#endif
+  if(_is_emulator())
+    file_name = "/proc/cpuinfo";
+  else
+    file_name = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
 
   std::ifstream cpuinfo_freq(file_name);
   if (!cpuinfo_freq.is_open()) {
@@ -585,24 +612,24 @@ PlatformResult SystemInfoDeviceCapability::GetPlatformCoreCpuFrequency(int* retu
               ("Failed to get cpu frequency"));
   }
 
-#ifdef TIZEN_IS_EMULATOR
-  //get frequency value from cpuinfo file
-  //example entry for frequency looks like below
-  //cpu MHz   : 3392.046
-  std::size_t found;
-  do {
-    getline(cpuinfo_freq, freq);
-    found = freq.find("cpu MHz");
-  } while (std::string::npos == found && !cpuinfo_freq.eof());
+  if(_is_emulator()) {
+    //get frequency value from cpuinfo file
+    //example entry for frequency looks like below
+    //cpu MHz   : 3392.046
+    std::size_t found;
+    do {
+      getline(cpuinfo_freq, freq);
+      found = freq.find("cpu MHz");
+    } while (std::string::npos == found && !cpuinfo_freq.eof());
 
-  found = freq.find(":");
-  if (std::string::npos != found) {
-    *return_value = std::stoi(freq.substr(found + 2));
+    found = freq.find(":");
+    if (std::string::npos != found) {
+      *return_value = std::stoi(freq.substr(found + 2));
+    }
+  } else {
+    getline(cpuinfo_freq, freq);
+    *return_value = std::stoi(freq) / 1000; // unit: MHz
   }
-#else
-  getline(cpuinfo_freq, freq);
-  *return_value = std::stoi(freq) / 1000; // unit: MHz
-#endif
 
   cpuinfo_freq.close();
   LoggerD("cpu frequency : %d", *return_value);