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+)"
11 inherit manifest autotools-brokensep
16 #PROVIDES by crosswalk
19 #PROVIDES by widget-manifest-parser
20 PROVIDES += "widget-manifest-parser"
23 #PROVIDES by widget-manifest-parser-dev
24 PROVIDES += "widget-manifest-parser-dev"
28 #RDEPENDS of crosswalk (${PN})
29 RDEPENDS_${PN} += "ca-certificates-tizen"
30 RDEPENDS_${PN} += "ss-server"
32 #RDEPENDS of widget-manifest-parser (widget-manifest-parser)
33 RDEPENDS_widget-manifest-parser += "crosswalk"
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"
51 DEPENDS += "secure-storage"
58 DEPENDS += "fontconfig"
59 DEPENDS += "system-server"
63 DEPENDS_append_class-native = " bison-native"
64 DEPENDS_append_class-target = " bison-native"
71 DEPENDS += "tizen-platform-config"
72 DEPENDS += "pkgmgr-info"
76 DEPENDS += "python-xml"
77 DEPENDS_append_class-native = " ninja-native"
78 DEPENDS_append_class-target = " ninja-native"
81 DEPENDS += "virtual/egl"
82 DEPENDS += "libxkbcommon"
84 DEPENDS += "pulseaudio"
87 DEPENDS += "capi-location-manager"
93 chmod -Rf a+rX,u+w,g-w,o-w ${S}
94 #setup -q -n crosswalk
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
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
110 cp -a src/AUTHORS AUTHORS.chromium
111 cp -a src/LICENSE LICENSE.chromium
112 cp -a src/xwalk/LICENSE LICENSE.xwalk
114 # The profiles using Wayland (and thus Ozone) do not need this patch.
119 bb.build.exec_func('do_prep', d)
130 LD_AS_NEEDED=1; export LD_AS_NEEDED ;
134 if [ -f ${prefix}/share/crosswalk-thirdparty/out.tgz ]; then
135 tar -zxvf ${prefix}/share/crosswalk-thirdparty/out.tgz
137 python ./changedate.py
139 # Stop unconditionally passing -Wall to the compiler. Chromium has its own
140 # mechanisms for deciding which parts of the code need -Wall and which need it
141 # to be left out (since several pieces are built with -Werror). At least in
142 # M39, this is preventing the "rtc_base" target from being built because it
143 # does not expect -Wall to be passed to the compiler (see webrtc issue 3307).
144 export CXXFLAGS="`echo $CXXFLAGS | sed s,-Wall,,g`"
146 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
147 # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
148 # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
149 export CFLAGS="`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`"
152 # Building the RPM in the GBS chroot fails with errors such as
153 # /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
154 # failed to set dynamic section sizes: Memory exhausted
155 # For now, work around it by passing a GNU ld-specific flag that optimizes the
156 # linker for memory usage.
157 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
159 # Support building in a non-standard directory, possibly outside ${WORKDIR}.
160 # Since the build root is erased every time a new build is performed, one way
161 # to avoid losing the build directory is to specify a location outside the
162 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
163 # (remember all paths are still inside the chroot):
164 # gbs build --define 'BUILDDIR_NAME /some/path'
166 if [ -n "${BUILDDIR_NAME}" ]; then
167 mkdir -p "${BUILDDIR_NAME}"
168 ln -s "${BUILDDIR_NAME}" src/out
171 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
173 # disable nacl if necessary
174 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=1"
176 # Linking fails when fatal ld warnings are enabled. See XWALK-1379.
177 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
179 # For building for arm in OBS, we need :
180 # -> to unset sysroot value.
181 # sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
182 # sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
184 # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
189 # --no-parallel is added because chroot does not mount a /dev/shm, this will
190 # cause python multiprocessing.SemLock error.
191 export GYP_GENERATORS='ninja'
192 ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
197 -Dlinux_use_bundled_binutils=0 \
198 -Dlinux_use_bundled_gold=0 \
204 -Duse_gnome_keyring=0 \
206 -Duse_system_bzip2=1 \
207 -Duse_system_libexif=1 \
208 -Duse_system_libxml=1 \
209 -Duse_system_nspr=1 \
210 -Duse_system_yasm=1 \
211 -Dshared_process_mode=1 \
214 ninja ${PARALLEL_MAKE} -C src/out/Release xwalk xwalk_launcher xwalk_application_tools widget-manifest-parser
221 export RPM_BUILD_ROOT=${D}
230 install -p -D ${S}/packaging/org.crosswalkproject.Runtime1.service ${D}/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service
231 install -p -D xwalk.service ${D}/usr/lib/systemd/user/xwalk.service
232 install -p -D src/out/Release/xwalk ${D}${prefix}/lib/xwalk/xwalk
233 install -p -D src/out/Release/xwalkctl ${D}${prefix}/bin/xwalkctl
234 install -p -D src/out/Release/xwalk-launcher ${D}${prefix}/bin/xwalk-launcher
235 install -p -D src/out/Release/xwalk_backend ${D}${prefix}/lib/xwalk/xwalk_backend
236 install -p -D src/out/Release/lib/libxwalk_backend_lib.so ${D}${prefix}/lib/xwalk/libxwalk_backend_lib.so
238 # Supporting libraries and resources.
239 install -p -D src/out/Release/icudtl.dat ${D}${prefix}/lib/xwalk/icudtl.dat
240 install -p -D src/out/Release/libffmpegsumo.so ${D}${prefix}/lib/xwalk/libffmpegsumo.so
241 install -p -D src/out/Release/xwalk.pak ${D}${prefix}/lib/xwalk/xwalk.pak
242 mkdir -p ${D}${prefix}/share/xwalk
243 install -p -D src/xwalk/application/common/tizen/configuration/*.xsd ${D}${prefix}/share/xwalk/
247 # Register xwalk to the package manager.
248 install -m 0644 -p -D crosswalk.xml ${D}${prefix}/share/packages/crosswalk.xml
249 install -m 0644 -p -D crosswalk.png ${D}${prefix}/share/icons/default/small/crosswalk.png
251 # Widget manifest parser devel
252 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
253 install -m 0664 -p -D widget-manifest-parser.pc ${D}${prefix}/lib/pkgconfig/widget-manifest-parser.pc
255 # Widget manifest parser
256 install -m 0755 -p -D src/out/Release/lib/libwidget-manifest-parser.so ${D}${prefix}/lib/libwidget-manifest-parser.so
261 pkg_postinst_${PN}() {
264 mkdir -p $D${prefix}/share/icons/default/small
265 mkdir -p $D${prefix}/share/packages
266 ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libxpk.so
267 ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libwgt.so
268 ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/xpk
269 ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/wgt
276 if [ $1 -eq 0 ] ; then
277 # don't remove if we are upgrade the rpm package
278 [ -L /etc/package-manager/backendlib/libxpk.so ] && rm /etc/package-manager/backendlib/libxpk.so
279 [ -L /etc/package-manager/backendlib/libwgt.so ] && rm /etc/package-manager/backendlib/libwgt.so
280 [ -L /etc/package-manager/backend/xpk ] && rm /etc/package-manager/backend/xpk
281 [ -L /etc/package-manager/backend/wgt ] && rm /etc/package-manager/backend/wgt
286 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
287 PACKAGES += " crosswalk "
288 PACKAGES += " widget-manifest-parser "
289 PACKAGES += " widget-manifest-parser-dev "
292 crosswalk_files += "${prefix}/bin/xwalkctl"
293 crosswalk_files += "${prefix}/bin/xwalk-launcher"
294 crosswalk_files += "${prefix}/lib/xwalk/icudtl.dat"
295 crosswalk_files += "${prefix}/lib/xwalk/libffmpegsumo.so"
296 crosswalk_files += "${prefix}/lib/xwalk/xwalk"
297 crosswalk_files += "${prefix}/lib/xwalk/xwalk.pak"
298 crosswalk_files += "${prefix}/lib/xwalk/libxwalk_backend_lib.so"
299 crosswalk_files += "${prefix}/lib/xwalk/xwalk_backend"
300 crosswalk_files += "${prefix}/share/packages/crosswalk.xml"
301 crosswalk_files += "${prefix}/share/icons/default/small/crosswalk.png"
302 crosswalk_files += "/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service"
303 crosswalk_files += "/usr/lib/systemd/user/xwalk.service"
304 crosswalk_files += "${prefix}/share/xwalk/*"
305 MANIFESTFILES_${PN} = "crosswalk.manifest"
307 widget-manifest-parser_files = ""
308 widget-manifest-parser_files += "${prefix}/lib/libwidget-manifest-parser.so"
310 widget-manifest-parser-dev_files = ""
311 widget-manifest-parser-dev_files += "${prefix}/include/widget-manifest-parser/widget-manifest-parser.h"
312 widget-manifest-parser-dev_files += "${prefix}/lib/pkgconfig/widget-manifest-parser.pc"
314 FILES_${PN} = "${crosswalk_files}"
315 FILES_widget-manifest-parser = "${widget-manifest-parser_files}"
316 FILES_widget-manifest-parser-dev = "${widget-manifest-parser-dev_files}"
318 PKG_crosswalk= "crosswalk"
319 PKG_widget-manifest-parser= "widget-manifest-parser"
320 PKG_widget-manifest-parser-dev= "widget-manifest-parser-dev"
322 require crosswalk-extraconf.inc