4dd0a53c205090f0e4276a7daa0cd736dd11e9e3
[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.39.256.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 += "cairo"
28 DEPENDS += "pkgmgr"
29 DEPENDS += "expat"
30 DEPENDS += "udev"
31 DEPENDS += "app-core"
32 DEPENDS += "xmlsec1"
33 DEPENDS += "libxslt"
34 inherit perlnative
35 DEPENDS += "secure-storage"
36 DEPENDS += "bzip2"
37 DEPENDS += "nss"
38 DEPENDS += "alsa-lib"
39 DEPENDS += "elfutils"
40 inherit pkgconfig
41 DEPENDS += "yasm"
42 DEPENDS += "fontconfig"
43 DEPENDS += "system-server"
44 DEPENDS += "wayland"
45 DEPENDS += "tizen-platform-wrapper"
46 DEPENDS += "which"
47 DEPENDS += "libxml2"
48 DEPENDS_append_class-native = " bison-native"
49 DEPENDS_append_class-target = " bison-native"
50 DEPENDS += "sensor"
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 += "nspr"
68 DEPENDS += "dbus"
69 DEPENDS += "libxkbcommon"
70 DEPENDS += "pulseaudio"
71 DEPENDS += "libexif"
72 DEPENDS += "ail"
73 DEPENDS += "capi-location-manager"
74 DEPENDS += "pciutils"
75 DEPENDS += "binutils"
76
77 do_prep() {
78  cd ${S}
79  chmod -Rf a+rX,u+w,g-w,o-w ${S}
80  #setup -q -n crosswalk
81  
82  cp ${S}/packaging/xwalk.in .
83  cp ${S}/packaging/xwalk.service.in .
84  cp ${S}/packaging/crosswalk.manifest .
85  cp ${S}/packaging/crosswalk.xml.in .
86  cp ${S}/packaging/crosswalk.png .
87  cp ${S}/packaging/changedate.py .
88  sed "s/@VERSION@/11.39.256.0/g" crosswalk.xml.in > crosswalk.xml
89  sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.in > xwalk
90  sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.service.in > xwalk.service
91  
92  cp -a src/AUTHORS AUTHORS.chromium
93  cp -a src/LICENSE LICENSE.chromium
94  cp -a src/xwalk/LICENSE LICENSE.xwalk
95  
96  
97  # The profiles using Wayland (and thus Ozone) do not need this patch.
98  
99  
100 }
101 do_patch_append() {
102     bb.build.exec_func('do_prep', d)
103 }
104
105 do_configure() {
106 }
107
108 do_compile() {
109  cd ${S}
110  LANG=C
111  export LANG
112  unset DISPLAY
113  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
114  
115  
116  mkdir -p src/out
117  if [ -f ${prefix}/share/crosswalk-thirdparty/out.tgz ]; then
118  tar -zxvf ${prefix}/share/crosswalk-thirdparty/out.tgz
119  fi
120  python ./changedate.py
121  
122  # Stop unconditionally passing -Wall to the compiler. Chromium has its own
123  # mechanisms for deciding which parts of the code need -Wall and which need it
124  # to be left out (since several pieces are built with -Werror). At least in
125  # M39, this is preventing the "rtc_base" target from being built because it
126  # does not expect -Wall to be passed to the compiler (see webrtc issue 3307).
127  export CXXFLAGS=`echo $CXXFLAGS | sed s,-Wall,,g`
128  
129  # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
130  # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
131  # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
132  export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
133  
134  
135  # Building the RPM in the GBS chroot fails with errors such as
136  #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
137  #       failed to set dynamic section sizes: Memory exhausted
138  # For now, work around it by passing a GNU ld-specific flag that optimizes the
139  # linker for memory usage.
140  export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
141  
142  # Support building in a non-standard directory, possibly outside ${WORKDIR}.
143  # Since the build root is erased every time a new build is performed, one way
144  # to avoid losing the build directory is to specify a location outside the
145  # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
146  # (remember all paths are still inside the chroot):
147  #    gbs build --define 'BUILDDIR_NAME /some/path'
148  BUILDDIR_NAME=""
149  if [ -n "${BUILDDIR_NAME}" ]; then
150     mkdir -p "${BUILDDIR_NAME}"
151     ln -s "${BUILDDIR_NAME}" src/out
152  fi
153  
154  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
155  
156  # disable nacl if necessary
157  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=1"
158  
159  # Linking fails when fatal ld warnings are enabled. See XWALK-1379.
160  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
161  
162  # For building for arm in OBS, we need :
163  # -> to unset sysroot value.
164  # sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
165  # sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
166  #
167  # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
168  # So force it.
169  
170  
171  
172  # --no-parallel is added because chroot does not mount a /dev/shm, this will
173  # cause python multiprocessing.SemLock error.
174  export GYP_GENERATORS='ninja'
175  ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
176  --no-parallel \
177  ${GYP_EXTRA_FLAGS} \
178  -Dchromeos=0 \
179  -Dclang=0 \
180  -Dlinux_use_bundled_binutils=0 \
181  -Dlinux_use_bundled_gold=0 \
182  -Dtizen=1 \
183  -Dpython_ver=2.7 \
184  -Duse_aura=1 \
185  -Duse_cups=0 \
186  -Duse_gconf=0 \
187  -Duse_gnome_keyring=0 \
188  -Duse_kerberos=0 \
189  -Duse_system_bzip2=1 \
190  -Duse_system_libexif=1 \
191  -Duse_system_libxml=1 \
192  -Duse_system_nspr=1 \
193  -Duse_system_yasm=1 \
194  -Dshared_process_mode=1 \
195  -Denable_hidpi=1
196  
197  ninja ${PARALLEL_MAKE} -C src/out/Release xwalk xwalk_launcher xwalk_application_tools
198  
199  
200  
201 }
202
203 do_install() {
204  export RPM_BUILD_ROOT=${D}
205  cd ${S}
206  LANG=C
207  export LANG
208  unset DISPLAY
209  rm -rf ${D}
210  mkdir -p ${D}
211  
212  # Binaries.
213  install -p -D ${S}/packaging/org.crosswalkproject.Runtime1.service ${D}/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service
214  install -p -D xwalk.service ${D}/usr/lib/systemd/user/xwalk.service
215  install -p -D src/out/Release/xwalk ${D}${prefix}/lib/xwalk/xwalk
216  install -p -D src/out/Release/xwalkctl ${D}${prefix}/bin/xwalkctl
217  install -p -D src/out/Release/xwalk-launcher ${D}${prefix}/bin/xwalk-launcher
218  install -p -D src/out/Release/xwalk_backend ${D}${prefix}/lib/xwalk/xwalk_backend
219  install -p -D src/out/Release/lib/libxwalk_backend_lib.so ${D}${prefix}/lib/xwalk/libxwalk_backend_lib.so
220  
221  # Supporting libraries and resources.
222  install -p -D src/out/Release/icudtl.dat ${D}${prefix}/lib/xwalk/icudtl.dat
223  install -p -D src/out/Release/libffmpegsumo.so ${D}${prefix}/lib/xwalk/libffmpegsumo.so
224  install -p -D src/out/Release/xwalk.pak ${D}${prefix}/lib/xwalk/xwalk.pak
225  mkdir -p ${D}${prefix}/share/xwalk
226  install -p -D src/xwalk/application/common/tizen/configuration/*.xsd ${D}${prefix}/share/xwalk/
227  
228  # PNaCl
229  
230  # Register xwalk to the package manager.
231  install -p -D crosswalk.xml ${D}${prefix}/share/packages/crosswalk.xml
232  install -p -D crosswalk.png ${D}${prefix}/share/icons/default/small/crosswalk.png
233  
234  
235 }
236
237 pkg_postinst_${PN}() {
238     #!/bin/sh -e
239
240     mkdir -p $D${prefix}/share/icons/default/small
241     mkdir -p $D${prefix}/share/packages
242     ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libxpk.so
243     ln -sf $D${prefix}/lib/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libwgt.so
244     ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/xpk
245     ln -sf $D${prefix}/lib/xwalk/xwalk_backend /etc/package-manager/backend/wgt
246
247 }
248
249 pkg_prerm_${PN}() {
250     #!/bin/sh -e
251
252     if [ $1 -eq 0 ] ; then
253      # don't remove if we are upgrade the rpm package
254     [ -L /etc/package-manager/backendlib/libxpk.so ] && rm /etc/package-manager/backendlib/libxpk.so
255     [ -L /etc/package-manager/backendlib/libwgt.so ] && rm /etc/package-manager/backendlib/libwgt.so
256     [ -L /etc/package-manager/backend/xpk ] && rm /etc/package-manager/backend/xpk
257     [ -L /etc/package-manager/backend/wgt ] && rm /etc/package-manager/backend/wgt
258     fi
259
260 }
261
262 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
263 PACKAGES += " crosswalk "
264
265 crosswalk_files = ""
266 crosswalk_files += "${prefix}/bin/xwalkctl"
267 crosswalk_files += "${prefix}/bin/xwalk-launcher"
268 crosswalk_files += "${prefix}/lib/xwalk/icudtl.dat"
269 crosswalk_files += "${prefix}/lib/xwalk/libffmpegsumo.so"
270 crosswalk_files += "${prefix}/lib/xwalk/xwalk"
271 crosswalk_files += "${prefix}/lib/xwalk/xwalk.pak"
272 crosswalk_files += "${prefix}/lib/xwalk/libxwalk_backend_lib.so"
273 crosswalk_files += "${prefix}/lib/xwalk/xwalk_backend"
274 crosswalk_files += "${prefix}/share/packages/crosswalk.xml"
275 crosswalk_files += "${prefix}/share/icons/default/small/crosswalk.png"
276 crosswalk_files += "/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service"
277 crosswalk_files += "/usr/lib/systemd/user/xwalk.service"
278 crosswalk_files += "${prefix}/share/xwalk/*"
279 MANIFESTFILES_${PN} = "crosswalk.manifest"
280
281 FILES_${PN} = "${crosswalk_files}"
282
283 PKG_crosswalk= "crosswalk"
284
285 require crosswalk-extraconf.inc
286