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