Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / xwalk / packaging / crosswalk.spec
1 %bcond_with x
2 %bcond_with wayland
3
4 Name:           crosswalk
5 Version:        5.34.98.0
6 Release:        0
7 Summary:        Crosswalk is an app runtime based on Chromium
8 License:        (BSD-3-Clause and LGPL-2.1+)
9 Group:          Web Framework/Web Run Time
10 Url:            https://github.com/otcshare/crosswalk
11 Source:         %{name}.tar
12 Source1:        xwalk.in
13 Source2:        org.crosswalkproject.Runtime1.service
14 Source3:        xwalk.service.in
15 Source1001:     crosswalk.manifest
16 Source1002:     %{name}.xml.in
17 Source1003:     %{name}.png
18 Patch1:         %{name}-do-not-look-for-gtk2-when-using-aura.patch
19 Patch7:         %{name}-tizen-audio-session-manager.patch
20 Patch8:         %{name}-mesa-ozone-typedefs.patch
21 Patch9:         Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
22
23 BuildRequires:  bison
24 BuildRequires:  bzip2-devel
25 BuildRequires:  expat-devel
26 BuildRequires:  flex
27 BuildRequires:  gperf
28 BuildRequires:  libcap-devel
29 BuildRequires:  python
30 BuildRequires:  python-xml
31 BuildRequires:  perl
32 BuildRequires:  which
33 BuildRequires:  pkgconfig(alsa)
34 BuildRequires:  pkgconfig(appcore-common)
35 BuildRequires:  pkgconfig(audio-session-mgr)
36 BuildRequires:  pkgconfig(cairo)
37 BuildRequires:  pkgconfig(capi-location-manager)
38 BuildRequires:  pkgconfig(dbus-1)
39 BuildRequires:  pkgconfig(fontconfig)
40 BuildRequires:  pkgconfig(freetype2)
41 BuildRequires:  pkgconfig(gles20)
42 BuildRequires:  pkgconfig(glib-2.0)
43 BuildRequires:  pkgconfig(haptic)
44 BuildRequires:  pkgconfig(icu-i18n)
45 BuildRequires:  pkgconfig(libdrm)
46 BuildRequires:  pkgconfig(libexif)
47 BuildRequires:  pkgconfig(libpci)
48 BuildRequires:  pkgconfig(libpulse)
49 BuildRequires:  pkgconfig(libudev)
50 BuildRequires:  pkgconfig(libxml-2.0)
51 BuildRequires:  pkgconfig(libxslt)
52 BuildRequires:  pkgconfig(pango)
53 BuildRequires:  pkgconfig(pkgmgr-info)
54 BuildRequires:  pkgconfig(pkgmgr-parser)
55 BuildRequires:  pkgconfig(nspr)
56 BuildRequires:  pkgconfig(nss)
57 BuildRequires:  pkgconfig(sensor)
58 BuildRequires:  pkgconfig(vconf)
59 %if %{with x}
60 BuildRequires:  pkgconfig(x11)
61 BuildRequires:  pkgconfig(xcomposite)
62 BuildRequires:  pkgconfig(xcursor)
63 BuildRequires:  pkgconfig(xdamage)
64 BuildRequires:  pkgconfig(xext)
65 BuildRequires:  pkgconfig(xfixes)
66 BuildRequires:  pkgconfig(xi)
67 BuildRequires:  pkgconfig(xrandr)
68 BuildRequires:  pkgconfig(xrender)
69 BuildRequires:  pkgconfig(xscrnsaver)
70 BuildRequires:  pkgconfig(xt)
71 BuildRequires:  pkgconfig(xtst)
72 %endif
73
74 %if %{with wayland}
75 BuildRequires:  pkgconfig(wayland-client)
76 BuildRequires:  pkgconfig(wayland-cursor)
77 BuildRequires:  pkgconfig(wayland-egl)
78 BuildRequires:  pkgconfig(xkbcommon)
79 %else
80 BuildRequires:  pkgconfig(scim)
81 %endif
82
83 %description
84 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).
85
86 %package emulator-support
87 Summary:        Support files necessary for running Crosswalk on the Tizen emulator
88 License:        (BSD-3-Clause and LGPL-2.1+)
89 Group:          Web Framework/Web Run Time
90 Url:            https://github.com/otcshare/crosswalk
91
92 %description emulator-support
93 This package contains additional support files that are needed for running Crosswalk on the Tizen emulator.
94
95 %define _manifestdir /usr/share/packages
96 %define _desktop_icondir /usr/share/icons/default/small
97 %define _dbusservicedir /usr/share/dbus-1/services
98 %define _systemduserservicedir /usr/lib/systemd/user
99
100 %prep
101 %setup -q -n crosswalk
102
103 cp %{SOURCE1} .
104 cp %{SOURCE3} .
105 cp %{SOURCE1001} .
106 cp %{SOURCE1002} .
107 cp %{SOURCE1003} .
108 sed "s/@VERSION@/%{version}/g" %{name}.xml.in > %{name}.xml
109 sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.in > xwalk
110 sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.service.in > xwalk.service
111
112 cp -a src/AUTHORS AUTHORS.chromium
113 cp -a src/LICENSE LICENSE.chromium
114 cp -a src/xwalk/LICENSE LICENSE.xwalk
115
116 %patch1
117 %patch7
118
119 %if "%{tizen}" < "3.0"
120 %patch2
121 %patch3
122 %patch4
123 %patch5 -p1
124 %patch6
125 %endif
126
127 %if %{with wayland}
128 %patch8
129 %endif
130
131 %patch9
132
133 %build
134
135 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
136 # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
137 # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
138 export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
139
140 # Building the RPM in the GBS chroot fails with errors such as
141 #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
142 #       failed to set dynamic section sizes: Memory exhausted
143 # For now, work around it by passing a GNU ld-specific flag that optimizes the
144 # linker for memory usage.
145 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
146
147 # Support building in a non-standard directory, possibly outside %{_builddir}.
148 # Since the build root is erased every time a new build is performed, one way
149 # to avoid losing the build directory is to specify a location outside the
150 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
151 # (remember all paths are still inside the chroot):
152 #    gbs build --define 'BUILDDIR_NAME /some/path'
153 #
154 # The --depth and --generator-output combo is used to put all the Makefiles
155 # inside the build directory, and (this is the important part) keep file lists
156 # (generatedwith <|() in gyp) in the build directory as well, otherwise they
157 # will be in the source directory, erased every time and trigger an almost full
158 # Blink rebuild (among other smaller targets).
159 # We cannot always pass those flags, though, because gyp's make generator does
160 # not work if the --generator-output is the top-level source directory.
161 BUILDDIR_NAME="%{?BUILDDIR_NAME}"
162 if [ -z "${BUILDDIR_NAME}" ]; then
163    BUILDDIR_NAME="."
164 else
165    GYP_EXTRA_FLAGS="--depth=. --generator-output=${BUILDDIR_NAME}"
166 fi
167
168 %if %{with wayland}
169 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ash=1 -Duse_ozone=1"
170 %endif
171
172 # Change src/ so that we can pass "." to --depth below, otherwise we would need
173 # to pass "src" to it, but this confuses the gyp make generator, that expects
174 # to be called from the root source directory.
175 cd src
176
177 # --no-parallel is added because chroot does not mount a /dev/shm, this will
178 # cause python multiprocessing.SemLock error.
179 export GYP_GENERATORS='make'
180 ./xwalk/gyp_xwalk xwalk/xwalk.gyp \
181 --no-parallel \
182 ${GYP_EXTRA_FLAGS} \
183 -Dchromeos=0 \
184 -Ddisable_nacl=1 \
185 -Dtizen=1 \
186 -Dpython_ver=2.7 \
187 -Duse_aura=1 \
188 -Duse_cups=0 \
189 -Duse_gconf=0 \
190 -Duse_kerberos=0 \
191 -Duse_system_bzip2=1 \
192 -Duse_system_icu=1 \
193 -Duse_system_libexif=1 \
194 -Duse_system_libxml=1 \
195 -Duse_system_nspr=1 \
196 -Denable_xi21_mt=1 \
197 -Duse_xi2_mt=0 \
198 -Denable_hidpi=1
199
200 make %{?_smp_mflags} -C "${BUILDDIR_NAME}" BUILDTYPE=Release xwalk xwalkctl xwalk_launcher xwalk-pkg-helper
201
202 %install
203 # Support building in a non-standard directory, possibly outside %{_builddir}.
204 # Since the build root is erased every time a new build is performed, one way
205 # to avoid losing the build directory is to specify a location outside the
206 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
207 # (remember all paths are still inside the chroot):
208 #    gbs build --define 'BUILDDIR_NAME /some/path'
209 BUILDDIR_NAME="%{?BUILDDIR_NAME}"
210 if [ -z "${BUILDDIR_NAME}" ]; then
211    BUILDDIR_NAME="."
212 fi
213
214 # Since BUILDDIR_NAME can be either a relative path or an absolute one, we need
215 # to cd into src/ so that it means the same thing in the build and install
216 # stages: during the former, a relative location refers to a place inside src/,
217 # whereas during the latter a relative location by default would refer to a
218 # place one directory above src/. If BUILDDIR_NAME is an absolute path, this is
219 # irrelevant anyway.
220 cd src
221
222 # Binaries.
223 install -p -D ../xwalk %{buildroot}%{_bindir}/xwalk
224 install -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
225 install -p -D ../xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
226 install -p -D ${BUILDDIR_NAME}/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
227 install -p -D ${BUILDDIR_NAME}/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
228 install -p -D ${BUILDDIR_NAME}/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
229 # xwalk-pkg-helper needs to be set-user-ID-root so it can finish the installation process.
230 install -m 06755 -p -D ${BUILDDIR_NAME}/out/Release/xwalk-pkg-helper %{buildroot}%{_bindir}/xwalk-pkg-helper
231
232 # Supporting libraries and resources.
233 install -p -D ${BUILDDIR_NAME}/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
234 install -p -D ${BUILDDIR_NAME}/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
235 install -p -D ${BUILDDIR_NAME}/out/Release/libosmesa.so %{buildroot}%{_libdir}/xwalk/libosmesa.so
236 install -p -D ${BUILDDIR_NAME}/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
237
238 # Register xwalk to the package manager.
239 install -p -D ../%{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
240 install -p -D ../%{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
241
242 %files
243 %manifest %{name}.manifest
244 %license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
245 %{_bindir}/xwalk
246 %{_bindir}/xwalkctl
247 %{_bindir}/xwalk-launcher
248 %{_bindir}/xwalk-pkg-helper
249 %{_libdir}/xwalk/icudtl.dat
250 %{_libdir}/xwalk/libffmpegsumo.so
251 %{_libdir}/xwalk/xwalk
252 %{_libdir}/xwalk/xwalk.pak
253 %{_manifestdir}/%{name}.xml
254 %{_desktop_icondir}/%{name}.png
255 %{_dbusservicedir}/org.crosswalkproject.Runtime1.service
256 %{_systemduserservicedir}/xwalk.service
257
258 %files emulator-support
259 %{_libdir}/xwalk/libosmesa.so