Print dlerror() for debugging
[platform/framework/web/crosswalk-tizen.git] / packaging / crosswalk-tizen.spec
1 %bcond_with wayland
2 %bcond_with x
3
4 %define extension_path %{_libdir}/tizen-extensions-crosswalk
5 %define injected_bundle_path %{_libdir}/libxwalk_injected_bundle.so
6
7 Name:       crosswalk-tizen
8 Summary:    Crosswalk Runtime and AppShell for Tizen
9 Version:    1.0.0
10 Release:    1
11 Group:      Development/Libraries
12 License:    Apache-2.0 and BSD-3-Clause
13 URL:        https://www.tizen.org
14 Source0:    %{name}-%{version}.tar.gz
15 Source1001: %{name}.manifest
16 Source1002: wrt.loader
17
18 BuildRequires: boost-devel
19 BuildRequires: edje-tools
20 BuildRequires: gettext
21 BuildRequires: ninja
22 BuildRequires: python
23 BuildRequires: pkgconfig(appsvc)
24 BuildRequires: pkgconfig(aul)
25 BuildRequires: pkgconfig(bundle)
26 BuildRequires: pkgconfig(capi-appfw-application)
27 BuildRequires: pkgconfig(capi-appfw-app-manager)
28 BuildRequires: pkgconfig(capi-appfw-package-manager)
29 BuildRequires: pkgconfig(capi-system-system-settings)
30 BuildRequires: pkgconfig(capi-system-info)
31 BuildRequires: pkgconfig(capi-ui-efl-util)
32 BuildRequires: pkgconfig(chromium-efl) >= 56.0.0, pkgconfig(chromium-efl) < 57.0.0
33 BuildRequires: pkgconfig(cynara-client)
34 BuildRequires: pkgconfig(deviced)
35 BuildRequires: pkgconfig(dlog)
36 BuildRequires: pkgconfig(ecore)
37 BuildRequires: pkgconfig(efl-extension)
38 BuildRequires: pkgconfig(elementary)
39 BuildRequires: pkgconfig(glib-2.0)
40 BuildRequires: pkgconfig(libwebappenc)
41 BuildRequires: pkgconfig(wgt-manifest-handlers)
42 BuildRequires: pkgconfig(manifest-parser)
43 BuildRequires: pkgconfig(notification)
44 BuildRequires: pkgconfig(pkgmgr-info)
45 BuildRequires: pkgconfig(sqlite3)
46 BuildRequires: pkgconfig(uuid)
47 BuildRequires: pkgconfig(launchpad)
48 BuildRequires: pkgconfig(ttrace)
49 BuildRequires: pkgconfig(jsoncpp)
50 BuildRequires: pkgconfig(vc-webview)
51
52 %define chromium_efl_workaround_ewk_settings   0
53
54 %if "%{?profile}" == "mobile"
55 %define tizen_feature_rotary_event_support     0
56 %define tizen_feature_web_ime_support          0
57 %define tizen_feature_watch_face_support       0
58 %endif
59
60 %if "%{?profile}" == "wearable"
61 %define tizen_feature_rotary_event_support     1
62 %define tizen_feature_web_ime_support          1
63 %define tizen_feature_watch_face_support       1
64 %define chromium_efl_workaround_ewk_settings   1
65 %endif
66
67 %if "%{?profile}" == "tv"
68 %define tizen_feature_rotary_event_support     0
69 %define tizen_feature_web_ime_support          1
70 %define tizen_feature_watch_face_support       0
71 %endif
72
73 # If it is unified environment.
74 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
75 %define tizen_feature_rotary_event_support     1
76 %define tizen_feature_web_ime_support          1
77 %define tizen_feature_watch_face_support       1
78 %endif
79
80 # In "unified" build environment, where "profile" is none of mobile/wearable/tv/common/ivi, but a new value or undefined,
81 # all the "feature"s are to be supported and be activated selectively at runtime/inittime.
82 # (the profile is probed at runtime)
83
84 # tizen_feature_rotary..._support          (==> platform_info / wearable)
85 # tizen_feature_web_ime_support            (==> platform_info / wearable || TV)
86 # tizen_feature_watch_face_support         (==> platform_info / wearable)
87 # tizen_feature_manual_rotate_support      (==> platform_info / mobile)
88
89 %if 0%{?tizen_feature_web_ime_support}
90 BuildRequires: pkgconfig(capi-ui-inputmethod)
91 %endif
92
93 %if 0%{?tizen_feature_watch_face_support}
94 BuildRequires: pkgconfig(capi-appfw-watch-application)
95 BuildRequires: pkgconfig(appcore-watch)
96 %endif
97
98
99 Requires: /usr/bin/systemctl
100
101 %description
102 Crosswalk Runtime and AppShell for Tizen 3.0 and later
103
104 # If it is unified or wearable, create circular-display extension
105 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
106 %package extension-circle
107 Summary:      Extension for Crosswalk-Tizen with Circular Displays (Tizen Wearable)
108 Requires:     %{name} = %{version}-%{release}
109 %description extension-circle
110 Extension for Crosswalk-Tizen with Circular Displays of Tizen Wearable Profile.
111 You need to install %{name} before installing this extension.
112 %endif
113
114 %prep
115 %setup -q
116
117 cp %{SOURCE1001} .
118
119 %build
120 export GYP_GENERATORS='ninja'
121 GYP_OPTIONS="--depth=."
122 # Not required anymore
123 #-Dprofile=%{profile}"
124
125 # BuildType: Debug / Release
126 %if 0%{?tizen_build_devel_mode}
127 GYP_OPTIONS="$GYP_OPTIONS -Dbuild_type=Debug"
128 %else
129 GYP_OPTIONS="$GYP_OPTIONS -Dbuild_type=Release"
130 %endif
131
132 # Feature flags
133 # TODO: in unified environment, the following feature flags are useless (always on)
134 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_rotary_event_support=%{?tizen_feature_rotary_event_support}"
135 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_ime_support=%{?tizen_feature_web_ime_support}"
136 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_watch_face_support=%{?tizen_feature_watch_face_support}"
137 # Not required anymore
138 #GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_manual_rotate_support=%{?tizen_feature_manual_rotate_support}"
139
140 # Extension Path
141 GYP_OPTIONS="$GYP_OPTIONS -Dextension_path=%{extension_path}"
142
143 # Injected bundle
144 GYP_OPTIONS="$GYP_OPTIONS -Dinjected_bundle_path=%{injected_bundle_path}"
145
146 # Chromium-EFL generated CAPI header files differently per profile.
147 # Until they are unified a function "ewk_settings_form_candidate_data_enabled_set()" cannot be used for wearable.
148 # Therefore, until chromium-efl gets refactored to emit devel packages equally for every profile, let's keep this.
149 GYP_OPTIONS="$GYP_OPTIONS -Dchromium_efl_workaround_ewk_settings=%{chromium_efl_workaround_ewk_settings}"
150
151 # Tizen product tv
152 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_product_tv=%{!?TIZEN_PRODUCT_TV:0}"
153
154 GYP_OPTIONS_BASE="$GYP_OPTIONS"
155
156 # TODO: do not use model_build_feature.
157 GYP_OPTIONS="$GYP_OPTIONS_BASE -Dtizen_model_formfactor=rectangle"
158
159 echo "PROFILE = %{?profile}"
160
161 # If it is unified or wearable, create circular-display extension
162 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
163 # TODO: do not use model_build_feature.
164 GYP_OPTIONS="$GYP_OPTIONS_BASE -Dtizen_model_formfactor=circle"
165 mkdir -p build_circle
166 ./tools/gyp/gyp $GYP_OPTIONS xwalk_tizen.gyp
167 ninja -C out/Default %{?_smp_mflags}
168 mkdir -p out/Circle
169 mv out/Default/xwalk_runtime out/Circle/
170 %endif
171
172 # Build
173 ./tools/gyp/gyp $GYP_OPTIONS xwalk_tizen.gyp
174 ninja -C out/Default %{?_smp_mflags}
175
176 %install
177
178 # Prepare directories
179 mkdir -p %{buildroot}%{_libdir}
180 mkdir -p %{buildroot}%{_bindir}
181 mkdir -p %{buildroot}%{_datadir}/locale
182 mkdir -p %{buildroot}%{_datadir}/icons/xwalk
183 mkdir -p %{buildroot}%{_datadir}/edje/xwalk
184 mkdir -p %{buildroot}%{extension_path}
185
186 # Loader script file
187 mkdir -p %{buildroot}%{_datadir}/aul/
188 cp %{SOURCE1002} %{buildroot}%{_datadir}/aul/
189
190 # Popup icon
191 cp runtime/resources/icons/*.png %{buildroot}%{_datadir}/icons/xwalk/
192
193 # xwalk_common
194 install -p -m 644 out/Default/lib/libxwalk_tizen_common.so %{buildroot}%{_libdir}
195
196 # widget_plugin
197 install -p -m 644 out/Default/lib/libwidget_plugin.so %{buildroot}%{extension_path}
198 install -p -m 644 out/Default/gen/widget.json %{buildroot}%{extension_path}
199
200 # screen_plugin
201 install -p -m 644 out/Default/lib/libsplash_screen_plugin.so %{buildroot}%{extension_path}
202 install -p -m 644 out/Default/gen/splash_screen.json %{buildroot}%{extension_path}
203
204 # xwalk_runtime
205 install -p -m 755 out/Default/xwalk_runtime %{buildroot}%{_bindir}
206 ln -s %{_bindir}/xwalk_runtime %{buildroot}%{_bindir}/wrt
207 ln -s %{_bindir}/xwalk_runtime %{buildroot}%{_bindir}/wrt-client
208 # If it is unified or wearable, create circular-display extension
209 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
210 install -p -m 755 out/Circle/xwalk_runtime %{buildroot}%{_bindir}/xwalk_runtime.circle
211 %endif
212
213 # xwalk extension shared
214 install -p -m 644 out/Default/lib/libxwalk_extension_shared.so %{buildroot}%{_libdir}
215
216 # xwalk_runtime_resources
217 for file in $(find out/Default/gen/locales -type f -name *.mo); do
218   install -m 644 -D $file %{buildroot}%{_datadir}/locale/${file#out/Default/gen/locales/}
219 done
220 install -p -m 644 out/Default/gen/*.edj %{buildroot}%{_datadir}/edje/xwalk
221
222 # xwalk_injected_bundle
223 install -p -m 755 out/Default/lib/libxwalk_injected_bundle.so %{buildroot}%{_libdir}
224
225 # wrt-loader
226 install -p -m 755 out/Default/wrt-loader %{buildroot}%{_bindir}
227
228 %clean
229 rm -fr %{buildroot}
230
231 %files
232 %manifest %{name}.manifest
233 %attr(755,root,root) %{_datadir}/locale/*
234 %attr(644,root,root) %{_datadir}/icons/xwalk/*
235 %attr(644,root,root) %{_datadir}/edje/xwalk/*.edj
236 %attr(644,root,root) %{_libdir}/libxwalk_tizen_common.so
237 %attr(644,root,root) %{_libdir}/libxwalk_injected_bundle.so
238 %attr(644,root,root) %{_libdir}/libxwalk_extension_shared.so
239 %attr(644,root,root) %{extension_path}/libwidget_plugin.so
240 %attr(644,root,root) %{extension_path}/widget.json
241 %attr(644,root,root) %{extension_path}/libsplash_screen_plugin.so
242 %attr(644,root,root) %{extension_path}/splash_screen.json
243 %attr(755,root,root) %{_bindir}/xwalk_runtime
244 %attr(755,root,root) %{_bindir}/wrt
245 %attr(755,root,root) %{_bindir}/wrt-client
246 %attr(755,root,root) %{_bindir}/wrt-loader
247 %attr(644,root,root) %{_datadir}/aul/wrt.loader
248 %license LICENSE LICENSE.BSD
249
250 # If it is unified or wearable, create circular-display extension
251 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
252 %post extension-circle
253 ln -sf xwalk_runtime.circle %{_bindir}/xwalk_runtime
254 %preun extension-circle
255 echo "You need to reinstall %{name} if you want to let %{name} behave correctly after uninstalling this package."
256 %files extension-circle
257 %attr(755,root,root) %{_bindir}/xwalk_runtime.circle
258 %endif