Fix Crosswalk build.
[scm/bb/meta-tizen.git] / recipes-tizen / crosswalk / crosswalk-extraconf.inc
1 inherit gettext
2
3 FILESEXTRAPATHS_prepend := "${THISDIR}/crosswalk"
4
5 SRC_URI += "\
6             file://include.gypi \
7             file://oe-defaults.gypi \
8             "
9
10 # This comes from the chromium recipe:
11 # http://layers.openembedded.org/layerindex/recipe/4969/
12 # It allows architecture specific configuration
13 COMPATIBLE_MACHINE = "(-)"
14 COMPATIBLE_MACHINE_i586 = "(.*)"
15 COMPATIBLE_MACHINE_x86-64 = "(.*)"
16 COMPATIBLE_MACHINE_armv6 = "(.*)"
17 COMPATIBLE_MACHINE_armv7a = "(.*)"
18 COMPATIBLE_MACHINE_romley-ivb = "(.*)"
19 COMPATIBLE_MACHINE_valleyisland-64 = "(.*)"
20
21 RDEPENDS_${PN} += "libpulsecommon"
22
23 do_compile_prepend() {
24
25  CC_host="gcc"; export CC_host
26  CXX_host="g++"; export CXX_host
27
28  LD="${CXX}" export LD
29  CC="${CC}" export CC
30  CXX="${CXX}" export CXX_host
31  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -I${WORKDIR}/oe-defaults.gypi -I${WORKDIR}/include.gypi"
32  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -I${WORKDIR}/oe-defaults.gypi -I${WORKDIR}/include.gypi"
33 }
34
35 do_configure() {
36 }
37
38 do_compile() {
39  cd ${S}
40  LANG=C
41  export LANG
42  unset DISPLAY
43  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
44  
45  
46  # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
47  # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
48  # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
49  export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
50  
51  
52  # Building the RPM in the GBS chroot fails with errors such as
53  #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
54  #       failed to set dynamic section sizes: Memory exhausted
55  # For now, work around it by passing a GNU ld-specific flag that optimizes the
56  # linker for memory usage.
57  export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
58  
59  # Support building in a non-standard directory, possibly outside ${WORKDIR}.
60  # Since the build root is erased every time a new build is performed, one way
61  # to avoid losing the build directory is to specify a location outside the
62  # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
63  # (remember all paths are still inside the chroot):
64  #    gbs build --define 'BUILDDIR_NAME /some/path'
65  BUILDDIR_NAME=""
66  if [ -n "${BUILDDIR_NAME}" ]; then
67     mkdir -p "${BUILDDIR_NAME}"
68     ln -s "${BUILDDIR_NAME}" src/out
69  fi
70  
71  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1 -Denable_ozone_wayland_vkb=1 -Denable_xdg_shell=0"
72  
73  # Force gold binary from chroot ld.gold provided by binutils-gold
74  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=1 -Dlinux_use_bundled_binutils=0 -Dlinux_use_bundled_gold=0 "
75  
76  # Linking fails in Tizen Common when fatal ld warnings are enabled. XWALK-1379.
77  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
78  
79  # Temporarily disable Alsa support while snd_seq_* support is not enabled on
80  # Tizen. See https://codereview.chromium.org/264973012 and
81  # https://review.tizen.org/gerrit/#/c/24336/
82  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_alsa=0"
83  
84  # Temporarily disable WebRTC support because its build currently hardcodes
85  # dependencies on X11 and OpenSSL. We are still trying to get some
86  # clarifications as to whether this is really necessary. See XWALK-2160.
87  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Denable_webrtc=0"
88  
89  # For building for arm in OBS, we need :
90  # -> to unset sysroot value.
91  # sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
92  # sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
93  #
94  # Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
95  # So force it.
96  
97  # --no-parallel is added because chroot does not mount a /dev/shm, this will
98  # cause python multiprocessing.SemLock error.
99  export GYP_GENERATORS='ninja'
100  ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
101  --no-parallel \
102  ${GYP_EXTRA_FLAGS} \
103  -Dchromeos=0 \
104  -Dtizen=1 \
105  -Dpython_ver=2.7 \
106  -Duse_aura=1 \
107  -Duse_cups=0 \
108  -Duse_gconf=0 \
109  -Duse_gnome_keyring=0 \
110  -Duse_kerberos=0 \
111  -Duse_system_bzip2=1 \
112  -Duse_system_libexif=1 \
113  -Duse_system_nspr=1 \
114  -Dshared_process_mode=1 \
115  -Denable_hidpi=1
116  
117  ninja -j16 -C src/out/Release xwalk xwalkctl xwalk_launcher xwalk-pkg-helper
118  
119  
120  
121 }
122
123 crosswalk-dbg_files += "/usr/lib/xwalk/.debug"
124 crosswalk-dbg_files += "/usr/lib/xwalk/.debug/libffmpegsumo.so"
125 crosswalk-dbg_files += "/usr/lib/xwalk/.debug/xwalk"
126
127 FILES_${PN}-dbg += "${crosswalk-dbg_files}"
128
129 pkg_postinst_${PN}() {
130     #!/bin/sh -e
131
132     mkdir -p $D/opt/share/icons/default/small
133     mkdir -p $D/opt/share/packages
134
135 }