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