Enable GLES 3.0 by default.
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor.spec
1 # NOTES
2 # This spec file is used to build DALi Adaptor for different Tizen Profiles
3 # Current profiles are:  Mobile, TV, Wearable, Common
4 #
5 # The profile variable is defined outside of the spec file in a build.conf file.
6 # It will contain the profile and whether or not to build with X11 or Wayland
7 #
8 # gbs will try to download the build.conf for the platform automatically from the repo location when
9 # performing a gbs build ( use gbs build -v to see it download location) E.g.
10 # http://download.tizen.org/snapshots/tizen/tv/tizen-tv/repos/arm-wayland/packages/repodata/xxxx-build.conf.gz
11
12
13 %bcond_with wayland
14
15 Name:       dali-adaptor
16 Summary:    The DALi Tizen Adaptor
17 Version:    1.2.43
18 Release:    1
19 Group:      System/Libraries
20 License:    Apache-2.0 and BSD-3-Clause and MIT
21 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
22 Source0:    %{name}-%{version}.tar.gz
23
24 Requires(post): /sbin/ldconfig
25 Requires(postun): /sbin/ldconfig
26 Requires:       giflib
27
28 #need libtzplatform-config for directory if tizen version is 3.x
29
30 %if 0%{?tizen_version_major} >= 3
31 %define tizen_platform_config_supported 1
32 BuildRequires:  pkgconfig(libtzplatform-config)
33 %endif
34
35
36 # Get the profile from tizen_profile_name if tizen version is 2.x and tizen_profile_name exists.
37
38 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
39 %define profile %{tizen_profile_name}
40 %endif
41
42 %if "%{profile}" == "mobile"
43 %define dali_profile MOBILE
44 %define dali_feedback_plugin 0
45 %define dali_videoplayer_plugin 1
46 %define shaderbincache_flag DISABLE
47 BuildRequires:  pkgconfig(gles20)
48 %define gles_requirement_setup 1
49 %endif
50
51 %if "%{profile}" == "tv"
52 %define dali_profile TV
53 %define dali_feedback_plugin 0
54 %define dali_videoplayer_plugin 1
55 %define shaderbincache_flag DISABLE
56 BuildRequires:  pkgconfig(glesv2)
57 %define gles_requirement_setup 1
58 %endif
59
60 %if "%{profile}" == "wearable"
61 %define dali_profile WEARABLE
62 %define dali_feedback_plugin 0
63 %define dali_videoplayer_plugin 1
64 %define shaderbincache_flag DISABLE
65 BuildRequires:  pkgconfig(gles20)
66 BuildRequires:  pkgconfig(capi-appfw-watch-application)
67 BuildRequires:  pkgconfig(appcore-watch)
68 %define gles_requirement_setup 1
69 %endif
70
71 %if "%{profile}" == "ivi"
72 %define dali_profile IVI
73 %define dali_feedback_plugin 0
74 %define dali_videoplayer_plugin 1
75 %define shaderbincache_flag DISABLE
76 BuildRequires:  pkgconfig(glesv2)
77 %define gles_requirement_setup 1
78 %endif
79
80 %if "%{profile}" == "common"
81 %define dali_profile COMMON
82 %define dali_feedback_plugin 0
83 %define dali_videoplayer_plugin 1
84 %define tizen_2_2_compatibility 0
85 %define shaderbincache_flag DISABLE
86 BuildRequires:  pkgconfig(glesv2)
87 %define gles_requirement_setup 1
88 %endif
89
90 # If we have not set a BuildRequires for the gles version, default it here.
91 %{!?gles_requirement_setup: BuildRequires:  pkgconfig(glesv2)}
92
93 BuildRequires:  pkgconfig
94 BuildRequires:  gawk
95 BuildRequires:  pkgconfig(aul)
96 BuildRequires:  giflib-devel
97 BuildRequires:  pkgconfig(fontconfig)
98 BuildRequires:  libjpeg-turbo-devel
99 BuildRequires:  dali-devel
100 BuildRequires:  dali-integration-devel
101 BuildRequires:  pkgconfig(vconf)
102 BuildRequires:  tts-devel
103 BuildRequires:  pkgconfig(dlog)
104 BuildRequires:  libdrm-devel
105 BuildRequires:  pkgconfig(libexif)
106 BuildRequires:  pkgconfig(libpng)
107 BuildRequires:  pkgconfig(egl)
108 BuildRequires:  libcurl-devel
109 BuildRequires:  pkgconfig(harfbuzz)
110 BuildRequires:  fribidi-devel
111
112 %if 0%{?tizen_2_2_compatibility} != 1
113 BuildRequires:  pkgconfig(capi-system-info)
114 BuildRequires:  pkgconfig(capi-system-sensor)
115 %endif
116
117 # Tizen currently does not have libuv as a separate libuv package
118 # So we have to look into the uv headers bundled inside node-js
119 BuildRequires:  nodejs-devel
120
121
122 %if %{with wayland}
123
124 ####### BUILDING FOR WAYLAND #######
125 BuildRequires:  pkgconfig(wayland-egl)
126 BuildRequires:  pkgconfig(wayland-client)
127 BuildRequires:  wayland-devel
128 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
129 %if "%{profile}" != "common"
130 BuildRequires:  wayland-extension-client-devel
131 %endif
132
133 # dali-adaptor-uv uses libuv mainloop and has its own wayland client (it needs wayland-client headers).
134 BuildRequires:  libxkbcommon-devel
135
136 # dali-adaptor uses ecore mainloop
137 BuildRequires:  pkgconfig(ecore-wayland)
138
139 # dali-adaptor needs tbm_surface in tizen 3.0 wayland
140 BuildRequires:  pkgconfig(libtbm)
141
142 # tpkp-curl (certificate pinning for libcurl functions) is only available in Tizen 3.0
143 BuildRequires:  pkgconfig(tpkp-curl)
144
145 ####### BUILDING FOR X11#######
146 %else
147 BuildRequires:  pkgconfig(egl)
148 BuildRequires:  pkgconfig(xext)
149 BuildRequires:  pkgconfig(xi)
150 BuildRequires:  pkgconfig(xfixes)
151 BuildRequires:  pkgconfig(xdamage)
152 BuildRequires:  pkgconfig(utilX)
153 %endif
154
155 # for dali-adaptor
156 BuildRequires:  pkgconfig(evas)
157 BuildRequires:  pkgconfig(elementary)
158 BuildRequires:  pkgconfig(capi-appfw-application)
159 BuildRequires:  pkgconfig(capi-system-system-settings)
160
161 %if 0%{?over_tizen_2_2}
162 BuildRequires:  pkgconfig(capi-system-info)
163 %endif
164
165
166
167 %description
168 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
169 platform abstraction and application shell
170
171 ##############################
172 # devel
173 ##############################
174 %package devel
175 Summary:    Development components for the DALi Tizen Adaptor
176 Group:      Development/Building
177 Requires:   %{name} = %{version}-%{release}
178 Requires:   %{name}-integration-devel = %{version}-%{release}
179
180 %description devel
181 Development components for the DALi Tizen Adaptor - public headers and package configs
182
183 ##############################
184 # integration-devel
185 ##############################
186 %package integration-devel
187 Summary:    Integration development package for the Adaptor
188 Group:      Development/Building
189 Requires:   %{name} = %{version}-%{release}
190
191 %description integration-devel
192 Integration development package for the Adaptor - headers for integrating with an adaptor library.
193
194 ##############################
195 # Dali Feedback Plugin
196 ##############################
197 %package dali-feedback-plugin
198 Summary:    Plugin to play haptic and audio feedback for Dali
199 Group:      System/Libraries
200 %if 0%{?dali_feedback_plugin}
201 #Requires:       libdeviced
202 BuildRequires:  pkgconfig(mm-sound)
203 #BuildRequires:  pkgconfig(haptic)
204 BuildRequires:  libfeedback-devel
205 %endif
206
207 %description dali-feedback-plugin
208 Feedback plugin to play haptic and audio feedback for Dali
209
210 ##############################
211 # Dali VideoPlayer Plugin
212 ##############################
213 %if %{with wayland}
214
215 %package dali-video-player-plugin
216 Summary:    Plugin to play a video file for Dali
217 Group:      System/Libraries
218 %if 0%{?dali_videoplayer_plugin}
219 BuildRequires:  pkgconfig(capi-media-player)
220 %endif
221
222 %description dali-video-player-plugin
223 VideoPlayer plugin to play a video file for Dali
224 %endif
225
226 ##############################
227 # Preparation
228 ##############################
229 %prep
230 %setup -q
231
232 #Use TZ_PATH when tizen version is 3.x or greater
233
234 %if 0%{?tizen_version_major} >= 3
235 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
236 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
237 %define font_preloaded_path      %TZ_SYS_RO_SHARE/fonts/
238 %define font_downloaded_path     %TZ_SYS_SHARE/fonts/
239 %define font_application_path    %TZ_SYS_RO_SHARE/app_fonts/
240 %define font_configuration_file  %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
241 %else
242 %define dali_data_rw_dir         /usr/share/dali/
243 %define dali_data_ro_dir         /usr/share/dali/
244 %define font_preloaded_path      /usr/share/fonts/
245 %define font_downloaded_path     /opt/share/fonts/
246 %define font_application_path    /usr/share/app_fonts/
247 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
248 %endif
249
250 %define user_shader_cache_dir    %{dali_data_ro_dir}/core/shaderbin/
251 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
252 %define dev_include_path %{_includedir}
253
254 ##############################
255 # Build
256 ##############################
257 %build
258 PREFIX+="/usr"
259 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
260 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
261
262 %ifarch %{arm}
263 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
264 %endif
265
266 %if %{with wayland}
267 CFLAGS+=" -DWAYLAND"
268 CXXFLAGS+=" -DWAYLAND"
269 configure_flags="--enable-wayland"
270 %endif
271
272 %if 0%{?tizen_2_2_compatibility}
273 CFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
274 CXXFLAGS+=" -DTIZEN_SDK_2_2_COMPATIBILITY"
275 %endif
276
277 libtoolize --force
278 cd %{_builddir}/%{name}-%{version}/build/tizen
279 autoreconf --install
280
281 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
282 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
283 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
284 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
285 FONT_APPLICATION_PATH="%{font_application_path}"  ; export FONT_APPLICATION_PATH
286 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
287 %if 0%{?tizen_platform_config_supported}
288 TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
289 %endif
290
291 # Default to GLES 3.0 if not specified.
292 %{!?target_gles_version: %define target_gles_version 30}
293
294 #--enable-efl=no \ # only affects dali-adaptor-uv
295 #--enable-appfw=yes \ # affects both dali-adaptor & dali-adaptor-uv
296 #--with-libuv=/usr/include/node/ \ # only affects dali-adaptor-uv
297
298 # Set up the build via configure.
299 %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=%{target_gles_version} --enable-shaderbincache=%{shaderbincache_flag} --enable-profile=%{dali_profile} \
300 %if 0%{?dali_feedback_plugin}
301            --enable-feedback \
302 %endif
303 %if 0%{?dali_videoplayer_plugin}
304            --enable-videoplayer \
305 %endif
306 %if 0%{?tizen_2_2_compatibility}
307            --with-tizen-2-2-compatibility \
308 %endif
309 %if %{with wayland}
310            --enable-efl=no \
311 %else
312            --enable-efl=yes \
313 %endif
314 %if 0%{?enable_debug}
315            --enable-debug \
316 %endif
317            --enable-appfw=yes \
318            --with-libuv=/usr/include/node/ \
319            $configure_flags --libdir=%{_libdir}
320
321 # Build.
322 make %{?jobs:-j%jobs}
323
324 ##############################
325 # Installation
326 ##############################
327 %install
328 rm -rf %{buildroot}
329 cd build/tizen
330 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
331
332
333 ##############################
334 # Upgrade order:
335 # 1 - Pre Install new package
336 # 2 - Install new package
337 # 3 - Post install new package
338 # 4 - Pre uninstall old package
339 # 5 - Remove files not overwritten by new package
340 # 6 - Post uninstall old package
341 ##############################
342
343 %pre
344 exit 0
345
346 ##############################
347 #  Post Install new package
348 ##############################
349 %post
350 /sbin/ldconfig
351 exit 0
352
353 %if 0%{?dali_feedback_plugin}
354 %post dali-feedback-plugin
355 /sbin/ldconfig
356 exit 0
357 %endif
358
359 %if %{with wayland}
360 %if 0%{?dali_videoplayer_plugin}
361 %post dali-video-player-plugin
362 /sbin/ldconfig
363 exit 0
364 %endif
365 %endif
366
367 ##############################
368 #   Pre Uninstall old package
369 ##############################
370 %preun
371 exit 0
372
373 ##############################
374 #   Post Uninstall old package
375 ##############################
376 %postun
377 /sbin/ldconfig
378 exit 0
379
380 %if 0%{?dali_feedback_plugin}
381 %postun dali-feedback-plugin
382 /sbin/ldconfig
383 exit 0
384 %endif
385
386 %if %{with wayland}
387 %if 0%{?dali_videoplayer_plugin}
388 %postun dali-video-player-plugin
389 /sbin/ldconfig
390 exit 0
391 %endif
392 %endif
393
394 ##############################
395 # Files in Binary Packages
396 ##############################
397
398 %files
399 %manifest dali-adaptor.manifest
400 %defattr(-,root,root,-)
401 %{_libdir}/libdali-adap*.so*
402 %defattr(-,app,app,-)
403 %dir %{user_shader_cache_dir}
404 %{_bindir}/*
405 %license LICENSE
406
407 %files devel
408 %defattr(-,root,root,-)
409 %{dev_include_path}/dali/dali.h
410 %{dev_include_path}/dali/public-api/*
411 %{dev_include_path}/dali/devel-api/*
412 %{dev_include_path}/dali/doc/*
413 %{_libdir}/pkgconfig/dali-adaptor.pc
414 %{_libdir}/pkgconfig/dali-adaptor-uv.pc
415
416 %files integration-devel
417 %defattr(-,root,root,-)
418 %{dev_include_path}/dali/integration-api/adaptors/*
419 %{_libdir}/pkgconfig/dali-adaptor-integration.pc
420
421 %if 0%{?dali_feedback_plugin}
422 %files dali-feedback-plugin
423 %defattr(-,root,root,-)
424 %{_libdir}/libdali-feedback-plugin.so*
425 %{dali_plugin_sound_files}/*
426 %endif
427
428 %if %{with wayland}
429 %if 0%{?dali_videoplayer_plugin}
430 %files dali-video-player-plugin
431 %manifest dali-adaptor.manifest
432 %defattr(-,root,root,-)
433 %{_libdir}/libdali-video-player-plugin.so*
434 %license LICENSE
435 %endif
436 %endif