1a2e832c408a83e114eda4c2ae54a6b5fdf92343
[scm/bb/meta-tizen.git] / 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 RDEPENDS = ""
20 #RDEPENDS of crosswalk (${PN})
21 RDEPENDS_${PN} += "ca-certificates-tizen"
22 RDEPENDS_${PN} += "ss-server"
23
24
25 DEPENDS = ""
26 #DEPENDS of crosswalk
27 DEPENDS += "protobuf"
28 DEPENDS += "cairo"
29 DEPENDS += "pkgmgr"
30 DEPENDS += "expat"
31 DEPENDS += "udev"
32 DEPENDS += "app-core"
33 DEPENDS += "xmlsec1"
34 DEPENDS += "libxslt"
35 inherit perlnative
36 DEPENDS += "secure-storage"
37 DEPENDS += "bzip2"
38 DEPENDS += "nss"
39 DEPENDS += "alsa-lib"
40 DEPENDS += "elfutils"
41 inherit pkgconfig
42 DEPENDS += "yasm"
43 DEPENDS += "fontconfig"
44 DEPENDS += "deviced"
45 DEPENDS += "wayland"
46 DEPENDS += "which"
47 DEPENDS += "libxml2"
48 DEPENDS_append_class-native = " bison-native"
49 DEPENDS_append_class-target = " bison-native"
50 DEPENDS += "sensord"
51 DEPENDS += "icu"
52 DEPENDS += "flex"
53 DEPENDS += "freetype"
54 DEPENDS += "gperf"
55 inherit pythonnative
56 DEPENDS += "tizen-platform-config"
57 DEPENDS += "pkgmgr-info"
58 DEPENDS += "glib-2.0"
59 DEPENDS += "libdrm"
60 DEPENDS += "libcap"
61 DEPENDS += "python-xml"
62 DEPENDS_append_class-native = " ninja-native"
63 DEPENDS_append_class-target = " ninja-native"
64 DEPENDS += "pango"
65 DEPENDS += "vconf"
66 DEPENDS += "virtual/egl"
67 DEPENDS += "libxkbcommon"
68 DEPENDS += "dbus"
69 DEPENDS += "pulseaudio"
70 DEPENDS += "libexif"
71 DEPENDS += "ail"
72 DEPENDS += "capi-location-manager"
73 DEPENDS += "pciutils"
74 DEPENDS += "binutils"
75
76 do_prep() {
77  cd ${S}
78  chmod -Rf a+rX,u+w,g-w,o-w ${S}
79  #setup -q -n crosswalk
80  
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
90  
91  cp -a src/AUTHORS AUTHORS.chromium
92  cp -a src/LICENSE LICENSE.chromium
93  cp -a src/xwalk/LICENSE LICENSE.xwalk
94  
95  # The profiles using Wayland (and thus Ozone) do not need this patch.
96  
97  
98 }
99 do_patch_append() {
100     bb.build.exec_func('do_prep', d)
101 }
102
103 do_configure() {
104 }
105
106 do_compile() {
107  cd ${S}
108  LANG=C
109  export LANG
110  unset DISPLAY
111  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
112  
113  
114  mkdir -p src/out
115  if [ -f ${prefix}/share/crosswalk-thirdparty/out.tgz ]; then
116  tar -zxvf ${prefix}/share/crosswalk-thirdparty/out.tgz
117  fi
118  python ./changedate.py
119  
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`"
126  
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`"
131  
132  
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"
139  
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'
146  BUILDDIR_NAME=""
147  if [ -n "${BUILDDIR_NAME}" ]; then
148     mkdir -p "${BUILDDIR_NAME}"
149     ln -s "${BUILDDIR_NAME}" src/out
150  fi
151  
152  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
153  
154  # disable nacl if necessary
155  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=1"
156  
157  # Linking fails when fatal ld warnings are enabled. See XWALK-1379.
158  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
159  
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.
164  #
165  # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
166  # So force it.
167  
168  
169  
170  # --no-parallel is added because chroot does not mount a /dev/shm, this will
171  # cause python multiprocessing.SemLock error.
172  export GYP_GENERATORS='ninja'
173  ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
174  --no-parallel \
175  ${GYP_EXTRA_FLAGS} \
176  -Dchromeos=0 \
177  -Dclang=0 \
178  -Dlinux_use_bundled_binutils=0 \
179  -Dlinux_use_bundled_gold=0 \
180  -Dtizen=1 \
181  -Dpython_ver=2.7 \
182  -Duse_aura=1 \
183  -Duse_cups=0 \
184  -Duse_gconf=0 \
185  -Duse_gnome_keyring=0 \
186  -Duse_kerberos=0 \
187  -Duse_system_bzip2=1 \
188  -Duse_system_libexif=1 \
189  -Duse_system_libxml=1 \
190  -Duse_system_nspr=1 \
191  -Duse_system_yasm=1 \
192  -Dshared_process_mode=1 \
193  -Denable_hidpi=1
194  
195  ninja ${PARALLEL_MAKE} -C src/out/Release xwalk xwalk_launcher xwalk_application_tools widget-manifest-parser
196  
197  
198  
199 }
200
201 do_install() {
202  export RPM_BUILD_ROOT=${D}
203  cd ${S}
204  LANG=C
205  export LANG
206  unset DISPLAY
207  rm -rf ${D}
208  mkdir -p ${D}
209  
210  # Binaries.
211  install -p -D ${S}/packaging/org.crosswalkproject.Runtime1.service ${D}/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service
212  install -p -D xwalk.service ${D}/usr/lib/systemd/user/xwalk.service
213  install -p -D src/out/Release/xwalk ${D}${prefix}/lib/xwalk/xwalk
214  install -p -D src/out/Release/xwalkctl ${D}${prefix}/bin/xwalkctl
215  install -p -D src/out/Release/xwalk-launcher ${D}${prefix}/bin/xwalk-launcher
216  install -p -D src/out/Release/xwalk_backend ${D}${prefix}/lib/xwalk/xwalk_backend
217  install -p -D src/out/Release/lib/libxwalk_backend_lib.so ${D}${prefix}/lib/xwalk/libxwalk_backend_lib.so
218  
219  # Supporting libraries and resources.
220  install -p -D src/out/Release/icudtl.dat ${D}${prefix}/lib/xwalk/icudtl.dat
221  install -p -D src/out/Release/libffmpegsumo.so ${D}${prefix}/lib/xwalk/libffmpegsumo.so
222  install -p -D src/out/Release/xwalk.pak ${D}${prefix}/lib/xwalk/xwalk.pak
223  mkdir -p ${D}${prefix}/share/xwalk
224  install -p -D src/xwalk/application/common/tizen/configuration/*.xsd ${D}${prefix}/share/xwalk/
225  
226  # PNaCl
227  
228  # Register xwalk to the package manager.
229  install -m 0644 -p -D crosswalk.xml ${D}${prefix}/share/packages/crosswalk.xml
230  install -m 0644 -p -D crosswalk.png ${D}${prefix}/share/icons/default/small/crosswalk.png
231  
232  
233  
234 }
235
236 pkg_postinst_${PN}() {
237     #!/bin/sh -e
238
239     mkdir -p $D${prefix}/share/icons/default/small
240     mkdir -p $D${prefix}/share/packages
241     ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libxpk.so
242     ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libwgt.so
243     ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/xpk
244     ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/wgt
245
246 }
247
248 pkg_prerm_${PN}() {
249     #!/bin/sh -e
250
251     if [ $1 -eq 0 ] ; then
252      # don't remove if we are upgrade the rpm package
253     [ -L /etc/package-manager/backendlib/libxpk.so ] && rm /etc/package-manager/backendlib/libxpk.so
254     [ -L /etc/package-manager/backendlib/libwgt.so ] && rm /etc/package-manager/backendlib/libwgt.so
255     [ -L /etc/package-manager/backend/xpk ] && rm /etc/package-manager/backend/xpk
256     [ -L /etc/package-manager/backend/wgt ] && rm /etc/package-manager/backend/wgt
257     fi
258
259 }
260
261 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
262 PACKAGES += " crosswalk "
263
264 crosswalk_files = ""
265 crosswalk_files += "${prefix}/bin/xwalkctl"
266 crosswalk_files += "${prefix}/bin/xwalk-launcher"
267 crosswalk_files += "${prefix}/lib/xwalk/icudtl.dat"
268 crosswalk_files += "${prefix}/lib/xwalk/libffmpegsumo.so"
269 crosswalk_files += "${prefix}/lib/xwalk/xwalk"
270 crosswalk_files += "${prefix}/lib/xwalk/xwalk.pak"
271 crosswalk_files += "${prefix}/lib/xwalk/libxwalk_backend_lib.so"
272 crosswalk_files += "${prefix}/lib/xwalk/xwalk_backend"
273 crosswalk_files += "${prefix}/share/packages/crosswalk.xml"
274 crosswalk_files += "${prefix}/share/icons/default/small/crosswalk.png"
275 crosswalk_files += "/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service"
276 crosswalk_files += "/usr/lib/systemd/user/xwalk.service"
277 crosswalk_files += "${prefix}/share/xwalk/*"
278 MANIFESTFILES_${PN} = "crosswalk.manifest"
279
280 FILES_${PN} = "${crosswalk_files}"
281
282 PKG_crosswalk= "crosswalk"
283
284 require crosswalk-extraconf.inc
285