Update according to the actual Q1 tizen common release
[scm/bb/meta-tizen.git] / meta-tizen-ivi / meta-tizen-common-share / recipes-crosswalk / crosswalk / crosswalk.inc
1 DESCRIPTION = "Chromium-based app runtime"
2 HOMEPAGE = "https://github.com/otcshare/crosswalk"
3 SECTION = "Web Framework/Web Run Time"
4 LICENSE = "(BSD-3-Clause and LGPL-2.1+)"
5 PV = "11.40.277.0"
6
7 SRC_URI = ""
8
9 S = "${WORKDIR}/git"
10
11 inherit manifest autotools-brokensep
12
13 BBCLASSEXTEND = ""
14 PROVIDES = ""
15
16 #PROVIDES by crosswalk
17
18
19 #PROVIDES by widget-manifest-parser
20 PROVIDES += "widget-manifest-parser"
21
22
23 #PROVIDES by widget-manifest-parser-dev
24 PROVIDES += "widget-manifest-parser-dev"
25
26
27 RDEPENDS = ""
28 #RDEPENDS of crosswalk (${PN})
29 RDEPENDS_${PN} += "ca-certificates-tizen"
30 RDEPENDS_${PN} += "ss-server"
31
32 #RDEPENDS of widget-manifest-parser (widget-manifest-parser)
33 RDEPENDS_widget-manifest-parser += "crosswalk"
34
35 #RDEPENDS of widget-manifest-parser-dev (widget-manifest-parser-dev)
36 RDEPENDS_widget-manifest-parser-dev += "crosswalk"
37 RDEPENDS_widget-manifest-parser-dev += "widget-manifest-parser"
38
39
40 DEPENDS = ""
41 #DEPENDS of crosswalk
42 DEPENDS += "pkgconfig(protobuf)"
43 DEPENDS += "cairo"
44 DEPENDS += "pkgmgr"
45 DEPENDS += "expat"
46 DEPENDS += "udev"
47 DEPENDS += "app-core"
48 DEPENDS += "xmlsec1"
49 DEPENDS += "libxslt"
50 inherit perlnative
51 DEPENDS += "secure-storage"
52 DEPENDS += "bzip2"
53 DEPENDS += "nss"
54 DEPENDS += "alsa-lib"
55 DEPENDS += "elfutils"
56 inherit pkgconfig
57 DEPENDS += "yasm"
58 DEPENDS += "fontconfig"
59 DEPENDS += "system-server"
60 DEPENDS += "wayland"
61 DEPENDS += "which"
62 DEPENDS += "libxml2"
63 DEPENDS_append_class-native = " bison-native"
64 DEPENDS_append_class-target = " bison-native"
65 DEPENDS += "sensord"
66 DEPENDS += "icu"
67 DEPENDS += "flex"
68 DEPENDS += "freetype"
69 DEPENDS += "gperf"
70 inherit pythonnative
71 DEPENDS += "tizen-platform-config"
72 DEPENDS += "pkgmgr-info"
73 DEPENDS += "glib-2.0"
74 DEPENDS += "libdrm"
75 DEPENDS += "libcap"
76 DEPENDS += "python-xml"
77 DEPENDS_append_class-native = " ninja-native"
78 DEPENDS_append_class-target = " ninja-native"
79 DEPENDS += "pango"
80 DEPENDS += "vconf"
81 DEPENDS += "virtual/egl"
82 DEPENDS += "libxkbcommon"
83 DEPENDS += "dbus"
84 DEPENDS += "pulseaudio"
85 DEPENDS += "libexif"
86 DEPENDS += "ail"
87 DEPENDS += "capi-location-manager"
88 DEPENDS += "pciutils"
89 DEPENDS += "binutils"
90
91 do_prep() {
92  cd ${S}
93  chmod -Rf a+rX,u+w,g-w,o-w ${S}
94  #setup -q -n crosswalk
95  
96  cp ${S}/packaging/xwalk.in .
97  cp ${S}/packaging/xwalk.service.in .
98  cp ${S}/packaging/crosswalk.manifest .
99  cp ${S}/packaging/crosswalk.xml.in .
100  cp ${S}/packaging/crosswalk.png .
101  cp ${S}/packaging/changedate.py .
102  sed "s/@VERSION@/11.40.277.0/g" crosswalk.xml.in > crosswalk.xml
103  sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.in > xwalk
104  sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.service.in > xwalk.service
105  
106  # Widget manifest parser devel
107  cp src/xwalk/tizen/widget-manifest-parser/widget-manifest-parser.pc.in .
108  sed "s|@VERSION@|11.40.277.0|g" widget-manifest-parser.pc.in > widget-manifest-parser.pc
109  
110  cp -a src/AUTHORS AUTHORS.chromium
111  cp -a src/LICENSE LICENSE.chromium
112  cp -a src/xwalk/LICENSE LICENSE.xwalk
113  
114  # The profiles using Wayland (and thus Ozone) do not need this patch.
115  
116  
117 }
118 do_patch_append() {
119     bb.build.exec_func('do_prep', d)
120 }
121
122 do_configure() {
123 }
124
125 do_compile() {
126  cd ${S}
127  LANG=C
128  export LANG
129  unset DISPLAY
130  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
131  
132  
133  mkdir -p src/out
134  tar -zxvf ${prefix}/share/crosswalk-thirdparty/out.tgz
135  python ./changedate.py
136  
137  # Stop unconditionally passing -Wall to the compiler. Chromium has its own
138  # mechanisms for deciding which parts of the code need -Wall and which need it
139  # to be left out (since several pieces are built with -Werror). At least in
140  # M39, this is preventing the "rtc_base" target from being built because it
141  # does not expect -Wall to be passed to the compiler (see webrtc issue 3307).
142  export CXXFLAGS=`echo $CXXFLAGS | sed s,-Wall,,g`
143  
144  # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
145  # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
146  # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
147  export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
148  
149  
150  # Building the RPM in the GBS chroot fails with errors such as
151  #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
152  #       failed to set dynamic section sizes: Memory exhausted
153  # For now, work around it by passing a GNU ld-specific flag that optimizes the
154  # linker for memory usage.
155  export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
156  
157  # Support building in a non-standard directory, possibly outside ${WORKDIR}.
158  # Since the build root is erased every time a new build is performed, one way
159  # to avoid losing the build directory is to specify a location outside the
160  # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
161  # (remember all paths are still inside the chroot):
162  #    gbs build --define 'BUILDDIR_NAME /some/path'
163  BUILDDIR_NAME=""
164  if [ -n "${BUILDDIR_NAME}" ]; then
165     mkdir -p "${BUILDDIR_NAME}"
166     ln -s "${BUILDDIR_NAME}" src/out
167  fi
168  
169  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
170  
171  # Force gold binary from chroot ld.gold provided by binutils-gold
172  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=1 -Dlinux_use_bundled_binutils=0 -Dlinux_use_bundled_gold=0 "
173  
174  # Linking fails when fatal ld warnings are enabled. See XWALK-1379.
175  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
176  
177  # For building for arm in OBS, we need :
178  # -> to unset sysroot value.
179  # sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
180  # sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
181  #
182  # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
183  # So force it.
184  
185  
186  
187  # --no-parallel is added because chroot does not mount a /dev/shm, this will
188  # cause python multiprocessing.SemLock error.
189  export GYP_GENERATORS='ninja'
190  ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
191  --no-parallel \
192  ${GYP_EXTRA_FLAGS} \
193  -Dchromeos=0 \
194  -Dclang=0 \
195  -Dlinux_use_bundled_binutils=0 \
196  -Dlinux_use_bundled_gold=0 \
197  -Dlinux_use_gold_flags=1 \
198  -Dtizen=1 \
199  -Dpython_ver=2.7 \
200  -Duse_aura=1 \
201  -Duse_cups=0 \
202  -Duse_gconf=0 \
203  -Duse_gnome_keyring=0 \
204  -Duse_kerberos=0 \
205  -Duse_system_bzip2=1 \
206  -Duse_system_libexif=1 \
207  -Duse_system_libxml=1 \
208  -Duse_system_nspr=1 \
209  -Duse_system_yasm=1 \
210  -Dshared_process_mode=1 \
211  -Denable_hidpi=1 \
212  -Dwerror= \
213  -Dskia_warnings_as_errors=0
214  
215  ninja ${PARALLEL_MAKE} -C src/out/Release xwalk xwalk_launcher xwalk_application_tools widget-manifest-parser
216  
217  
218  
219 }
220
221 do_install() {
222  export RPM_BUILD_ROOT=${D}
223  cd ${S}
224  LANG=C
225  export LANG
226  unset DISPLAY
227  rm -rf ${D}
228  mkdir -p ${D}
229  
230  # Binaries.
231  install -p -D ${S}/packaging/org.crosswalkproject.Runtime1.service ${D}/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service
232  install -p -D xwalk.service ${D}/usr/lib/systemd/user/xwalk.service
233  install -p -D src/out/Release/xwalk ${D}${prefix}/lib/xwalk/xwalk
234  install -p -D src/out/Release/xwalkctl ${D}${prefix}/bin/xwalkctl
235  install -p -D src/out/Release/xwalk-launcher ${D}${prefix}/bin/xwalk-launcher
236  install -p -D src/out/Release/xwalk_backend ${D}${prefix}/lib/xwalk/xwalk_backend
237  install -p -D src/out/Release/lib/libxwalk_backend_lib.so ${D}${prefix}/lib/xwalk/libxwalk_backend_lib.so
238  
239  # Supporting libraries and resources.
240  install -p -D src/out/Release/icudtl.dat ${D}${prefix}/lib/xwalk/icudtl.dat
241  install -p -D src/out/Release/libffmpegsumo.so ${D}${prefix}/lib/xwalk/libffmpegsumo.so
242  install -p -D src/out/Release/xwalk.pak ${D}${prefix}/lib/xwalk/xwalk.pak
243  mkdir -p ${D}${prefix}/share/xwalk
244  install -p -D src/xwalk/application/common/tizen/configuration/*.xsd ${D}${prefix}/share/xwalk/
245  
246  # PNaCl
247  
248  # Register xwalk to the package manager.
249  install -m 0644 -p -D crosswalk.xml ${D}${prefix}/share/packages/crosswalk.xml
250  install -m 0644 -p -D crosswalk.png ${D}${prefix}/share/icons/default/small/crosswalk.png
251  
252  # Widget manifest parser devel
253  install -m 0664 -p -D src/xwalk/tizen/widget-manifest-parser/widget-manifest-parser.h ${D}${prefix}/include/widget-manifest-parser/widget-manifest-parser.h
254  install -m 0664 -p -D widget-manifest-parser.pc ${D}${prefix}/lib/pkgconfig/widget-manifest-parser.pc
255  
256  # Widget manifest parser
257  install -m 0755 -p -D src/out/Release/lib/libwidget-manifest-parser.so ${D}${prefix}/lib/libwidget-manifest-parser.so
258  
259  
260 }
261
262 pkg_postinst_${PN}() {
263     #!/bin/sh -e
264
265     mkdir -p $D${prefix}/share/icons/default/small
266     mkdir -p $D${prefix}/share/packages
267     ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libxpk.so
268     ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libwgt.so
269     ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/xpk
270     ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/wgt
271
272 }
273
274 pkg_prerm_${PN}() {
275     #!/bin/sh -e
276
277     if [ $1 -eq 0 ] ; then
278      # don't remove if we are upgrade the rpm package
279     [ -L /etc/package-manager/backendlib/libxpk.so ] && rm /etc/package-manager/backendlib/libxpk.so
280     [ -L /etc/package-manager/backendlib/libwgt.so ] && rm /etc/package-manager/backendlib/libwgt.so
281     [ -L /etc/package-manager/backend/xpk ] && rm /etc/package-manager/backend/xpk
282     [ -L /etc/package-manager/backend/wgt ] && rm /etc/package-manager/backend/wgt
283     fi
284
285 }
286
287 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
288 PACKAGES += " crosswalk "
289 PACKAGES += " widget-manifest-parser "
290 PACKAGES += " widget-manifest-parser-dev "
291
292 crosswalk_files = ""
293 crosswalk_files += "${prefix}/bin/xwalkctl"
294 crosswalk_files += "${prefix}/bin/xwalk-launcher"
295 crosswalk_files += "${prefix}/lib/xwalk/icudtl.dat"
296 crosswalk_files += "${prefix}/lib/xwalk/libffmpegsumo.so"
297 crosswalk_files += "${prefix}/lib/xwalk/xwalk"
298 crosswalk_files += "${prefix}/lib/xwalk/xwalk.pak"
299 crosswalk_files += "${prefix}/lib/xwalk/libxwalk_backend_lib.so"
300 crosswalk_files += "${prefix}/lib/xwalk/xwalk_backend"
301 crosswalk_files += "${prefix}/share/packages/crosswalk.xml"
302 crosswalk_files += "${prefix}/share/icons/default/small/crosswalk.png"
303 crosswalk_files += "/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service"
304 crosswalk_files += "/usr/lib/systemd/user/xwalk.service"
305 crosswalk_files += "${prefix}/share/xwalk/*"
306 MANIFESTFILES_${PN} = "crosswalk.manifest"
307
308 widget-manifest-parser_files = ""
309 widget-manifest-parser_files += "${prefix}/lib/libwidget-manifest-parser.so"
310
311 widget-manifest-parser-dev_files = ""
312 widget-manifest-parser-dev_files += "${prefix}/include/widget-manifest-parser/widget-manifest-parser.h"
313 widget-manifest-parser-dev_files += "${prefix}/lib/pkgconfig/widget-manifest-parser.pc"
314
315 FILES_${PN} = "${crosswalk_files}"
316 FILES_widget-manifest-parser = "${widget-manifest-parser_files}"
317 FILES_widget-manifest-parser-dev = "${widget-manifest-parser-dev_files}"
318
319 PKG_crosswalk= "crosswalk"
320 PKG_widget-manifest-parser= "widget-manifest-parser"
321 PKG_widget-manifest-parser-dev= "widget-manifest-parser-dev"
322
323 require crosswalk-extraconf.inc
324