4c2fd179926bb5e0cbd18001e16fd6f972af17ef
[scm/bb/meta-tizen.git] / meta-tizen-common-share / recipes-crosswalk / crosswalk / crosswalk-thirdparty.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-thirdparty
17 # the PROVIDES rules is ignore "crosswalk-thirdparty  "
18
19
20 RDEPENDS = ""
21 #RDEPENDS of crosswalk-thirdparty (${PN})
22 RDEPENDS_${PN} += "ca-certificates-tizen"
23 RDEPENDS_${PN} += "ss-server"
24
25
26 DEPENDS = ""
27 #DEPENDS of crosswalk-thirdparty
28 DEPENDS += "pkgconfig(protobuf)"
29 DEPENDS += "cairo"
30 DEPENDS += "expat"
31 DEPENDS += "udev"
32 DEPENDS += "libxslt"
33 DEPENDS += "glib-2.0"
34 DEPENDS += "bzip2"
35 DEPENDS += "nss"
36 DEPENDS += "alsa-lib"
37 DEPENDS += "elfutils"
38 inherit pkgconfig
39 DEPENDS += "yasm"
40 inherit perlnative
41 DEPENDS += "wayland"
42 DEPENDS += "which"
43 DEPENDS += "libxml2"
44 DEPENDS += "libcap"
45 DEPENDS += "flex"
46 DEPENDS += "gperf"
47 inherit pythonnative
48 DEPENDS += "python-xml"
49 DEPENDS_append_class-native = " ninja-native"
50 DEPENDS_append_class-target = " ninja-native"
51 DEPENDS += "pango"
52 DEPENDS += "vconf"
53 DEPENDS += "fontconfig"
54 DEPENDS += "libxkbcommon"
55 DEPENDS += "dbus"
56 DEPENDS += "pulseaudio"
57 DEPENDS_append_class-native = " bison-native"
58 DEPENDS_append_class-target = " bison-native"
59 DEPENDS += "pciutils"
60 DEPENDS += "binutils"
61
62 do_prep() {
63  cd ${S}
64  chmod -Rf a+rX,u+w,g-w,o-w ${S}
65  #setup -q -n crosswalk
66  
67  cp ${S}/packaging/crosswalk-thirdparty.manifest .
68  cp ${S}/packaging/xwalk-thirdparty.gyp src/xwalk/
69  
70  
71  # The profiles using Wayland (and thus Ozone) do not need this patch.
72  
73  
74 }
75 do_patch_append() {
76     bb.build.exec_func('do_prep', d)
77 }
78
79 do_configure() {
80 }
81
82 do_compile() {
83  cd ${S}
84  LANG=C
85  export LANG
86  unset DISPLAY
87  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
88  
89  
90  # Stop unconditionally passing -Wall to the compiler. Chromium has its own
91  # mechanisms for deciding which parts of the code need -Wall and which need it
92  # to be left out (since several pieces are built with -Werror). At least in
93  # M39, this is preventing the "rtc_base" target from being built because it
94  # does not expect -Wall to be passed to the compiler (see webrtc issue 3307).
95  export CXXFLAGS=`echo $CXXFLAGS | sed s,-Wall,,g`
96  
97  # Do not use -finline-functions: it breaks the build because it causes -Wall to
98  # warn about some conditions that cannot really be reached (ie. variables that
99  # may be used uninitialized while in fact thay cannot be uninitialized). See
100  # TC-2299.
101  export CXXFLAGS=`echo $CXXFLAGS | sed s,-finline-functions,,g`
102  
103  # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
104  # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
105  # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
106  export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
107  
108  
109  # Building the RPM in the GBS chroot fails with errors such as
110  #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
111  #       failed to set dynamic section sizes: Memory exhausted
112  # For now, work around it by passing a GNU ld-specific flag that optimizes the
113  # linker for memory usage.
114  export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
115  
116  # Support building in a non-standard directory, possibly outside ${WORKDIR}.
117  # Since the build root is erased every time a new build is performed, one way
118  # to avoid losing the build directory is to specify a location outside the
119  # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
120  # (remember all paths are still inside the chroot):
121  #    gbs build --define 'BUILDDIR_NAME /some/path'
122  BUILDDIR_NAME=""
123  if [ -n "${BUILDDIR_NAME}" ]; then
124     mkdir -p "${BUILDDIR_NAME}"
125     ln -s "${BUILDDIR_NAME}" src/out
126  fi
127  
128  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
129  
130  # Force gold binary from chroot ld.gold provided by binutils-gold
131  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=1 -Dlinux_use_bundled_binutils=0 -Dlinux_use_bundled_gold=0 "
132  
133  # Linking fails when fatal ld warnings are enabled. See XWALK-1379.
134  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
135  
136  # For building for arm in OBS, we need :
137  # -> to unset sysroot value.
138  # sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
139  # sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
140  #
141  # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
142  # So force it.
143  
144  
145  
146  # --no-parallel is added because chroot does not mount a /dev/shm, this will
147  # cause python multiprocessing.SemLock error.
148  export GYP_GENERATORS='ninja'
149  ./src/xwalk/gyp_xwalk src/xwalk/xwalk-thirdparty.gyp \
150  --no-parallel \
151  ${GYP_EXTRA_FLAGS} \
152  -Dchromeos=0 \
153  -Dclang=0 \
154  -Dlinux_use_bundled_binutils=0 \
155  -Dlinux_use_bundled_gold=0 \
156  -Dlinux_use_gold_flags=1 \
157  -Dtizen=1 \
158  -Dpython_ver=2.7 \
159  -Duse_aura=1 \
160  -Duse_cups=0 \
161  -Duse_gconf=0 \
162  -Duse_gnome_keyring=0 \
163  -Duse_kerberos=0 \
164  -Duse_system_bzip2=1 \
165  -Duse_system_libexif=1 \
166  -Duse_system_libxml=1 \
167  -Duse_system_protobuf=1 \
168  -Duse_system_yasm=1 \
169  -Denable_hidpi=1 \
170  -Dwerror= \
171  -Dskia_warnings_as_errors=0
172  
173  ninja ${PARALLEL_MAKE} -C src/out/Release xwalk-thirdparty
174  
175  
176  
177 }
178
179 do_install() {
180  export RPM_BUILD_ROOT=${D}
181  cd ${S}
182  LANG=C
183  export LANG
184  unset DISPLAY
185  rm -rf ${D}
186  mkdir -p ${D}
187  
188  
189  
190  mkdir  -p ${D}${prefix}/share/crosswalk-thirdparty/
191  tar -zcvf out.tgz src/out
192  cp -ar out.tgz ${D}${prefix}/share/crosswalk-thirdparty/
193  
194  
195 }
196
197 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
198 PACKAGES += " crosswalk-thirdparty "
199
200 crosswalk-thirdparty_files = ""
201 crosswalk-thirdparty_files += "${prefix}/share/crosswalk-thirdparty/*"
202 MANIFESTFILES_${PN} = "crosswalk-thirdparty.manifest"
203
204 FILES_${PN} = "${crosswalk-thirdparty_files}"
205
206 PKG_crosswalk-thirdparty= "crosswalk-thirdparty"
207
208 require crosswalk-thirdparty-extraconf.inc
209