[Tizen] Support asan build option
[platform/core/uifw/dali-extension.git] / packaging / dali-extension.spec
1 # NOTES
2 # This spec file is used to build DALi Extensions
3 #
4 # gbs will try to download the build.conf for the platform automatically from the repo location when
5 # performing a gbs build ( use gbs build -v to see it download location) E.g.
6 # http://download.tizen.org/snapshots/tizen/tv/tizen-tv/repos/arm-wayland/packages/repodata/xxxx-build.conf.gz
7
8 Name:       dali2-extension
9 Summary:    The DALi Tizen Extensions
10 Version:    2.3.10
11 Release:    1
12 Group:      System/Libraries
13 License:    Apache-2.0 and BSD-3-Clause and MIT
14 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-extensions.git;a=summary
15 Source0:    %{name}-%{version}.tar.gz
16
17 %if 0%{?tizen_version_major} >= 4
18 %define tizen_40_or_greater 1
19 %endif
20
21 %if 0%{?tizen_version_major} >= 5
22 %define tizen_50_or_greater 1
23 %endif
24
25 %if ( 0%{?tizen_version_major} == 5 && 0%{?tizen_version_minor} >= 5 ) || 0%{?tizen_version_major} >= 6
26 %define tizen_55_or_greater 1
27 %endif
28
29 %if ( 0%{?tizen_version_major} == 6 && 0%{?tizen_version_minor} >= 5 ) || 0%{?tizen_version_major} >= 7
30 %define tizen_65_or_greater 1
31 %endif
32
33 %if %{undefined NO_WEB_FRAMEWORK}
34 %define enable_web_engine_plugin 1
35 %endif
36
37 %define enable_color_controller 1
38
39 Requires(post): /sbin/ldconfig
40 Requires(postun): /sbin/ldconfig
41
42 BuildRequires:  pkgconfig
43 BuildRequires:  pkgconfig(dali2-core)
44 BuildRequires:  pkgconfig(dali2-adaptor)
45 BuildRequires:  pkgconfig(dali2-toolkit)
46 BuildRequires:  pkgconfig(dlog)
47
48 BuildRequires:  pkgconfig(dali2-adaptor-integration)
49 BuildRequires:  pkgconfig(ecore-wl2)
50
51 # For evas-plugin
52 %if 0%{?enable_evas_plugin}
53 BuildRequires:  pkgconfig(elementary)
54 BuildRequires:  pkgconfig(evas)
55 %endif
56
57 %if 0%{?tizen_65_or_greater}
58 BuildRequires:  pkgconfig(rive_tizen)
59 %endif
60
61 # For ASAN test
62 %if "%{vd_asan}" == "1" || "%{asan}" == "1"
63 BuildRequires: asan-force-options
64 BuildRequires: asan-build-env
65 BuildRequires: libasan
66 %endif
67
68 %description
69 dali-extension
70
71
72 #############################
73 # devel
74 ##############################
75 %package devel
76 Summary:    Development components for the DALi Extension
77 Group:      Development/Building
78 Requires:   %{name} = %{version}-%{release}
79
80 %description devel
81 Development components for the DALi Tizen Extensions - public headers and package configs
82
83 ##############################
84 # Dali Key Extension
85 ##############################
86
87 %package key-extension
88 Summary:    Plugin to support extension keys for Dali
89 Group:      System/Libraries
90
91 %description key-extension
92 Plugin to support extension keys for Dali
93
94 ##############################
95 # Dali VideoPlayer Plugin
96 ##############################
97
98 %package video-player-plugin
99 Summary:    Plugin to play a video file for Dali
100 Group:      System/Libraries
101 BuildRequires: pkgconfig(capi-media-player)
102 BuildRequires: pkgconfig(capi-system-info)
103 # dali-adaptor uses ecore mainloop
104 %if 0%{?tizen_version_major} >= 5
105 BuildRequires:  pkgconfig(ecore-wl2)
106 %else
107 BuildRequires:  pkgconfig(ecore-wayland)
108 %endif
109
110 %description video-player-plugin
111 VideoPlayer plugin to play a video file for Dali
112
113 ##############################
114 # Dali CameraPlayer Plugin
115 ##############################
116
117 %package camera-player-plugin
118 Summary:    Plugin to play a camera file for Dali
119 Group:      System/Libraries
120 BuildRequires: pkgconfig(capi-media-camera)
121 # dali-adaptor uses ecore mainloop
122 BuildRequires:  pkgconfig(ecore-wl2)
123
124 %description camera-player-plugin
125 CameraPlayer plugin to play a camera file for Dali
126
127 ##############################
128 # Dali Web Engine chromium Plugin
129 ##############################
130
131 %package web-engine-chromium-plugin
132 Summary:    Plugin to support WebView for Dali
133 Group:      System/Libraries
134 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
135 BuildRequires: pkgconfig(libtbm)
136 BuildRequires: pkgconfig(chromium-efl)
137 BuildRequires: pkgconfig(elementary)
138 %endif
139
140 %description web-engine-chromium-plugin
141 Web Engine chromium plugin to support WebView for Dali
142
143 ##############################
144 # Dali Image Loader Plugin
145 ##############################
146
147 %package image-loader-plugin
148 Summary:    Plugin to image loading for Dali
149 Group:      System/Libraries
150
151 %description image-loader-plugin
152 Image Loader plugin to image loading file for Dali
153
154 ####################################
155 # Vector Animation Renderer Plugin
156 ####################################
157 %package vector-animation-renderer-plugin
158 Summary:    Plugin to render a vector animation
159 Group:      System/Libraries
160 %if 0%{?tizen_55_or_greater}
161 BuildRequires:  pkgconfig(rlottie)
162 %endif
163
164 %description vector-animation-renderer-plugin
165 Plugin to render a vector animation
166
167 ####################################
168 # color controller Plugin
169 ####################################
170
171 %package color-controller-plugin
172 Summary:    Plugin to load color theme
173 Group:      System/Libraries
174
175 %description color-controller-plugin
176 Plugin to load color theme
177
178 ##############################
179 # Dali Web Engine LWE Plugin
180 ##############################
181
182 %package web-engine-lwe-plugin
183 Summary:    Plugin to support WebView for Dali
184 Group:      System/Libraries
185 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
186 BuildRequires: pkgconfig(libtbm)
187 BuildRequires: pkgconfig(lightweight-web-engine)
188 %endif
189
190 %description web-engine-lwe-plugin
191 Web Engine LWE(Light-weight Web Engine) plugin to support WebView for Dali
192
193 ####################################
194 # Rive Animation View Plugin
195 ####################################
196 %package rive-animation-view
197 Summary:    Plugin to render a rive animation
198 Group:      System/Libraries
199 Requires: dali2-extension-rive-animation-view = %{version}-%{release}
200 %if 0%{?tizen_65_or_greater}
201 BuildRequires:  pkgconfig(thorvg)
202 BuildRequires:  pkgconfig(rive_tizen)
203 %endif
204
205 %description rive-animation-view
206 Plugin to render a rive animation
207
208 %package rive-animation-view-devel
209 Summary: Development components for rive animation view
210 Group: System/Libraries
211 Requires: dali2-extension-rive-animation-view = %{version}-%{release}
212
213 %description rive-animation-view-devel
214 Header & package configuration of rive-animation-view
215
216 ##############################
217 # Preparation
218 ##############################
219 %prep
220 %setup -q
221
222 #Use TZ_PATH when tizen version is 3.x or greater
223
224 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
225 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
226 %define dev_include_path %{_includedir}
227
228 ##############################
229 # Build
230 ##############################
231 %build
232 PREFIX+="/usr"
233 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
234 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
235
236 %if 0%{?tizen_version_major} >= 5
237 CFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
238 CXXFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
239 configure_flags="--enable-ecore-wl2"
240 %endif
241
242 %if "%{?profile}" == "tv"
243 CFLAGS+=" -DOS_TIZEN_TV"
244 CXXFLAGS+=" -DOS_TIZEN_TV"
245 %endif
246
247 %if "%{vd_asan}" == "1" || "%{asan}" == "1"
248 CFLAGS+=" -fsanitize=address"
249 CXXFLAGS+=" -fsanitize=address"
250 LDFLAGS+=" -fsanitize=address"
251 %endif
252
253 libtoolize --force
254 cd %{_builddir}/%{name}-%{version}/build/tizen
255 autoreconf --install
256
257 %configure --prefix=$PREFIX \
258 %if 0%{?enable_debug}
259            --enable-debug \
260 %endif
261 %if 0%{?tizen_50_or_greater}
262            --with-tizen-50-or-greater \
263 %endif
264 %if 0%{?tizen_55_or_greater}
265            --with-tizen-55-or-greater \
266 %endif
267 %if 0%{?tizen_65_or_greater}
268            --with-tizen-65-or-greater \
269 %endif
270 %if 0%{?enable_web_engine_plugin} == 1
271            --enable-web-engine-plugin \
272 %endif
273 %if 0%{?enable_image_loader}
274            --enable-imageloader-extension \
275 %endif
276 %if 0%{?enable_color_controller}
277            --enable-color-controller \
278 %endif
279 %if 0%{?enable_evas_plugin}
280            --enable-evas-plugin \
281 %endif
282            --enable-ecore-wl2 \
283            --enable-keyextension
284
285 make %{?jobs:-j%jobs}
286
287 ##############################
288 # Installation
289 ##############################
290 %install
291 rm -rf %{buildroot}
292
293 # install dali.sh
294 mkdir -p %{buildroot}%{_sysconfdir}/profile.d
295
296 %if "%{?profile}" != "common" && "%{?profile}" != "ivi"
297 install -m 0644 scripts/dali.sh %{buildroot}%{_sysconfdir}/profile.d
298 %endif
299
300 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
301 install -m 0644 scripts/other/dali.sh %{buildroot}%{_sysconfdir}/profile.d
302 %endif
303
304 cd build/tizen
305 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
306
307 %pre
308 exit 0
309
310 ##############################
311 #  Post Install new package
312 ##############################
313 %post
314 /sbin/ldconfig
315 exit 0
316
317 %post key-extension
318 /sbin/ldconfig
319 exit 0
320
321 %post video-player-plugin
322 /sbin/ldconfig
323 exit 0
324
325 %post camera-player-plugin
326 /sbin/ldconfig
327 exit 0
328
329 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
330 %post web-engine-chromium-plugin
331 pushd %{_libdir}
332 ln -sf libdali2-web-engine-chromium-plugin.so libdali2-web-engine-plugin.so
333 popd
334 /sbin/ldconfig
335 exit 0
336 %endif
337
338 %if 0%{?enable_image_loader}
339 %post image-loader-plugin
340 /sbin/ldconfig
341 exit 0
342 %endif
343
344 %if 0%{?tizen_55_or_greater}
345 %post vector-animation-renderer-plugin
346 /sbin/ldconfig
347 exit 0
348 %endif
349
350 %if 0%{?tizen_65_or_greater}
351 %post rive-animation-view
352 /sbin/ldconfig
353 exit 0
354 %endif
355
356 %if 0%{?enable_color_controller}
357 %post color-controller-plugin
358 /sbin/ldconfig
359 exit 0
360 %endif
361
362 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
363 %post web-engine-lwe-plugin
364 /sbin/ldconfig
365 exit 0
366 %endif
367
368 ##############################
369 #   Pre Uninstall old package
370 ##############################
371 %preun
372 exit 0
373
374 ##############################
375 #   Post Uninstall old package
376 ##############################
377 %postun
378 /sbin/ldconfig
379 exit 0
380
381 %postun key-extension
382 /sbin/ldconfig
383 exit 0
384
385 %postun video-player-plugin
386 /sbin/ldconfig
387 exit 0
388
389 %postun camera-player-plugin
390 /sbin/ldconfig
391 exit 0
392
393 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
394 %postun web-engine-chromium-plugin
395 /sbin/ldconfig
396 exit 0
397 %endif
398
399 %if 0%{?enable_image_loader}
400 %postun image-loader-plugin
401 /sbin/ldconfig
402 exit 0
403 %endif
404
405 %if 0%{?tizen_55_or_greater}
406 %postun vector-animation-renderer-plugin
407 /sbin/ldconfig
408 exit 0
409 %endif
410
411 %if 0%{?tizen_65_or_greater}
412 %postun rive-animation-view
413 /sbin/ldconfig
414 exit 0
415 %endif
416
417 %if 0%{?enable_color_controller}
418 %postun color-controller-plugin
419 /sbin/ldconfig
420 exit 0
421 %endif
422
423 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
424 %postun web-engine-lwe-plugin
425 /sbin/ldconfig
426 exit 0
427 %endif
428
429 ##############################
430 # Files in Binary Packages
431 ##############################
432
433 %files
434 %manifest dali-extension.manifest
435 %defattr(-,root,root,-)
436 %{_sysconfdir}/profile.d/dali.sh
437 %{_libdir}/libdali2-extension.so*
438 %license LICENSE
439
440 %files devel
441 %defattr(-,root,root,-)
442 %{_includedir}/dali-extension/*
443 %{_libdir}/pkgconfig/dali2-extension.pc
444
445 %files key-extension
446 %manifest dali-extension.manifest
447 %defattr(-,root,root,-)
448 %{_libdir}/libdali2-key-extension.so*
449 %license LICENSE
450
451 %files video-player-plugin
452 %manifest dali-extension.manifest
453 %defattr(-,root,root,-)
454 %{_libdir}/libdali2-video-player-plugin.so*
455 %license LICENSE
456
457 %if 0%{?tizen_65_or_greater}
458 %files camera-player-plugin
459 %manifest dali-extension.manifest
460 %defattr(-,root,root,-)
461 %{_libdir}/libdali2-camera-player-plugin.so*
462 %license LICENSE
463 %endif
464
465 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
466 %files web-engine-chromium-plugin
467 %manifest dali-extension.manifest
468 %defattr(-,root,root,-)
469 %{_libdir}/libdali2-web-engine-chromium-plugin.so*
470 %license LICENSE
471 %endif
472
473 %if 0%{?enable_image_loader}
474 %files image-loader-plugin
475 %manifest dali-extension.manifest
476 %defattr(-,root,root,-)
477 %{_libdir}/libdali2-image-loader-plugin.so*
478 %license LICENSE
479 %endif
480
481 %if 0%{?tizen_55_or_greater}
482 %files vector-animation-renderer-plugin
483 %manifest dali-extension.manifest
484 %defattr(-,root,root,-)
485 %{_libdir}/libdali2-vector-animation-renderer-plugin.so*
486 %license LICENSE
487 %endif
488
489 %if 0%{?tizen_65_or_greater}
490 %files rive-animation-view
491 %manifest dali-extension.manifest
492 %defattr(-,root,root,-)
493 %{_libdir}/libdali2-extension-rive-animation-view.so*
494 %license LICENSE
495
496 %files rive-animation-view-devel
497 %defattr(-,root,root,-)
498 %{_includedir}/dali-extension/devel-api/rive-animation-view/*
499 %{_libdir}/pkgconfig/dali2-extension-rive-animation-view.pc
500 %endif
501
502 %if 0%{?enable_color_controller}
503 %files color-controller-plugin
504 %manifest dali-extension.manifest
505 %defattr(-,root,root,-)
506 %{_libdir}/libdali2-color-controller-plugin.so*
507 %license LICENSE
508 %endif
509
510 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
511 %files web-engine-lwe-plugin
512 %manifest dali-extension.manifest
513 %defattr(-,root,root,-)
514 %{_libdir}/libdali2-web-engine-lwe-plugin.so*
515 %license LICENSE
516 %endif