]> git.pld-linux.org Git - packages/chromium-browser.git/blob - chromium-browser.spec
fix nacl building
[packages/chromium-browser.git] / chromium-browser.spec
1 #
2 # Conditional build:
3 %bcond_without  debuginfo               # disable debuginfo creation (it is huge)
4 %bcond_without  ffmpegsumo              # build with ffmpegsumo
5 %bcond_without  kerberos                # build with kerberos support (dlopened if support compiled, library names in src/net/http/http_auth_gssapi_posix.cc)
6 %bcond_without  keyring                 # with keyring support (gnome-keyring dlopened, kwalletd via dbus)
7 %bcond_without  cups                    # with cups
8 %bcond_without  gconf                   # with GConf
9 %bcond_without  pulseaudio              # with pulseaudio
10 %bcond_without  nacl                    # build Native Client support
11 %bcond_without  sandboxing              # with sandboxing
12 %bcond_with             selinux                 # with SELinux (need policy first)
13 %bcond_with             shared_libs             # with shared libs
14 %bcond_with             sse2                    # use SSE2 instructions
15 %bcond_with             tcmalloc                # use tcmalloc
16 %bcond_with             system_sqlite   # with system sqlite
17 %bcond_without  system_flac             # with system flac
18 %bcond_without  system_libwebp  # with system libwebp
19 %bcond_without  system_speex    # with system speex
20 %bcond_with             system_v8               # with system v8
21 %bcond_without  system_vpx              # with system vpx
22 %bcond_without  system_yasm             # with system yasm
23 %bcond_without  system_zlib             # with system zlib
24 %bcond_without  libjpegturbo    # use libjpeg-turbo features
25 %bcond_with             verbose                 # verbose build (V=1)
26
27 # TODO
28 # - check system sqlite linking problems
29 # - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
30 # - use_system_ssl (use_openssl: http://crbug.com/62803)
31 # - use_system_ffmpeg && build_ffmpegsumo
32 # - use_system_hunspell
33 # - use_system_stlport
34 # - other defaults: src/build/common.gypi
35
36 # NOTES:
37 # - mute BEEP mixer if you do not want to hear horrible system bell when
38 #   pressing home/end in url bar or more ^F search results on page.
39 # - build -bp: 1.2G
40 # - build i686: -bc: 2.7G; -bb: ~1.0GB
41 # - build x86_64: ~1.9G
42 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
43 # - to look for new tarball, use update-source.sh script
44
45 # NOTE TO USERS:
46 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
47 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
48 # or:
49 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
50
51 %define         gyp_rev 1014
52 Summary:        A WebKit powered web browser
53 Name:           chromium-browser
54 Version:        21.0.1180.57
55 Release:        1
56 License:        BSD, LGPL v2+ (ffmpeg)
57 Group:          X11/Applications/Networking
58 Source0:        http://carme.pld-linux.org/~glen/chromium-browser/src/stable/%{name}-%{version}.tar.xz
59 # Source0-md5:  15242c061905204e93cd364a5db954cc
60 Source1:        %{name}.default
61 Source2:        %{name}.sh
62 Source3:        %{name}.desktop
63 Source5:        find-lang.sh
64 Source6:        update-source.sh
65 Source7:        clean-source.sh
66 Source8:        get-source.sh
67 Patch0:         system-libs.patch
68 Patch1:         plugin-searchdirs.patch
69 Patch2:         gyp-system-minizip.patch
70 Patch3:         disable_dlog_and_dcheck_in_release_builds.patch
71 Patch4:         path-libpdf.patch
72 Patch5:         options-support.patch
73 Patch6:         get-webkit_revision.patch
74 Patch7:         dlopen_sonamed_gl.patch
75 Patch8:         chromium_useragent.patch.in
76 Patch9:         chromium-ppapi.patch
77 # https://bugs.gentoo.org/show_bug.cgi?id=393471
78 # libjpeg-turbo >= 1.1.90 supports that feature
79 Patch11:        chromium-revert-jpeg-swizzle-r2.patch
80 Patch15:        nacl-build-irt.patch
81 Patch16:        nacl-linkingfix.patch
82 URL:            http://www.chromium.org/Home
83 %{?with_gconf:BuildRequires:    GConf2-devel}
84 BuildRequires:  OpenGL-GLU-devel
85 BuildRequires:  alsa-lib-devel
86 BuildRequires:  atk-devel
87 BuildRequires:  bison
88 BuildRequires:  bzip2-devel
89 %{?with_nacl:BuildRequires:     crossnacl-binutils >= 2.20.1}
90 %{?with_nacl:BuildRequires:     crossnacl-gcc >= 4.4.3}
91 %{?with_nacl:BuildRequires:     crossnacl-gcc-c++ >= 4.4.3}
92 %{?with_nacl:BuildRequires:     crossnacl-newlib >= 1.18.0}
93 %{?with_cups:BuildRequires:     cups-devel}
94 BuildRequires:  dbus-glib-devel
95 BuildRequires:  expat-devel
96 %{?with_system_flac:BuildRequires:      flac-devel}
97 BuildRequires:  flex
98 BuildRequires:  fontconfig-devel
99 BuildRequires:  glib2-devel
100 BuildRequires:  gperf
101 BuildRequires:  gtk+2-devel
102 %{?with_kerberos:BuildRequires: heimdal-devel}
103 BuildRequires:  hicolor-icon-theme
104 BuildRequires:  libevent-devel
105 %{?with_keyring:BuildRequires:  libgnome-keyring-devel}
106 BuildRequires:  libicu-devel >= 4.6
107 %{!?with_libjpegturbo:BuildRequires:    libjpeg-devel}
108 %{?with_libjpegturbo:BuildRequires:     libjpeg-turbo-devel >= 1.2.0}
109 BuildRequires:  libpng-devel
110 %{?with_selinux:BuildRequires:  libselinux-devel}
111 BuildRequires:  libstdc++-devel
112 %{?with_system_vpx:BuildRequires:       libvpx-devel >= 0.9.5-2}
113 %{?with_system_libwebp:BuildRequires:   libwebp-devel >= 0.1.99}
114 BuildRequires:  libxml2-devel
115 BuildRequires:  libxslt-devel
116 BuildRequires:  lzma
117 BuildRequires:  minizip-devel
118 BuildRequires:  nspr-devel
119 BuildRequires:  nss-devel >= 1:3.12.3
120 BuildRequires:  pam-devel
121 BuildRequires:  pango-devel
122 BuildRequires:  perl-modules
123 BuildRequires:  pkgconfig
124 %{?with_pulseaudio:BuildRequires:       pulseaudio-devel}
125 BuildRequires:  python
126 #BuildRequires: python-gyp >= 1-%{gyp_rev}
127 BuildRequires:  python-modules
128 BuildRequires:  rpm >= 4.4.9-56
129 BuildRequires:  rpmbuild(macros) >= 1.453
130 %{?with_system_speex:BuildRequires:     speex-devel >= 1:1.2-rc1}
131 BuildRequires:  sqlite3-devel >= 3.6.1
132 BuildRequires:  subversion
133 BuildRequires:  tar >= 1:1.22
134 BuildRequires:  udev-devel
135 BuildRequires:  util-linux
136 %{?with_system_v8:BuildRequires:        v8-devel >= 3.7}
137 BuildRequires:  which
138 BuildRequires:  xorg-lib-libXScrnSaver-devel
139 BuildRequires:  xorg-lib-libXt-devel
140 BuildRequires:  xorg-lib-libXtst-devel
141 BuildRequires:  xz
142 %{?with_system_yasm:BuildRequires:      yasm}
143 %{?with_system_zlib:BuildRequires:      zlib-devel}
144 Requires:       browser-plugins >= 2.0
145 Requires:       desktop-file-utils
146 Requires:       hicolor-icon-theme
147 %{?with_libjpegturbo:Requires:  libjpeg-turbo >= 1.2.0}
148 %{?with_system_vpx:Requires:    libvpx >= 0.9.5-2}
149 Requires:       xdg-utils >= 1.0.2-4
150 Provides:       wwwbrowser
151 Obsoletes:      chromium-browser-bookmark_manager < 5.0.388.0
152 Obsoletes:      chromium-browser-inspector < 15.0.863.0
153 ExclusiveArch:  %{ix86} %{x8664} arm
154 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
155
156 %define         find_lang       sh find-lang.sh %{buildroot}
157 # Usage: gyp_with BCOND_NAME [OPTION_NAME]
158 %define         gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
159
160 %if %{without debuginfo}
161 %define         _enable_debug_packages  0
162 %endif
163
164 %description
165 Chromium is an open-source browser project that aims to build a safer,
166 faster, and more stable way for all Internet users to experience the
167 web.
168
169 Chromium serves as a base for Google Chrome, which is Chromium
170 rebranded (name and logo) with very few additions such as usage
171 tracking and an auto-updater system.
172
173 %package l10n
174 Summary:        chromium-browser language packages
175 Group:          I18n
176 Requires:       %{name} = %{version}-%{release}
177
178 %description l10n
179 Chromium is an open-source browser project that aims to build a safer,
180 faster, and more stable way for all Internet users to experience the
181 web.
182
183 This package contains language packages for 50 languages:
184
185 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
186 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
187 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
188 zh-TW
189
190 %prep
191 %setup -q
192
193 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
194 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
195 . ./src/chrome/VERSION
196 ver=$MAJOR.$MINOR.$BUILD.$PATCH
197 test "$ver" = %{version}
198
199 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
200 test "$gyp_rev" = %{gyp_rev} || :
201
202 v8_ver=$(awk 'NR=1 {print $NF; exit}' src/v8/ChangeLog || :)
203
204 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
205 #echo "%{svnver}" > src/build/LASTCHANGE.in
206
207 # add chromium and pld to useragent
208 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
209 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
210     -e 's/@BUILD_DIST_NAME@/PLD/g' \
211     -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
212     < %{PATCH8} | %{__patch} -p1
213
214 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE5} > find-lang.sh
215 ln -s %{SOURCE7} src
216
217 %patch0 -p1
218 %patch1 -p1
219 %patch2 -p1
220 %patch3 -p1
221 %patch4 -p1
222 %patch5 -p1
223 %patch6 -p1
224 %patch7 -p1
225 cd src
226 %patch9 -p0
227 %{!?with_libjpegturbo:%patch11 -p0}
228 %patch15 -p1
229 %patch16 -p1
230 cd ..
231
232 cd src
233 sh -x clean-source.sh %{!?with_system_v8:v8=0} %{!?with_nacl:nacl=0} libxml=0
234
235 %build
236 cd src
237
238 %if %{with nacl}
239 rm -rf native_client/toolchain/linux_x86_newlib
240 # Make symlinks for nacl
241 cd native_client/toolchain
242 install -d linux_x86_newlib/x86_64-nacl/bin
243 install -d linux_x86_newlib/x86_64-nacl/lib
244 install -d linux_x86_newlib/x86_64-nacl/lib32
245 install -d linux_x86_newlib/x86_64-nacl/nacl/include/bits
246 install -d linux_x86_newlib/x86_64-nacl/nacl/include/machine
247 install -d linux_x86_newlib/x86_64-nacl/nacl/include/sys
248 # link newlib toolchain to glibc as well, see gentoo bug #417019
249 #ln -s linux_x86_newlib linux_x86
250 cd linux_x86_newlib/x86_64-nacl/bin
251 ln -s %{_bindir}/x86_64-nacl-gcc gcc
252 ln -s %{_bindir}/x86_64-nacl-g++ g++
253 ln -s %{_bindir}/x86_64-nacl-ar ar
254 ln -s %{_bindir}/x86_64-nacl-as as
255 ln -s %{_bindir}/x86_64-nacl-ranlib ranlib
256 ln -s %{_bindir}/x86_64-nacl-strip x86-64-nacl-strip
257 ln -s %{_bindir}/x86_64-nacl-strip strip
258 ln -s %{_prefix}/x86_64-nacl/lib/*.a ../lib/
259 ln -s %{_prefix}/x86_64-nacl/lib/32/*.a ../lib32/
260 cd ../nacl/include
261 for i in $(find %{_prefix}/x86_64-nacl/include -type f | grep -v "c++"); do
262         ln -s $i ${i#%{_prefix}/x86_64-nacl/include/}
263 done
264 cd ../../../../../..
265 %endif
266
267 test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
268 %ifarch %{ix86}
269         -Dtarget_arch=ia32 \
270 %endif
271 %ifarch %{x8664}
272         -Dtarget_arch=x64 \
273 %endif
274 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
275         -Dno_strict_aliasing=1 -Dgcc_version=44 \
276 %endif
277 %if %{with sandboxing}
278         -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
279         -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
280 %endif
281         %{!?debug:-Dwerror=} \
282         %{!?debuginfo:-Dfastbuild=1 -Dremove_webcore_debug_symbols=1} \
283         %{?with_shared_libs:-Dlibrary=shared_library} \
284         -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
285         -Dffmpeg_branding=Chrome \
286         -Dproprietary_codecs=1 \
287 %if %{with nacl}
288         %{?_:# Disable glibc Native Client toolchain, we don't need it (gentoo bug #417019).} \
289         -Ddisable_glibc=1 \
290 %else
291         -Ddisable_nacl=1 \
292 %endif
293         %{!?with_sse2:-Ddisable_sse2=1} \
294         %{?with_selinux:-Dselinux=1} \
295         %{gyp_with cups} \
296         %{gyp_with flac} \
297         %{gyp_with gconf} \
298         %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
299         %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
300         %{gyp_with pulseaudio} \
301         %{gyp_with system_libwebp} \
302         %{gyp_with system_speex} \
303         %{gyp_with system_sqlite} \
304         %{gyp_with system_v8} \
305         %{gyp_with system_vpx} \
306         %{gyp_with system_yasm} \
307         %{gyp_with system_zlib} \
308         -Duse_system_bzip2=1 \
309         -Duse_system_icu=1 \
310         -Duse_system_libevent=1 \
311         -Duse_system_libjpeg=1 \
312         -Duse_system_libpng=1 \
313         -Duse_system_libxml=1 \
314         -Duse_system_libxslt=1 \
315         -Duse_system_xdg_utils=1 \
316         %{!?with_tcmalloc:-Dlinux_use_tcmalloc=0} \
317         -Dlinux_use_gold_binary=0 \
318         -Dlinux_use_gold_flags=0
319
320 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
321         BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
322         %{?with_verbose:V=1} \
323         CC="%{__cc}" \
324         CXX="%{__cxx}" \
325         LDFLAGS="%{rpmldflags} -fuse-ld=gold" \
326         CC.host="%{__cc}" \
327         CXX.host="%{__cxx}" \
328         LDFLAGS.host="%{rpmldflags}" \
329         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
330         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
331
332 %install
333 rm -rf $RPM_BUILD_ROOT
334 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/{themes,plugins,extensions} \
335         $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/%{name},%{_mandir}/man1,%{_desktopdir}}
336
337 cd src/out/%{!?debug:Release}%{?debug:Debug}
338 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/default
339 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
340 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
341 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
342 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
343 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
344 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
345 %if %{with ffmpegsumo}
346 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
347 %endif
348 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
349
350 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/resources/extension/demo
351
352 %if %{with nacl}
353 # Install Native Client files on platforms that support it.
354 install -p nacl_helper{,_bootstrap} $RPM_BUILD_ROOT%{_libdir}/%{name}
355 install -p libppGoogleNaClPluginChrome.so $RPM_BUILD_ROOT%{_libdir}/%{name}
356 %ifarch %{x8664}
357 install -p nacl_irt_x86_64.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
358 %endif
359 %ifarch %{ix86}
360 install -p nacl_irt_x86_32.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
361 %endif
362 %endif
363
364 cd -
365
366 for icon in src/chrome/app/theme/chromium/product_logo_[0-9]*.png; do
367         size=${icon##*/product_logo_}
368         size=${size%.png}
369
370         # this will skip non-numeric (22_mono_invert, 22_mono)
371         dir=%{_iconsdir}/hicolor/${size}x${size}/apps
372         test -d "$dir" || continue
373
374         install -d $RPM_BUILD_ROOT$dir
375         cp -p $icon $RPM_BUILD_ROOT$dir/%{name}.png
376 done
377
378 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
379 # http://code.google.com/p/chromium/issues/detail?id=24507
380 gecko-mediaplayer*.so
381 EOF
382
383 # find locales
384 %find_lang %{name}.lang
385 # always package en-US
386 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
387
388 %clean
389 rm -rf $RPM_BUILD_ROOT
390
391 %post
392 %update_icon_cache hicolor
393 %update_desktop_database
394 %update_browser_plugins
395
396 %postun
397 if [ "$1" = 0 ]; then
398         %update_icon_cache hicolor
399         %update_browser_plugins
400 fi
401
402 %files -f %{name}.lang
403 %defattr(644,root,root,755)
404 %{_browserpluginsconfdir}/browsers.d/%{name}.*
405 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
406 %dir %{_sysconfdir}/%{name}
407 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default
408 %attr(755,root,root) %{_bindir}/%{name}
409 %{_mandir}/man1/%{name}.1*
410 %{_desktopdir}/*.desktop
411 %{_iconsdir}/hicolor/*/apps/%{name}.png
412 %dir %{_libdir}/%{name}
413 %{_libdir}/%{name}/chrome.pak
414 %{_libdir}/%{name}/content_resources.pak
415 %{_libdir}/%{name}/resources.pak
416 %{_libdir}/%{name}/theme_resources_standard.pak
417 %{_libdir}/%{name}/ui_resources_standard.pak
418 %dir %{_libdir}/%{name}/locales
419 %{_libdir}/%{name}/locales/en-US.pak
420 %dir %{_libdir}/%{name}/resources
421 %{_libdir}/%{name}/resources/inspector
422 %dir %{_libdir}/%{name}/themes
423 %dir %{_libdir}/%{name}/extensions
424 %dir %{_libdir}/%{name}/plugins
425 %attr(755,root,root) %{_libdir}/%{name}/%{name}
426 # These unique permissions are intentional and necessary for the sandboxing
427 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
428
429 # ffmpeg libs
430 %if %{with ffmpegsumo}
431 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
432 %endif
433
434 %if %{with nacl}
435 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
436 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
437 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
438 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
439 %endif
440
441 %files l10n -f %{name}.lang
442 %defattr(644,root,root,755)
This page took 0.098611 seconds and 3 git commands to generate.