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