5 # NaCl build on 64bit system require libc 32bit to build the 32 IRT.
6 # While Tizen 64bit image does not offer 32bit packages at all,
7 # check https://bugs.tizen.org/jira/browse/PTREL-803 for details.
8 # So disable nacl for 64bit now.
9 %define _disable_nacl 1
11 %define _disable_nacl 0
17 Summary: Crosswalk is an app runtime based on Chromium
18 License: (BSD-3-Clause and LGPL-2.1+)
19 Group: Web Framework/Web Run Time
20 Url: https://github.com/otcshare/crosswalk
23 Source2: org.crosswalkproject.Runtime1.service
24 Source3: xwalk.service.in
25 Source1001: crosswalk.manifest
26 Source1002: %{name}.xml.in
27 Source1003: %{name}.png
28 Patch1: %{name}-do-not-look-for-gtk2-when-using-aura.patch
29 Patch9: Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
32 BuildRequires: bzip2-devel
33 BuildRequires: elfutils
34 BuildRequires: expat-devel
37 BuildRequires: libcap-devel
38 BuildRequires: libelf-devel
41 BuildRequires: python-xml
44 BuildRequires: pkgconfig(alsa)
45 BuildRequires: pkgconfig(appcore-common)
46 BuildRequires: pkgconfig(cairo)
47 BuildRequires: pkgconfig(capi-location-manager)
48 BuildRequires: pkgconfig(dbus-1)
49 BuildRequires: pkgconfig(fontconfig)
50 BuildRequires: pkgconfig(freetype2)
51 BuildRequires: pkgconfig(gles20)
52 BuildRequires: pkgconfig(glib-2.0)
53 BuildRequires: pkgconfig(haptic)
54 BuildRequires: pkgconfig(icu-i18n)
55 BuildRequires: pkgconfig(libdrm)
56 BuildRequires: pkgconfig(libexif)
57 BuildRequires: pkgconfig(libpci)
58 BuildRequires: pkgconfig(libpulse)
59 BuildRequires: pkgconfig(libudev)
60 BuildRequires: pkgconfig(libxml-2.0)
61 BuildRequires: pkgconfig(libxslt)
62 BuildRequires: pkgconfig(pango)
63 BuildRequires: pkgconfig(pkgmgr-info)
64 BuildRequires: pkgconfig(pkgmgr-installer)
65 BuildRequires: pkgconfig(pkgmgr-parser)
66 BuildRequires: pkgconfig(nspr)
67 BuildRequires: pkgconfig(nss)
68 BuildRequires: pkgconfig(sensor)
69 BuildRequires: pkgconfig(vconf)
71 BuildRequires: pkgconfig(x11)
72 BuildRequires: pkgconfig(xcomposite)
73 BuildRequires: pkgconfig(xcursor)
74 BuildRequires: pkgconfig(xdamage)
75 BuildRequires: pkgconfig(xext)
76 BuildRequires: pkgconfig(xfixes)
77 BuildRequires: pkgconfig(xi)
78 BuildRequires: pkgconfig(xrandr)
79 BuildRequires: pkgconfig(xrender)
80 BuildRequires: pkgconfig(xscrnsaver)
81 BuildRequires: pkgconfig(xt)
82 BuildRequires: pkgconfig(xtst)
86 BuildRequires: pkgconfig(wayland-client)
87 BuildRequires: pkgconfig(wayland-cursor)
88 BuildRequires: pkgconfig(wayland-egl)
89 BuildRequires: pkgconfig(xkbcommon)
91 BuildRequires: pkgconfig(scim)
95 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).
97 %define _manifestdir /usr/share/packages
98 %define _manifestdir_ro /opt/share/packages
99 %define _desktop_icondir /usr/share/icons/default/small
100 %define _desktop_icondir_ro /opt/share/icons/default/small
101 %define _dbusservicedir /usr/share/dbus-1/services
102 %define _systemduserservicedir /usr/lib/systemd/user
105 %setup -q -n crosswalk
112 sed "s/@VERSION@/%{version}/g" %{name}.xml.in > %{name}.xml
113 sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.in > xwalk
114 sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.service.in > xwalk.service
116 cp -a src/AUTHORS AUTHORS.chromium
117 cp -a src/LICENSE LICENSE.chromium
118 cp -a src/xwalk/LICENSE LICENSE.xwalk
125 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
126 # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
127 # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
128 export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
130 %if ! %{_disable_nacl}
131 # For nacl_bootstrap on ia32. The original CFLAGS set by the gyp
132 # native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp already ignored
133 # -fstack-protector and -funwind-tables, but Tizen's CFLAGS end up appending them, thus
134 # causing linking failures. Check XWALK-1689 for details.
135 export CFLAGS=`echo $CFLAGS | sed s,-fstack-protector,,g`
136 export CFLAGS=`echo $CFLAGS | sed s,-funwind-tables,,g`
139 # Building the RPM in the GBS chroot fails with errors such as
140 # /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
141 # failed to set dynamic section sizes: Memory exhausted
142 # For now, work around it by passing a GNU ld-specific flag that optimizes the
143 # linker for memory usage.
144 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
146 # Support building in a non-standard directory, possibly outside %{_builddir}.
147 # Since the build root is erased every time a new build is performed, one way
148 # to avoid losing the build directory is to specify a location outside the
149 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
150 # (remember all paths are still inside the chroot):
151 # gbs build --define 'BUILDDIR_NAME /some/path'
152 BUILDDIR_NAME="%{?BUILDDIR_NAME}"
153 if [ -n "${BUILDDIR_NAME}" ]; then
154 mkdir -p "${BUILDDIR_NAME}"
155 ln -s "${BUILDDIR_NAME}" src/out
159 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1 -Denable_ozone_wayland_vkb=1 -Denable_xdg_shell=1"
162 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=%{_disable_nacl}"
164 # Linking fails in Tizen Common when fatal ld warnings are enabled. XWALK-1379.
165 %if "%{profile}" == "common" || "%{profile}" == "generic"
166 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
169 # --no-parallel is added because chroot does not mount a /dev/shm, this will
170 # cause python multiprocessing.SemLock error.
171 export GYP_GENERATORS='ninja'
172 ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
181 -Duse_gnome_keyring=0 \
183 -Duse_system_bzip2=1 \
184 -Duse_system_libexif=1 \
185 -Duse_system_libxml=1 \
186 -Duse_system_nspr=1 \
189 ninja %{?_smp_mflags} -C src/out/Release xwalk xwalkctl xwalk_launcher xwalk-pkg-helper
193 install -p -D xwalk %{buildroot}%{_bindir}/xwalk
194 install -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
195 install -p -D xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
196 install -p -D src/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
197 install -p -D src/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
198 install -p -D src/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
199 # xwalk-pkg-helper needs to be set-user-ID-root so it can finish the installation process.
200 install -m 06755 -p -D src/out/Release/xwalk-pkg-helper %{buildroot}%{_bindir}/xwalk-pkg-helper
202 # Supporting libraries and resources.
203 install -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
204 install -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
205 install -p -D src/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
208 %if ! %{_disable_nacl}
209 install -p -D src/out/Release/libppGoogleNaClPluginChrome.so %{buildroot}%{_libdir}/xwalk/libppGoogleNaClPluginChrome.so
210 install -p -D src/out/Release/nacl_bootstrap_munge_phdr %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_munge_phdr
211 install -p -D src/out/Release/nacl_bootstrap_raw %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_raw
212 install -p -D src/out/Release/nacl_helper %{buildroot}%{_libdir}/xwalk/nacl_helper
213 install -p -D src/out/Release/nacl_helper_bootstrap %{buildroot}%{_libdir}/xwalk/nacl_helper_bootstrap
214 install -p -D src/out/Release/nacl_irt_*.nexe %{buildroot}%{_libdir}/xwalk
215 install -p -d %{buildroot}%{_libdir}/xwalk/pnacl
216 install -m 0664 -p -D src/out/Release/pnacl/* %{buildroot}%{_libdir}/xwalk/pnacl
219 # Register xwalk to the package manager.
220 install -p -D %{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
221 install -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
224 mkdir -p %{_desktop_icondir_ro}
225 mkdir -p %{_manifestdir_ro}
228 %manifest %{name}.manifest
229 %license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
232 %{_bindir}/xwalk-launcher
233 %{_bindir}/xwalk-pkg-helper
234 %{_libdir}/xwalk/icudtl.dat
235 %{_libdir}/xwalk/libffmpegsumo.so
236 %if ! %{_disable_nacl}
237 %{_libdir}/xwalk/libppGoogleNaClPluginChrome.so
238 %{_libdir}/xwalk/nacl_bootstrap_munge_phdr
239 %{_libdir}/xwalk/nacl_bootstrap_raw
240 %{_libdir}/xwalk/nacl_helper
241 %{_libdir}/xwalk/nacl_helper_bootstrap
242 %{_libdir}/xwalk/nacl_irt_*.nexe
243 %{_libdir}/xwalk/pnacl/*
245 %{_libdir}/xwalk/xwalk
246 %{_libdir}/xwalk/xwalk.pak
247 %{_manifestdir}/%{name}.xml
248 %{_desktop_icondir}/%{name}.png
249 %{_dbusservicedir}/org.crosswalkproject.Runtime1.service
250 %{_systemduserservicedir}/xwalk.service