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 & LGPL-2.1+"
11 inherit manifest autotools-brokensep
16 #PROVIDES by crosswalk
20 #RDEPENDS of crosswalk (${PN})
21 RDEPENDS_${PN} += "ca-certificates-tizen"
22 RDEPENDS_${PN} += "ss-server"
36 DEPENDS += "secure-storage"
43 DEPENDS += "fontconfig"
48 DEPENDS_append_class-native = " bison-native"
49 DEPENDS_append_class-target = " bison-native"
56 DEPENDS += "tizen-platform-config"
57 DEPENDS += "pkgmgr-info"
61 DEPENDS += "python-xml"
62 DEPENDS_append_class-native = " ninja-native"
63 DEPENDS_append_class-target = " ninja-native"
66 DEPENDS += "virtual/egl"
67 DEPENDS += "libxkbcommon"
69 DEPENDS += "pulseaudio"
72 DEPENDS += "capi-location-manager"
78 chmod -Rf a+rX,u+w,g-w,o-w ${S}
79 #setup -q -n crosswalk
81 cp ${S}/packaging/xwalk.in .
82 cp ${S}/packaging/xwalk.service.in .
83 cp ${S}/packaging/crosswalk.manifest .
84 cp ${S}/packaging/crosswalk.xml.in .
85 cp ${S}/packaging/crosswalk.png .
86 cp ${S}/packaging/changedate.py .
87 sed "s/@VERSION@/11.40.277.0/g" crosswalk.xml.in > crosswalk.xml
88 sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.in > xwalk
89 sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.service.in > xwalk.service
91 cp -a src/AUTHORS AUTHORS.chromium
92 cp -a src/LICENSE LICENSE.chromium
93 cp -a src/xwalk/LICENSE LICENSE.xwalk
95 # The profiles using Wayland (and thus Ozone) do not need this patch.
100 bb.build.exec_func('do_prep', d)
111 LD_AS_NEEDED=1; export LD_AS_NEEDED ;
115 if [ -f ${prefix}/share/crosswalk-thirdparty/out.tgz ]; then
116 tar -zxvf ${prefix}/share/crosswalk-thirdparty/out.tgz
118 python ./changedate.py
120 # Stop unconditionally passing -Wall to the compiler. Chromium has its own
121 # mechanisms for deciding which parts of the code need -Wall and which need it
122 # to be left out (since several pieces are built with -Werror). At least in
123 # M39, this is preventing the "rtc_base" target from being built because it
124 # does not expect -Wall to be passed to the compiler (see webrtc issue 3307).
125 export CXXFLAGS="`echo $CXXFLAGS | sed s,-Wall,,g`"
127 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
128 # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
129 # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
130 export CFLAGS="`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`"
133 # Building the RPM in the GBS chroot fails with errors such as
134 # /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
135 # failed to set dynamic section sizes: Memory exhausted
136 # For now, work around it by passing a GNU ld-specific flag that optimizes the
137 # linker for memory usage.
138 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
140 # Support building in a non-standard directory, possibly outside ${WORKDIR}.
141 # Since the build root is erased every time a new build is performed, one way
142 # to avoid losing the build directory is to specify a location outside the
143 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
144 # (remember all paths are still inside the chroot):
145 # gbs build --define 'BUILDDIR_NAME /some/path'
147 if [ -n "${BUILDDIR_NAME}" ]; then
148 mkdir -p "${BUILDDIR_NAME}"
149 ln -s "${BUILDDIR_NAME}" src/out
152 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
154 # Force gold binary from chroot ld.gold provided by binutils-gold
155 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=1 -Dlinux_use_bundled_binutils=0 -Dlinux_use_bundled_gold=0 "
157 # Linking fails when fatal ld warnings are enabled. See XWALK-1379.
158 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
160 # For building for arm in OBS, we need :
161 # -> to unset sysroot value.
162 # sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
163 # sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
166 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Dsysroot= "
168 # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
173 # --no-parallel is added because chroot does not mount a /dev/shm, this will
174 # cause python multiprocessing.SemLock error.
175 export GYP_GENERATORS='ninja'
176 export GYP_DEFINES="$GYP_DEFINES arm_float_abi=hard"
177 ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
182 -Dlinux_use_bundled_binutils=0 \
183 -Dlinux_use_bundled_gold=0 \
184 -Dlinux_use_gold_flags=1 \
190 -Duse_gnome_keyring=0 \
192 -Duse_system_bzip2=1 \
193 -Duse_system_libexif=1 \
194 -Duse_system_libxml=1 \
195 -Duse_system_nspr=1 \
196 -Duse_system_yasm=1 \
197 -Dshared_process_mode=1 \
200 -Dskia_warnings_as_errors=0
202 ninja ${PARALLEL_MAKE} -C src/out/Release xwalk xwalk_launcher xwalk_application_tools widget-manifest-parser
209 export RPM_BUILD_ROOT=${D}
218 install -p -D ${S}/packaging/org.crosswalkproject.Runtime1.service ${D}/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service
219 install -p -D xwalk.service ${D}/usr/lib/systemd/user/xwalk.service
220 install -p -D src/out/Release/xwalk ${D}${prefix}/lib/xwalk/xwalk
221 install -p -D src/out/Release/xwalkctl ${D}${prefix}/bin/xwalkctl
222 install -p -D src/out/Release/xwalk-launcher ${D}${prefix}/bin/xwalk-launcher
223 install -p -D src/out/Release/xwalk_backend ${D}${prefix}/lib/xwalk/xwalk_backend
224 install -p -D src/out/Release/lib/libxwalk_backend_lib.so ${D}${prefix}/lib/xwalk/libxwalk_backend_lib.so
226 # Supporting libraries and resources.
227 install -p -D src/out/Release/icudtl.dat ${D}${prefix}/lib/xwalk/icudtl.dat
228 install -p -D src/out/Release/libffmpegsumo.so ${D}${prefix}/lib/xwalk/libffmpegsumo.so
229 install -p -D src/out/Release/xwalk.pak ${D}${prefix}/lib/xwalk/xwalk.pak
230 mkdir -p ${D}${prefix}/share/xwalk
231 install -p -D src/xwalk/application/common/tizen/configuration/*.xsd ${D}${prefix}/share/xwalk/
235 # Register xwalk to the package manager.
236 install -m 0644 -p -D crosswalk.xml ${D}${prefix}/share/packages/crosswalk.xml
237 install -m 0644 -p -D crosswalk.png ${D}${prefix}/share/icons/default/small/crosswalk.png
243 pkg_postinst_${PN}() {
246 mkdir -p $D${prefix}/share/icons/default/small
247 mkdir -p $D${prefix}/share/packages
248 ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libxpk.so
249 ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libwgt.so
250 ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/xpk
251 ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/wgt
258 if [ $1 -eq 0 ] ; then
259 # don't remove if we are upgrade the rpm package
260 [ -L /etc/package-manager/backendlib/libxpk.so ] && rm /etc/package-manager/backendlib/libxpk.so
261 [ -L /etc/package-manager/backendlib/libwgt.so ] && rm /etc/package-manager/backendlib/libwgt.so
262 [ -L /etc/package-manager/backend/xpk ] && rm /etc/package-manager/backend/xpk
263 [ -L /etc/package-manager/backend/wgt ] && rm /etc/package-manager/backend/wgt
268 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
269 PACKAGES += " crosswalk "
272 crosswalk_files += "${prefix}/bin/xwalkctl"
273 crosswalk_files += "${prefix}/bin/xwalk-launcher"
274 crosswalk_files += "${prefix}/lib/xwalk/icudtl.dat"
275 crosswalk_files += "${prefix}/lib/xwalk/libffmpegsumo.so"
276 crosswalk_files += "${prefix}/lib/xwalk/xwalk"
277 crosswalk_files += "${prefix}/lib/xwalk/xwalk.pak"
278 crosswalk_files += "${prefix}/lib/xwalk/libxwalk_backend_lib.so"
279 crosswalk_files += "${prefix}/lib/xwalk/xwalk_backend"
280 crosswalk_files += "${prefix}/share/packages/crosswalk.xml"
281 crosswalk_files += "${prefix}/share/icons/default/small/crosswalk.png"
282 crosswalk_files += "/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service"
283 crosswalk_files += "/usr/lib/systemd/user/xwalk.service"
284 crosswalk_files += "${prefix}/share/xwalk/*"
285 MANIFESTFILES_${PN} = "crosswalk.manifest"
287 FILES_${PN} = "${crosswalk_files}"
289 PKG_crosswalk= "crosswalk"
291 require crosswalk-extraconf.inc