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