Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 150cf46

Browse files
author
Jean-Benoit MARTIN
committed
Split crosswalk build in 2 packages
crosswalk.spec : build thirdparty crosswalk-bin.spec : build binaries xwalk, ... Workaround to decrease the build time of crosswalk Most of crosswalk thirdparties are built separately BUG=XWALK-2571 Signed-off-by: Jean-Benoit MARTIN <[email protected]>
1 parent 76d746e commit 150cf46

File tree

5 files changed

+760
-111
lines changed

5 files changed

+760
-111
lines changed

packaging/changedate.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
5+
if __name__ == '__main__':
6+
for dirpath, dirs, files in os.walk(".", topdown=False):
7+
for name in files:
8+
try:
9+
os.utime(os.path.join(dirpath, name),(1260572400, 1260572400))
10+
except Exception:
11+
pass
12+

packaging/crosswalk-bin.spec

Lines changed: 330 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,330 @@
1+
%bcond_with x
2+
%bcond_with wayland
3+
4+
%ifarch x86_64 %{arm}
5+
### x86_64
6+
# NaCl build on 64bit system require libc 32bit to build the 32 IRT.
7+
# While Tizen 64bit image does not offer 32bit packages at all,
8+
# check https://bugs.tizen.org/jira/browse/PTREL-803 for details.
9+
# So disable nacl for 64bit now.
10+
### ARM
11+
# Due to OBS build for ARM some files needed by NaCl to be build
12+
# are not present.
13+
%define _disable_nacl 1
14+
%else
15+
# Since M39, Google has stopped shipping a 32-bit PNaCl toolchain, so we cannot
16+
# build NaCl on a fully 32-bit host anymore. See XWALK-2679.
17+
%define _disable_nacl 1
18+
%endif
19+
20+
# adjust compression algorithm to speed up RPMS creation
21+
# source RPM and debug RPMS are big and take too much time
22+
# when using standard (lzma) compression
23+
%define _source_payload w3.gzdio
24+
%define _binary_payload w3.gzdio
25+
26+
Name: crosswalk
27+
Version: 11.39.237.0
28+
Release: 0
29+
Summary: Chromium-based app runtime
30+
License: (BSD-3-Clause and LGPL-2.1+)
31+
Group: Web Framework/Web Run Time
32+
Url: https://github.com/otcshare/crosswalk
33+
Source: %{name}.tar
34+
Source1: xwalk.in
35+
Source2: org.crosswalkproject.Runtime1.service
36+
Source3: xwalk.service.in
37+
Source1001: crosswalk.manifest
38+
Source1002: %{name}.xml.in
39+
Source1003: %{name}.png
40+
Source1004: changedate.py
41+
Patch9: Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
42+
Patch10: crosswalk-do-not-look-for-gtk-dependencies-on-x11.patch
43+
44+
BuildRequires: bison
45+
BuildRequires: bzip2-devel
46+
BuildRequires: elfutils
47+
BuildRequires: expat-devel
48+
BuildRequires: flex
49+
BuildRequires: gperf
50+
BuildRequires: libcap-devel
51+
BuildRequires: libelf-devel
52+
BuildRequires: ninja
53+
BuildRequires: python
54+
BuildRequires: python-xml
55+
BuildRequires: perl
56+
BuildRequires: which
57+
BuildRequires: pkgconfig(ail)
58+
BuildRequires: pkgconfig(alsa)
59+
BuildRequires: pkgconfig(appcore-common)
60+
BuildRequires: pkgconfig(cairo)
61+
BuildRequires: pkgconfig(capi-location-manager)
62+
BuildRequires: pkgconfig(dbus-1)
63+
BuildRequires: pkgconfig(fontconfig)
64+
BuildRequires: pkgconfig(freetype2)
65+
BuildRequires: pkgconfig(gles20)
66+
BuildRequires: pkgconfig(glib-2.0)
67+
BuildRequires: pkgconfig(haptic)
68+
BuildRequires: pkgconfig(icu-i18n)
69+
BuildRequires: pkgconfig(libdrm)
70+
BuildRequires: pkgconfig(libexif)
71+
BuildRequires: pkgconfig(libpci)
72+
BuildRequires: pkgconfig(libpulse)
73+
BuildRequires: pkgconfig(libtzplatform-config)
74+
BuildRequires: pkgconfig(libudev)
75+
BuildRequires: pkgconfig(libxml-2.0)
76+
BuildRequires: pkgconfig(libxslt)
77+
BuildRequires: pkgconfig(pango)
78+
BuildRequires: pkgconfig(pkgmgr)
79+
BuildRequires: pkgconfig(pkgmgr-info)
80+
BuildRequires: pkgconfig(pkgmgr-installer)
81+
BuildRequires: pkgconfig(pkgmgr-parser)
82+
BuildRequires: pkgconfig(secure-storage)
83+
BuildRequires: pkgconfig(sensor)
84+
BuildRequires: pkgconfig(nspr)
85+
BuildRequires: pkgconfig(nss)
86+
BuildRequires: pkgconfig(vconf)
87+
BuildRequires: pkgconfig(xmlsec1)
88+
%if %{with x}
89+
BuildRequires: pkgconfig(x11)
90+
BuildRequires: pkgconfig(xcomposite)
91+
BuildRequires: pkgconfig(xcursor)
92+
BuildRequires: pkgconfig(xdamage)
93+
BuildRequires: pkgconfig(xext)
94+
BuildRequires: pkgconfig(xfixes)
95+
BuildRequires: pkgconfig(xi)
96+
BuildRequires: pkgconfig(xrandr)
97+
BuildRequires: pkgconfig(xrender)
98+
BuildRequires: pkgconfig(xscrnsaver)
99+
BuildRequires: pkgconfig(xt)
100+
BuildRequires: pkgconfig(xtst)
101+
%endif
102+
103+
%if "%{profile}" == "ivi"
104+
BuildRequires: pkgconfig(murphy-common)
105+
BuildRequires: pkgconfig(murphy-resource)
106+
%endif
107+
108+
%if %{with wayland}
109+
BuildRequires: pkgconfig(wayland-client)
110+
BuildRequires: pkgconfig(wayland-cursor)
111+
BuildRequires: pkgconfig(wayland-egl)
112+
BuildRequires: pkgconfig(xkbcommon)
113+
%else
114+
BuildRequires: pkgconfig(scim)
115+
%endif
116+
Requires: ca-certificates-tizen
117+
Requires: ss-server
118+
BuildRequires: crosswalk-thirdparty
119+
120+
%description
121+
Crosswalk is an app runtime based on Chromium. It is an open source project started by the Intel Open Source Technology Center (http://www.01.org).
122+
123+
%define _manifestdir %TZ_SYS_RO_PACKAGES
124+
%define _manifestdir_ro %TZ_SYS_RO_PACKAGE
125+
%define _desktop_icondir %TZ_SYS_RW_ICONS/default/small
126+
%define _desktop_icondir_ro %TZ_SYS_RO_ICONS/default/small
127+
%define _dbusservicedir /usr/share/dbus-1/services
128+
%define _systemduserservicedir /usr/lib/systemd/user
129+
130+
%prep
131+
%setup -q -n crosswalk
132+
133+
cp %{SOURCE1} .
134+
cp %{SOURCE3} .
135+
cp %{SOURCE1001} .
136+
cp %{SOURCE1002} .
137+
cp %{SOURCE1003} .
138+
cp %{SOURCE1004} .
139+
sed "s/@VERSION@/%{version}/g" %{name}.xml.in > %{name}.xml
140+
sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.in > xwalk
141+
sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.service.in > xwalk.service
142+
143+
cp -a src/AUTHORS AUTHORS.chromium
144+
cp -a src/LICENSE LICENSE.chromium
145+
cp -a src/xwalk/LICENSE LICENSE.xwalk
146+
147+
%patch9
148+
149+
# The profiles using Wayland (and thus Ozone) do not need this patch.
150+
%if !%{with wayland}
151+
%patch10
152+
%endif
153+
154+
%build
155+
156+
mkdir -p src/out
157+
if [ -f %{_datadir}/crosswalk-thirdparty/out.tgz ]; then
158+
tar -zxvf %{_datadir}/crosswalk-thirdparty/out.tgz
159+
fi
160+
python ./changedate.py
161+
162+
# Stop unconditionally passing -Wall to the compiler. Chromium has its own
163+
# mechanisms for deciding which parts of the code need -Wall and which need it
164+
# to be left out (since several pieces are built with -Werror). At least in
165+
# M39, this is preventing the "rtc_base" target from being built because it
166+
# does not expect -Wall to be passed to the compiler (see webrtc issue 3307).
167+
export CXXFLAGS=`echo $CXXFLAGS | sed s,-Wall,,g`
168+
169+
# For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
170+
# src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
171+
# CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
172+
export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
173+
174+
%if ! %{_disable_nacl}
175+
# For nacl_bootstrap on ia32. The original CFLAGS set by the gyp
176+
# native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp already ignored
177+
# -fstack-protector and -funwind-tables, but Tizen's CFLAGS end up appending them, thus
178+
# causing linking failures. Check XWALK-1689 for details.
179+
export CFLAGS=`echo $CFLAGS | sed s,-fstack-protector,,g`
180+
export CFLAGS=`echo $CFLAGS | sed s,-funwind-tables,,g`
181+
%endif
182+
183+
# Building the RPM in the GBS chroot fails with errors such as
184+
# /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
185+
# failed to set dynamic section sizes: Memory exhausted
186+
# For now, work around it by passing a GNU ld-specific flag that optimizes the
187+
# linker for memory usage.
188+
export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
189+
190+
# Support building in a non-standard directory, possibly outside %{_builddir}.
191+
# Since the build root is erased every time a new build is performed, one way
192+
# to avoid losing the build directory is to specify a location outside the
193+
# build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
194+
# (remember all paths are still inside the chroot):
195+
# gbs build --define 'BUILDDIR_NAME /some/path'
196+
BUILDDIR_NAME="%{?BUILDDIR_NAME}"
197+
if [ -n "${BUILDDIR_NAME}" ]; then
198+
mkdir -p "${BUILDDIR_NAME}"
199+
ln -s "${BUILDDIR_NAME}" src/out
200+
fi
201+
202+
%if %{with wayland}
203+
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
204+
%endif
205+
206+
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=%{_disable_nacl}"
207+
208+
# Linking fails in Tizen Common when fatal ld warnings are enabled. XWALK-1379.
209+
%if "%{profile}" == "common" || "%{profile}" == "generic"
210+
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
211+
%endif
212+
213+
# For building for arm in OBS, we need :
214+
# -> to unset sysroot value.
215+
# sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
216+
# -> to force system ld binary.
217+
# Indeed the build is made on Emulated / Virtualized environment that correspond
218+
# to the target.
219+
# gold ld used is avaible only for 32/64 bits Intel Arch.
220+
# sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
221+
#
222+
# Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
223+
# So force it.
224+
%ifarch %{arm}
225+
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Dsysroot= -Dlinux_use_gold_binary=0"
226+
export CFLAGS=`echo $CFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
227+
export CXXFLAGS=`echo $CXXFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
228+
export FFLAGS=`echo $FFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
229+
%endif
230+
231+
%if "%{profile}" == "ivi"
232+
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Denable_murphy=1"
233+
%endif
234+
235+
# --no-parallel is added because chroot does not mount a /dev/shm, this will
236+
# cause python multiprocessing.SemLock error.
237+
export GYP_GENERATORS='ninja'
238+
./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
239+
--no-parallel \
240+
${GYP_EXTRA_FLAGS} \
241+
-Dchromeos=0 \
242+
-Dclang=0 \
243+
-Dtizen=1 \
244+
-Dpython_ver=2.7 \
245+
-Duse_aura=1 \
246+
-Duse_cups=0 \
247+
-Duse_gconf=0 \
248+
-Duse_gnome_keyring=0 \
249+
-Duse_kerberos=0 \
250+
-Duse_system_bzip2=1 \
251+
-Duse_system_libexif=1 \
252+
-Duse_system_libxml=1 \
253+
-Duse_system_nspr=1 \
254+
-Dshared_process_mode=1 \
255+
-Denable_hidpi=1
256+
257+
ninja %{?_smp_mflags} -C src/out/Release xwalk xwalk_launcher xwalk_application_tools
258+
259+
%install
260+
# Binaries.
261+
install -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
262+
install -p -D xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
263+
install -p -D src/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
264+
install -p -D src/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
265+
install -p -D src/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
266+
install -p -D src/out/Release/xwalk_backend %{buildroot}%{_libdir}/xwalk/xwalk_backend
267+
install -p -D src/out/Release/lib/libxwalk_backend_lib.so %{buildroot}%{_libdir}/xwalk/libxwalk_backend_lib.so
268+
269+
# Supporting libraries and resources.
270+
install -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
271+
install -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
272+
install -p -D src/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
273+
mkdir -p %{buildroot}%{_datadir}/xwalk
274+
install -p -D src/xwalk/application/common/tizen/configuration/*.xsd %{buildroot}%{_datadir}/xwalk/
275+
276+
# PNaCl
277+
%if ! %{_disable_nacl}
278+
install -p -D src/out/Release/nacl_bootstrap_raw %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_raw
279+
install -p -D src/out/Release/nacl_helper %{buildroot}%{_libdir}/xwalk/nacl_helper
280+
install -p -D src/out/Release/nacl_helper_bootstrap %{buildroot}%{_libdir}/xwalk/nacl_helper_bootstrap
281+
install -p -D src/out/Release/nacl_irt_*.nexe %{buildroot}%{_libdir}/xwalk
282+
install -p -d %{buildroot}%{_libdir}/xwalk/pnacl
283+
install -m 0664 -p -D src/out/Release/pnacl/* %{buildroot}%{_libdir}/xwalk/pnacl
284+
%endif
285+
286+
# Register xwalk to the package manager.
287+
install -p -D %{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
288+
install -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
289+
290+
%post
291+
mkdir -p %{_desktop_icondir_ro}
292+
mkdir -p %{_manifestdir_ro}
293+
294+
ln -sf %{_libdir}/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libxpk.so
295+
ln -sf %{_libdir}/xwalk/libxwalk_backend_lib.so /etc/package-manager/backendlib/libwgt.so
296+
ln -sf %{_libdir}/xwalk/xwalk_backend /etc/package-manager/backend/xpk
297+
ln -sf %{_libdir}/xwalk/xwalk_backend /etc/package-manager/backend/wgt
298+
299+
%preun
300+
if [ $1 -eq 0 ] ; then
301+
# don't remove if we are upgrade the rpm package
302+
[ -L /etc/package-manager/backendlib/libxpk.so ] && rm /etc/package-manager/backendlib/libxpk.so
303+
[ -L /etc/package-manager/backendlib/libwgt.so ] && rm /etc/package-manager/backendlib/libwgt.so
304+
[ -L /etc/package-manager/backend/xpk ] && rm /etc/package-manager/backend/xpk
305+
[ -L /etc/package-manager/backend/wgt ] && rm /etc/package-manager/backend/wgt
306+
fi
307+
308+
%files
309+
%manifest %{name}.manifest
310+
%license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
311+
%{_bindir}/xwalkctl
312+
%{_bindir}/xwalk-launcher
313+
%{_libdir}/xwalk/icudtl.dat
314+
%{_libdir}/xwalk/libffmpegsumo.so
315+
%if ! %{_disable_nacl}
316+
%{_libdir}/xwalk/nacl_bootstrap_raw
317+
%{_libdir}/xwalk/nacl_helper
318+
%{_libdir}/xwalk/nacl_helper_bootstrap
319+
%{_libdir}/xwalk/nacl_irt_*.nexe
320+
%{_libdir}/xwalk/pnacl/*
321+
%endif
322+
%{_libdir}/xwalk/xwalk
323+
%{_libdir}/xwalk/xwalk.pak
324+
%{_libdir}/xwalk/libxwalk_backend_lib.so
325+
%{_libdir}/xwalk/xwalk_backend
326+
%{_manifestdir}/%{name}.xml
327+
%{_desktop_icondir}/%{name}.png
328+
%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
329+
%{_systemduserservicedir}/xwalk.service
330+
%{_datadir}/xwalk/*
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<manifest>
2+
<request>
3+
<domain name="_"/>
4+
</request>
5+
</manifest>

0 commit comments

Comments
 (0)