bac9fd943b76f99027526c88e8cce037e7db7edd
[scm/bb/meta-tizen.git] / recipes-tizen / crosswalk / crosswalk.inc
1 DESCRIPTION = "Crosswalk is an app runtime based on Chromium"
2 HOMEPAGE = "https://github.com/otcshare/crosswalk"
3 SECTION = "Web Framework/Web Run Time"
4 LICENSE = "(BSD-3-Clause and LGPL-2.1+)"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 inherit autotools-brokensep
11
12 PROVIDES = ""
13
14 #PROVIDES by crosswalk 
15
16
17 RDEPENDS = ""
18
19 DEPENDS = ""
20 #DEPENDS of crosswalk 
21 DEPENDS += "libhaptic"
22 DEPENDS += "aul-1"
23 DEPENDS += "cairo"
24 DEPENDS += "expat"
25 DEPENDS += "udev"
26 DEPENDS += "libslp-sensor"
27 DEPENDS += "libxslt"
28 inherit perlnative
29 DEPENDS += "pango"
30 DEPENDS += "bzip2"
31 DEPENDS += "nss"
32 DEPENDS += "slp-pkgmgr"
33 DEPENDS += "alsa-lib"
34 DEPENDS += "fontconfig"
35 DEPENDS += "wayland"
36 DEPENDS += "which"
37 DEPENDS += "libxml2"
38 DEPENDS += "libcap"
39 DEPENDS += "icu"
40 DEPENDS += "flex"
41 DEPENDS += "freetype"
42 DEPENDS += "gperf"
43 DEPENDS += "appcore-agent"
44 DEPENDS += "pkgmgr-info"
45 DEPENDS += "glib-2.0"
46 DEPENDS += "libdrm"
47 DEPENDS += "python-xml"
48 DEPENDS_append_class-native = " ninja-native"
49 DEPENDS += "mesa"
50 DEPENDS += "vconf"
51 DEPENDS += "nspr"
52 DEPENDS += "dbus"
53 DEPENDS += "libxkbcommon"
54 DEPENDS += "pulseaudio"
55 DEPENDS += "location-manager"
56 DEPENDS += "libexif"
57 DEPENDS_append_class-native = " bison-native"
58 DEPENDS += "pciutils"
59
60 do_prep() {
61  cd ${S}
62  chmod -Rf a+rX,u+w,g-w,o-w ${S}
63  #setup -q -n crosswalk
64  
65  cp ${S}/packaging/xwalk.in .
66  cp ${S}/packaging/xwalk.service.in .
67  cp ${S}/packaging/crosswalk.manifest .
68  cp ${S}/packaging/crosswalk.xml.in .
69  cp ${S}/packaging/crosswalk.png .
70  sed "s/@VERSION@/6.35.132.0/g" crosswalk.xml.in > crosswalk.xml
71  sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.in > xwalk
72  sed "s|@LIB_INSTALL_DIR@|${prefix}/lib|g" xwalk.service.in > xwalk.service
73  
74  cp -a src/AUTHORS AUTHORS.chromium
75  cp -a src/LICENSE LICENSE.chromium
76  cp -a src/xwalk/LICENSE LICENSE.xwalk
77  
78  cat ${S}/packaging/crosswalk-do-not-look-for-gtk2-when-using-aura.patch | patch -s  -p0 --fuzz=2
79  #patch1
80  
81  # Linking fails in Tizen Common when fatal ld warnings are enabled. XWALK-1379.
82  
83  cat ${S}/packaging/Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch | patch -s  -p0 --fuzz=2
84  #patch9
85  
86  
87 }
88 do_patch_append() {
89     bb.build.exec_func('do_prep', d)
90 }
91
92 do_configure() {
93 }
94
95 do_compile() {
96  cd ${S}
97  LANG=C
98  export LANG
99  unset DISPLAY
100  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
101  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
102  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
103  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
104  
105  
106  # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
107  # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
108  # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
109  export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
110  
111  # Building the RPM in the GBS chroot fails with errors such as
112  #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
113  #       failed to set dynamic section sizes: Memory exhausted
114  # For now, work around it by passing a GNU ld-specific flag that optimizes the
115  # linker for memory usage.
116  export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
117  
118  # Support building in a non-standard directory, possibly outside ${WORKDIR}.
119  # Since the build root is erased every time a new build is performed, one way
120  # to avoid losing the build directory is to specify a location outside the
121  # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
122  # (remember all paths are still inside the chroot):
123  #    gbs build --define 'BUILDDIR_NAME /some/path'
124  BUILDDIR_NAME=""
125  if [ -n "${BUILDDIR_NAME}" ]; then
126     mkdir -p "${BUILDDIR_NAME}"
127     ln -s "${BUILDDIR_NAME}" src/out
128  fi
129  
130  GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1 -Denable_ozone_wayland_vkb=1 -Denable_xdg_shell=1"
131  
132  # --no-parallel is added because chroot does not mount a /dev/shm, this will
133  # cause python multiprocessing.SemLock error.
134  export GYP_GENERATORS='ninja'
135  ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
136  --no-parallel \
137  ${GYP_EXTRA_FLAGS} \
138  -Dchromeos=0 \
139  -Ddisable_nacl=1 \
140  -Dtizen=1 \
141  -Dpython_ver=2.7 \
142  -Duse_aura=1 \
143  -Duse_cups=0 \
144  -Duse_gconf=0 \
145  -Duse_gnome_keyring=0 \
146  -Duse_kerberos=0 \
147  -Duse_system_bzip2=1 \
148  -Duse_system_libexif=1 \
149  -Duse_system_libxml=1 \
150  -Duse_system_nspr=1 \
151  -Denable_hidpi=1
152  
153  ninja -j16 -C src/out/Release xwalk xwalkctl xwalk_launcher xwalk-pkg-helper
154  
155  
156  
157 }
158
159 do_install() {
160  echo export RPM_BUILD_ROOT=${D}
161  cd ${S}
162  LANG=C
163  export LANG
164  unset DISPLAY
165  rm -rf ${D} 
166  mkdir -p ${D} 
167  
168  # Binaries.
169  install -p -D xwalk ${D}${prefix}/bin/xwalk
170  install -p -D ${S}/packaging/org.crosswalkproject.Runtime1.service ${D}/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service
171  install -p -D xwalk.service ${D}/usr/lib/systemd/user/xwalk.service
172  install -p -D src/out/Release/xwalk ${D}${prefix}/lib/xwalk/xwalk
173  install -p -D src/out/Release/xwalkctl ${D}${prefix}/bin/xwalkctl
174  install -p -D src/out/Release/xwalk-launcher ${D}${prefix}/bin/xwalk-launcher
175  # xwalk-pkg-helper needs to be set-user-ID-root so it can finish the installation process.
176  install -m 06755 -p -D src/out/Release/xwalk-pkg-helper ${D}${prefix}/bin/xwalk-pkg-helper
177  
178  # Supporting libraries and resources.
179  install -p -D src/out/Release/icudtl.dat ${D}${prefix}/lib/xwalk/icudtl.dat
180  install -p -D src/out/Release/lib/libmojo_system.so ${D}${prefix}/lib/xwalk/lib/libmojo_system.so
181  install -p -D src/out/Release/libffmpegsumo.so ${D}${prefix}/lib/xwalk/libffmpegsumo.so
182  install -p -D src/out/Release/xwalk.pak ${D}${prefix}/lib/xwalk/xwalk.pak
183  
184  # Register xwalk to the package manager.
185  install -p -D crosswalk.xml ${D}/usr/share/packages/crosswalk.xml
186  install -p -D crosswalk.png ${D}/usr/share/icons/default/small/crosswalk.png
187  
188  
189 }
190
191
192 crosswalk_files = ""
193 crosswalk_files += "crosswalk.manifest"
194 crosswalk_files += "${prefix}/bin/xwalk"
195 crosswalk_files += "${prefix}/bin/xwalkctl"
196 crosswalk_files += "${prefix}/bin/xwalk-launcher"
197 crosswalk_files += "${prefix}/bin/xwalk-pkg-helper"
198 crosswalk_files += "${prefix}/lib/xwalk/icudtl.dat"
199 crosswalk_files += "${prefix}/lib/xwalk/lib/libmojo_system.so"
200 crosswalk_files += "${prefix}/lib/xwalk/libffmpegsumo.so"
201 crosswalk_files += "${prefix}/lib/xwalk/xwalk"
202 crosswalk_files += "${prefix}/lib/xwalk/xwalk.pak"
203 crosswalk_files += "/usr/share/packages/crosswalk.xml"
204 crosswalk_files += "/usr/share/icons/default/small/crosswalk.png"
205 crosswalk_files += "/usr/share/dbus-1/services/org.crosswalkproject.Runtime1.service"
206 crosswalk_files += "/usr/lib/systemd/user/xwalk.service"
207
208 FILES_${PN} = "${crosswalk_files}"
209
210 PKG_crosswalk= "crosswalk"
211
212 require crosswalk-extraconf.inc
213