Update LICENSE fields to fix warnings
[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 & 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  # 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 "
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
166  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Dsysroot= "
167
168  # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
169  # So force it.
170  
171  
172  
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 \
178  --no-parallel \
179  ${GYP_EXTRA_FLAGS} \
180  -Dchromeos=0 \
181  -Dclang=0 \
182  -Dlinux_use_bundled_binutils=0 \
183  -Dlinux_use_bundled_gold=0 \
184  -Dlinux_use_gold_flags=1 \
185  -Dtizen=1 \
186  -Dpython_ver=2.7 \
187  -Duse_aura=1 \
188  -Duse_cups=0 \
189  -Duse_gconf=0 \
190  -Duse_gnome_keyring=0 \
191  -Duse_kerberos=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 \
198  -Denable_hidpi=1 \
199  -Dwerror= \
200  -Dskia_warnings_as_errors=0
201  
202  ninja ${PARALLEL_MAKE} -C src/out/Release xwalk xwalk_launcher xwalk_application_tools widget-manifest-parser
203  
204  
205  
206 }
207
208 do_install() {
209  export RPM_BUILD_ROOT=${D}
210  cd ${S}
211  LANG=C
212  export LANG
213  unset DISPLAY
214  rm -rf ${D}
215  mkdir -p ${D}
216  
217  # Binaries.
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
225  
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/
232  
233  # PNaCl
234  
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
238  
239  
240  
241 }
242
243 pkg_postinst_${PN}() {
244     #!/bin/sh -e
245
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
252
253 }
254
255 pkg_prerm_${PN}() {
256     #!/bin/sh -e
257
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
264     fi
265
266 }
267
268 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
269 PACKAGES += " crosswalk "
270
271 crosswalk_files = ""
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"
286
287 FILES_${PN} = "${crosswalk_files}"
288
289 PKG_crosswalk= "crosswalk"
290
291 require crosswalk-extraconf.inc
292