Gentoo Archives: gentoo-commits

From: "PaweA Hajdan (phajdan.jr)" <phajdan.jr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-client/chromium: ChangeLog chromium-45.0.2454.15-r1.ebuild chromium-46.0.2467.2.ebuild chromium-45.0.2438.3.ebuild chromium-45.0.2438.3-r1.ebuild
Date: Fri, 31 Jul 2015 16:25:06
Message-Id: 20150731162500.1DC5FBF@oystercatcher.gentoo.org
1 phajdan.jr 15/07/31 16:25:00
2
3 Modified: ChangeLog
4 Added: chromium-45.0.2454.15-r1.ebuild
5 chromium-46.0.2467.2.ebuild
6 Removed: chromium-45.0.2438.3.ebuild
7 chromium-45.0.2438.3-r1.ebuild
8 Log:
9 Dev channel bump. Use bundled libsrtp (bug #459932 by Andrius Stikonas). Remove old.
10
11 (Portage version: 2.2.14/cvs/Linux i686, signed Manifest commit with key 0x4F1A2555EA71991D!)
12
13 Revision Changes Path
14 1.1272 www-client/chromium/ChangeLog
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?rev=1.1272&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?rev=1.1272&content-type=text/plain
18 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?r1=1.1271&r2=1.1272
19
20 Index: ChangeLog
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v
23 retrieving revision 1.1271
24 retrieving revision 1.1272
25 diff -u -r1.1271 -r1.1272
26 --- ChangeLog 25 Jul 2015 09:25:50 -0000 1.1271
27 +++ ChangeLog 31 Jul 2015 16:25:00 -0000 1.1272
28 @@ -1,6 +1,15 @@
29 # ChangeLog for www-client/chromium
30 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
31 -# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.1271 2015/07/25 09:25:50 phajdan.jr Exp $
32 +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.1272 2015/07/31 16:25:00 phajdan.jr Exp $
33 +
34 +*chromium-46.0.2467.2 (31 Jul 2015)
35 +*chromium-45.0.2454.15-r1 (31 Jul 2015)
36 +
37 + 31 Jul 2015; Pawel Hajdan jr <phajdan.jr@g.o>
38 + -chromium-45.0.2438.3.ebuild, -chromium-45.0.2438.3-r1.ebuild,
39 + +chromium-45.0.2454.15-r1.ebuild, +chromium-46.0.2467.2.ebuild:
40 + Dev channel bump. Use bundled libsrtp (bug #459932 by Andrius Stikonas).
41 + Remove old.
42
43 *chromium-45.0.2454.15 (25 Jul 2015)
44
45
46
47
48 1.1 www-client/chromium/chromium-45.0.2454.15-r1.ebuild
49
50 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-45.0.2454.15-r1.ebuild?rev=1.1&view=markup
51 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-45.0.2454.15-r1.ebuild?rev=1.1&content-type=text/plain
52
53 Index: chromium-45.0.2454.15-r1.ebuild
54 ===================================================================
55 # Copyright 1999-2015 Gentoo Foundation
56 # Distributed under the terms of the GNU General Public License v2
57 # $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-45.0.2454.15-r1.ebuild,v 1.1 2015/07/31 16:25:00 phajdan.jr Exp $
58
59 EAPI="5"
60 PYTHON_COMPAT=( python2_7 )
61
62 CHROMIUM_LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he
63 hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt_BR pt_PT ro ru sk sl sr
64 sv sw ta te th tr uk vi zh_CN zh_TW"
65
66 inherit check-reqs chromium eutils flag-o-matic multilib multiprocessing pax-utils \
67 portability python-any-r1 readme.gentoo toolchain-funcs versionator virtualx
68
69 DESCRIPTION="Open-source version of Google Chrome web browser"
70 HOMEPAGE="http://chromium.org/"
71 SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}-lite.tar.xz"
72
73 LICENSE="BSD hotwording? ( no-source-code )"
74 SLOT="0"
75 KEYWORDS="~amd64 ~arm ~x86"
76 IUSE="cups gnome gnome-keyring hidpi hotwording kerberos neon pic +proprietary-codecs pulseaudio selinux +tcmalloc"
77 RESTRICT="proprietary-codecs? ( bindist )"
78
79 # Native Client binaries are compiled with different set of flags, bug #452066.
80 QA_FLAGS_IGNORED=".*\.nexe"
81
82 # Native Client binaries may be stripped by the build system, which uses the
83 # right tools for it, bug #469144 .
84 QA_PRESTRIPPED=".*\.nexe"
85
86 RDEPEND=">=app-accessibility/speech-dispatcher-0.8:=
87 app-arch/bzip2:=
88 app-arch/snappy:=
89 cups? ( >=net-print/cups-1.3.11:= )
90 >=dev-libs/elfutils-0.149
91 dev-libs/expat:=
92 dev-libs/glib:=
93 >=dev-libs/icu-55.1:=
94 >=dev-libs/jsoncpp-0.5.0-r1:=
95 >=dev-libs/libevent-1.4.13:=
96 dev-libs/libxml2:=[icu]
97 dev-libs/libxslt:=
98 dev-libs/nspr:=
99 >=dev-libs/nss-3.14.3:=
100 dev-libs/re2:=
101 gnome? ( >=gnome-base/gconf-2.24.0:= )
102 gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
103 >=media-libs/alsa-lib-1.0.19:=
104 media-libs/flac:=
105 media-libs/fontconfig:=
106 media-libs/freetype:=
107 media-libs/harfbuzz:=[icu(+)]
108 media-libs/libexif:=
109 >=media-libs/libjpeg-turbo-1.2.0-r1:=
110 media-libs/libpng:0=
111 >=media-libs/libwebp-0.4.0:=
112 media-libs/speex:=
113 pulseaudio? ( media-sound/pulseaudio:= )
114 sys-apps/dbus:=
115 sys-apps/pciutils:=
116 >=sys-libs/libcap-2.22:=
117 sys-libs/zlib:=[minizip]
118 virtual/udev
119 x11-libs/cairo:=
120 x11-libs/gdk-pixbuf:=
121 x11-libs/gtk+:2=
122 x11-libs/libdrm
123 x11-libs/libX11:=
124 x11-libs/libXcomposite:=
125 x11-libs/libXcursor:=
126 x11-libs/libXdamage:=
127 x11-libs/libXext:=
128 x11-libs/libXfixes:=
129 >=x11-libs/libXi-1.6.0:=
130 x11-libs/libXinerama:=
131 x11-libs/libXrandr:=
132 x11-libs/libXrender:=
133 x11-libs/libXScrnSaver:=
134 x11-libs/libXtst:=
135 x11-libs/pango:=
136 kerberos? ( virtual/krb5 )"
137 DEPEND="${RDEPEND}
138 !arm? (
139 dev-lang/yasm
140 )
141 dev-lang/perl
142 dev-perl/JSON
143 >=dev-util/gperf-3.0.3
144 dev-util/ninja
145 sys-apps/hwids[usb(+)]
146 >=sys-devel/bison-2.4.3
147 sys-devel/flex
148 virtual/pkgconfig"
149
150 # For nvidia-drivers blocker, see bug #413637 .
151 RDEPEND+="
152 !=www-client/chromium-9999
153 !<www-plugins/chrome-binary-plugins-37
154 x11-misc/xdg-utils
155 virtual/opengl
156 virtual/ttf-fonts
157 selinux? ( sec-policy/selinux-chromium )
158 tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )"
159
160 # Python dependencies. The DEPEND part needs to be kept in sync
161 # with python_check_deps.
162 DEPEND+=" $(python_gen_any_dep '
163 dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
164 dev-python/jinja[${PYTHON_USEDEP}]
165 dev-python/ply[${PYTHON_USEDEP}]
166 dev-python/simplejson[${PYTHON_USEDEP}]
167 ')"
168 python_check_deps() {
169 has_version "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" && \
170 has_version "dev-python/jinja[${PYTHON_USEDEP}]" && \
171 has_version "dev-python/ply[${PYTHON_USEDEP}]" && \
172 has_version "dev-python/simplejson[${PYTHON_USEDEP}]"
173 }
174
175 if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
176 EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
177 fi
178
179 DISABLE_AUTOFORMATTING="yes"
180 DOC_CONTENTS="
181 Some web pages may require additional fonts to display properly.
182 Try installing some of the following packages if some characters
183 are not displayed properly:
184 - media-fonts/arphicfonts
185 - media-fonts/bitstream-cyberbit
186 - media-fonts/droid
187 - media-fonts/ipamonafont
188 - media-fonts/ja-ipafonts
189 - media-fonts/takao-fonts
190 - media-fonts/wqy-microhei
191 - media-fonts/wqy-zenhei
192
193 Depending on your desktop environment, you may need
194 to install additional packages to get icons on the Downloads page.
195
196 For KDE, the required package is kde-apps/oxygen-icons.
197
198 For other desktop environments, try one of the following:
199 - x11-themes/gnome-icon-theme
200 - x11-themes/tango-icon-theme
201 "
202
203 pkg_pretend() {
204 if [[ $(tc-getCC)$ == *gcc* ]] && \
205 [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
206 die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
207 fi
208
209 # Check build requirements, bug #541816 and bug #471810 .
210 CHECKREQS_MEMORY="3G"
211 CHECKREQS_DISK_BUILD="5G"
212 eshopts_push -s extglob
213 if is-flagq '-g?(gdb)?([1-9])'; then
214 CHECKREQS_DISK_BUILD="25G"
215 fi
216 eshopts_pop
217 check-reqs_pkg_pretend
218 }
219
220 pkg_setup() {
221 if [[ "${SLOT}" == "0" ]]; then
222 CHROMIUM_SUFFIX=""
223 else
224 CHROMIUM_SUFFIX="-${SLOT}"
225 fi
226 CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
227
228 # Make sure the build system will use the right python, bug #344367.
229 python-any-r1_pkg_setup
230
231 chromium_suid_sandbox_check_kernel_config
232 }
233
234 src_prepare() {
235 # if ! use arm; then
236 # mkdir -p out/Release/gen/sdk/toolchain || die
237 # # Do not preserve SELinux context, bug #460892 .
238 # cp -a --no-preserve=context /usr/$(get_libdir)/nacl-toolchain-newlib \
239 # out/Release/gen/sdk/toolchain/linux_x86_newlib || die
240 # touch out/Release/gen/sdk/toolchain/linux_x86_newlib/stamp.untar || die
241 # fi
242
243 epatch "${FILESDIR}/${PN}-system-jinja-r7.patch"
244
245 epatch_user
246
247 # Remove most bundled libraries. Some are still needed.
248 build/linux/unbundle/remove_bundled_libraries.py \
249 'base/third_party/dmg_fp' \
250 'base/third_party/dynamic_annotations' \
251 'base/third_party/icu' \
252 'base/third_party/nspr' \
253 'base/third_party/superfasthash' \
254 'base/third_party/symbolize' \
255 'base/third_party/valgrind' \
256 'base/third_party/xdg_mime' \
257 'base/third_party/xdg_user_dirs' \
258 'breakpad/src/third_party/curl' \
259 'chrome/third_party/mozilla_security_manager' \
260 'courgette/third_party' \
261 'crypto/third_party/nss' \
262 'net/third_party/mozilla_security_manager' \
263 'net/third_party/nss' \
264 'third_party/WebKit' \
265 'third_party/analytics' \
266 'third_party/angle' \
267 'third_party/angle/src/third_party/compiler' \
268 'third_party/boringssl' \
269 'third_party/brotli' \
270 'third_party/cacheinvalidation' \
271 'third_party/cld_2' \
272 'third_party/cros_system_api' \
273 'third_party/cython/python_flags.py' \
274 'third_party/devscripts' \
275 'third_party/dom_distiller_js' \
276 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \
277 'third_party/ffmpeg' \
278 'third_party/fips181' \
279 'third_party/flot' \
280 'third_party/google_input_tools' \
281 'third_party/google_input_tools/third_party/closure_library' \
282 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
283 'third_party/hunspell' \
284 'third_party/iccjpeg' \
285 'third_party/jstemplate' \
286 'third_party/khronos' \
287 'third_party/leveldatabase' \
288 'third_party/libXNVCtrl' \
289 'third_party/libaddressinput' \
290 'third_party/libjingle' \
291 'third_party/libphonenumber' \
292 'third_party/libsecret' \
293 'third_party/libsrtp' \
294 'third_party/libudev' \
295 'third_party/libusb' \
296 'third_party/libvpx' \
297 'third_party/libvpx/source/libvpx/third_party/x86inc' \
298 'third_party/libxml/chromium' \
299 'third_party/libyuv' \
300 'third_party/lss' \
301 'third_party/lzma_sdk' \
302 'third_party/mesa' \
303 'third_party/modp_b64' \
304 'third_party/mojo' \
305 'third_party/mt19937ar' \
306 'third_party/npapi' \
307 'third_party/openmax_dl' \
308 'third_party/opus' \
309 'third_party/ots' \
310 'third_party/pdfium' \
311 'third_party/pdfium/third_party/agg23' \
312 'third_party/pdfium/third_party/base' \
313 'third_party/pdfium/third_party/bigint' \
314 'third_party/pdfium/third_party/freetype' \
315 'third_party/pdfium/third_party/lcms2-2.6' \
316 'third_party/pdfium/third_party/libjpeg' \
317 'third_party/pdfium/third_party/libopenjpeg20' \
318 'third_party/pdfium/third_party/zlib_v128' \
319 'third_party/polymer' \
320 'third_party/protobuf' \
321 'third_party/qcms' \
322 'third_party/readability' \
323 'third_party/sfntly' \
324 'third_party/skia' \
325 'third_party/smhasher' \
326 'third_party/sqlite' \
327 'third_party/tcmalloc' \
328 'third_party/trace-viewer' \
329 'third_party/trace-viewer/tracing/third_party/components/polymer' \
330 'third_party/trace-viewer/tracing/third_party/d3' \
331 'third_party/trace-viewer/tracing/third_party/gl-matrix' \
332 'third_party/trace-viewer/tracing/third_party/jszip' \
333 'third_party/trace-viewer/tracing/third_party/tvcm' \
334 'third_party/trace-viewer/tracing/third_party/tvcm/third_party/beautifulsoup/polymer_soup.py' \
335 'third_party/trace-viewer/tracing/third_party/tvcm/third_party/rcssmin' \
336 'third_party/trace-viewer/tracing/third_party/tvcm/third_party/rjsmin' \
337 'third_party/usrsctp' \
338 'third_party/web-animations-js' \
339 'third_party/webdriver' \
340 'third_party/webrtc' \
341 'third_party/widevine' \
342 'third_party/x86inc' \
343 'third_party/zlib/google' \
344 'url/third_party/mozilla' \
345 'v8/src/third_party/fdlibm' \
346 'v8/src/third_party/valgrind' \
347 --do-remove || die
348 }
349
350 src_configure() {
351 local myconf=""
352
353 # Never tell the build system to "enable" SSE2, it has a few unexpected
354 # additions, bug #336871.
355 myconf+=" -Ddisable_sse2=1"
356
357 # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
358 myconf+=" -Ddisable_nacl=1"
359
360 # Disable glibc Native Client toolchain, we don't need it (bug #417019).
361 # myconf+=" -Ddisable_glibc=1"
362
363 # TODO: also build with pnacl
364 # myconf+=" -Ddisable_pnacl=1"
365
366 # It would be awkward for us to tar the toolchain and get it untarred again
367 # during the build.
368 # myconf+=" -Ddisable_newlib_untar=1"
369
370 # Make it possible to remove third_party/adobe.
371 echo > "${T}/flapper_version.h" || die
372 myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h"
373
374 # Use system-provided libraries.
375 # TODO: use_system_hunspell (upstream changes needed).
376 # TODO: use_system_libsrtp (bug #459932).
377 # TODO: use_system_libusb (http://crbug.com/266149).
378 # TODO: use_system_libvpx (http://crbug.com/494939).
379 # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
380 # TODO: use_system_protobuf (bug #525560).
381 # TODO: use_system_ssl (http://crbug.com/58087).
382 # TODO: use_system_sqlite (http://crbug.com/22208).
383 myconf+="
384 -Duse_system_bzip2=1
385 -Duse_system_flac=1
386 -Duse_system_harfbuzz=1
387 -Duse_system_icu=1
388 -Duse_system_jsoncpp=1
389 -Duse_system_libevent=1
390 -Duse_system_libjpeg=1
391 -Duse_system_libpng=1
392 -Duse_system_libwebp=1
393 -Duse_system_libxml=1
394 -Duse_system_libxslt=1
395 -Duse_system_minizip=1
396 -Duse_system_nspr=1
397 -Duse_system_re2=1
398 -Duse_system_snappy=1
399 -Duse_system_speex=1
400 -Duse_system_xdg_utils=1
401 -Duse_system_zlib=1"
402
403 # Needed for system icu - we don't need additional data files.
404 myconf+=" -Dicu_use_data_file_flag=0"
405
406 # TODO: patch gyp so that this arm conditional is not needed.
407 if ! use arm; then
408 myconf+="
409 -Duse_system_yasm=1"
410 fi
411
412 # Optional dependencies.
413 # TODO: linux_link_kerberos, bug #381289.
414 myconf+="
415 $(gyp_use cups)
416 $(gyp_use gnome use_gconf)
417 $(gyp_use gnome-keyring use_gnome_keyring)
418 $(gyp_use gnome-keyring linux_link_gnome_keyring)
419 $(gyp_use hidpi enable_hidpi)
420 $(gyp_use hotwording enable_hotwording)
421 $(gyp_use kerberos)
422 $(gyp_use pulseaudio)
423 $(gyp_use tcmalloc use_allocator tcmalloc none)"
424
425 # Use explicit library dependencies instead of dlopen.
426 # This makes breakages easier to detect by revdep-rebuild.
427 myconf+="
428 -Dlinux_link_gsettings=1
429 -Dlinux_link_libpci=1
430 -Dlinux_link_libspeechd=1
431 -Dlibspeechd_h_prefix=speech-dispatcher/"
432
433 # TODO: use the file at run time instead of effectively compiling it in.
434 myconf+="
435 -Dusb_ids_path=/usr/share/misc/usb.ids"
436
437 # Save space by removing DLOG and DCHECK messages (about 6% reduction).
438 myconf+="
439 -Dlogging_like_official_build=1"
440
441 if [[ $(tc-getCC) == *clang* ]]; then
442 myconf+=" -Dclang=1"
443 else
444 myconf+=" -Dclang=0"
445 fi
446
447 # Never use bundled gold binary. Disable gold linker flags for now.
448 # Do not use bundled clang.
449 myconf+="
450 -Dclang_use_chrome_plugins=0
451 -Dhost_clang=0
452 -Dlinux_use_bundled_binutils=0
453 -Dlinux_use_bundled_gold=0
454 -Dlinux_use_gold_flags=0"
455
456 ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
457 myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
458
459 # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
460 # Note: these are for Gentoo use ONLY. For your own distribution,
461 # please get your own set of keys. Feel free to contact chromium@g.o
462 # for more info.
463 myconf+=" -Dgoogle_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
464 -Dgoogle_default_client_id=329227923882.apps.googleusercontent.com
465 -Dgoogle_default_client_secret=vgKG0NNv7GoDpbtoFNLxCUXu"
466
467 local myarch="$(tc-arch)"
468 if [[ $myarch = amd64 ]] ; then
469 target_arch=x64
470 ffmpeg_target_arch=x64
471 elif [[ $myarch = x86 ]] ; then
472 target_arch=ia32
473 ffmpeg_target_arch=ia32
474 elif [[ $myarch = arm ]] ; then
475 target_arch=arm
476 ffmpeg_target_arch=$(usex neon arm-neon arm)
477 # TODO: re-enable NaCl (NativeClient).
478 local CTARGET=${CTARGET:-${CHOST}}
479 if [[ $(tc-is-softfloat) == "no" ]]; then
480
481 myconf+=" -Darm_float_abi=hard"
482 fi
483 filter-flags "-mfpu=*"
484 use neon || myconf+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
485
486 if [[ ${CTARGET} == armv[78]* ]]; then
487 myconf+=" -Darmv7=1"
488 else
489 myconf+=" -Darmv7=0"
490 fi
491 myconf+=" -Dsysroot=
492 $(gyp_use neon arm_neon)
493 -Ddisable_nacl=1"
494 else
495 die "Failed to determine target arch, got '$myarch'."
496 fi
497
498 myconf+=" -Dtarget_arch=${target_arch}"
499
500 # Make sure that -Werror doesn't get added to CFLAGS by the build system.
501 # Depending on GCC version the warnings are different and we don't want
502 # the build to fail because of that.
503 myconf+=" -Dwerror="
504
505 # Disable fatal linker warnings, bug 506268.
506 myconf+=" -Ddisable_fatal_linker_warnings=1"
507
508 # Avoid CFLAGS problems, bug #352457, bug #390147.
509 if ! use custom-cflags; then
510 replace-flags "-Os" "-O2"
511 strip-flags
512
513 # Prevent linker from running out of address space, bug #471810 .
514 if use x86; then
515 filter-flags "-g*"
516 fi
517
518 # Prevent libvpx build failures. Bug 530248, 544702, 546984.
519 if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
520 filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx2
521 fi
522 fi
523
524 # Make sure the build system will use the right tools, bug #340795.
525 tc-export AR CC CXX RANLIB
526
527 # Tools for building programs to be executed on the build system, bug #410883.
528 export AR_host=$(tc-getBUILD_AR)
529 export CC_host=$(tc-getBUILD_CC)
530 export CXX_host=$(tc-getBUILD_CXX)
531 export LD_host=${CXX_host}
532
533 # Bug 491582.
534 export TMPDIR="${WORKDIR}/temp"
535 mkdir -m 755 "${TMPDIR}" || die
536
537 local build_ffmpeg_args=""
538 if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
539 build_ffmpeg_args+=" --disable-asm"
540 fi
541
542 # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
543 einfo "Configuring bundled ffmpeg..."
544 pushd third_party/ffmpeg > /dev/null || die
545 chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
546 --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
547 chromium/scripts/copy_config.sh || die
548 chromium/scripts/generate_gyp.py || die
549 popd > /dev/null || die
550
551 third_party/libaddressinput/chromium/tools/update-strings.py || die
552
553 einfo "Configuring Chromium..."
554 build/linux/unbundle/replace_gyp_files.py ${myconf} || die
555 egyp_chromium ${myconf} || die
556 }
557
558 eninja() {
559 if [[ -z ${NINJAOPTS+set} ]]; then
560 local jobs=$(makeopts_jobs)
561 local loadavg=$(makeopts_loadavg)
562
563 if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
564 NINJAOPTS+=" -j ${jobs}"
565 fi
566 if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
567 NINJAOPTS+=" -l ${loadavg}"
568 fi
569 fi
570 set -- ninja -v ${NINJAOPTS} "$@"
571 echo "$@"
572 "$@"
573 }
574
575 src_compile() {
576 local ninja_targets="chrome chrome_sandbox chromedriver"
577
578 # Build mksnapshot and pax-mark it.
579 eninja -C out/Release mksnapshot || die
580 pax-mark m out/Release/mksnapshot
581
582 # Even though ninja autodetects number of CPUs, we respect
583 # user's options, for debugging with -j 1 or any other reason.
584 eninja -C out/Release ${ninja_targets} || die
585
586 pax-mark m out/Release/chrome
587 }
588
589 src_install() {
590 exeinto "${CHROMIUM_HOME}"
591 doexe out/Release/chrome || die
592
593 newexe out/Release/chrome_sandbox chrome-sandbox || die
594 fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
595
596 doexe out/Release/chromedriver || die
597
598 # if ! use arm; then
599 # doexe out/Release/nacl_helper{,_bootstrap} || die
600 # insinto "${CHROMIUM_HOME}"
601 # doins out/Release/nacl_irt_*.nexe || die
602 # doins out/Release/libppGoogleNaClPluginChrome.so || die
603 # fi
604
605 local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
606 if [[ -n ${CHROMIUM_SUFFIX} ]]; then
607 sedargs+=(
608 -e "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g"
609 -e "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g"
610 -e "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:"
611 )
612 fi
613 sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
614 doexe chromium-launcher.sh
615
616 # It is important that we name the target "chromium-browser",
617 # xdg-utils expect it; bug #355517.
618 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
619 # keep the old symlink around for consistency
620 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
621
622 dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${CHROMIUM_SUFFIX} || die
623
624 # Allow users to override command-line options, bug #357629.
625 dodir /etc/chromium || die
626 insinto /etc/chromium
627 newins "${FILESDIR}/chromium.default" "default" || die
628
629 pushd out/Release/locales > /dev/null || die
630 chromium_remove_language_paks
631 popd
632
633 insinto "${CHROMIUM_HOME}"
634 doins out/Release/*.bin || die
635 doins out/Release/*.pak || die
636
637 doins -r out/Release/locales || die
638 doins -r out/Release/resources || die
639
640 newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
641 newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
642
643 # Install icons and desktop entry.
644 local branding size
645 for size in 16 22 24 32 48 64 128 256 ; do
646 case ${size} in
647 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
648 *) branding="chrome/app/theme/chromium" ;;
649 esac
650 newicon -s ${size} "${branding}/product_logo_${size}.png" \
651 chromium-browser${CHROMIUM_SUFFIX}.png
652 done
653
654 local mime_types="text/html;text/xml;application/xhtml+xml;"
655 mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
656 mime_types+="x-scheme-handler/ftp;" # bug #412185
657 mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
658 make_desktop_entry \
659 chromium-browser${CHROMIUM_SUFFIX} \
660 "Chromium${CHROMIUM_SUFFIX}" \
661 chromium-browser${CHROMIUM_SUFFIX} \
662 "Network;WebBrowser" \
663 "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
664 sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
665
666 # Install GNOME default application entry (bug #303100).
667 if use gnome; then
668 dodir /usr/share/gnome-control-center/default-apps || die
669 insinto /usr/share/gnome-control-center/default-apps
670 newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
671 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
672 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
673 "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
674 fi
675 fi
676
677 readme.gentoo_create_doc
678 }
679
680 pkg_postinst() {
681 fdo-mime_desktop_database_update
682 gnome2_icon_cache_update
683 readme.gentoo_print_elog
684 }
685
686
687
688 1.1 www-client/chromium/chromium-46.0.2467.2.ebuild
689
690 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-46.0.2467.2.ebuild?rev=1.1&view=markup
691 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-46.0.2467.2.ebuild?rev=1.1&content-type=text/plain
692
693 Index: chromium-46.0.2467.2.ebuild
694 ===================================================================
695 # Copyright 1999-2015 Gentoo Foundation
696 # Distributed under the terms of the GNU General Public License v2
697 # $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-46.0.2467.2.ebuild,v 1.1 2015/07/31 16:25:00 phajdan.jr Exp $
698
699 EAPI="5"
700 PYTHON_COMPAT=( python2_7 )
701
702 CHROMIUM_LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he
703 hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt_BR pt_PT ro ru sk sl sr
704 sv sw ta te th tr uk vi zh_CN zh_TW"
705
706 inherit check-reqs chromium eutils flag-o-matic multilib multiprocessing pax-utils \
707 portability python-any-r1 readme.gentoo toolchain-funcs versionator virtualx
708
709 DESCRIPTION="Open-source version of Google Chrome web browser"
710 HOMEPAGE="http://chromium.org/"
711 SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}-lite.tar.xz"
712
713 LICENSE="BSD hotwording? ( no-source-code )"
714 SLOT="0"
715 KEYWORDS="~amd64 ~arm ~x86"
716 IUSE="cups gnome gnome-keyring hidpi hotwording kerberos neon pic +proprietary-codecs pulseaudio selinux +tcmalloc"
717 RESTRICT="proprietary-codecs? ( bindist )"
718
719 # Native Client binaries are compiled with different set of flags, bug #452066.
720 QA_FLAGS_IGNORED=".*\.nexe"
721
722 # Native Client binaries may be stripped by the build system, which uses the
723 # right tools for it, bug #469144 .
724 QA_PRESTRIPPED=".*\.nexe"
725
726 RDEPEND=">=app-accessibility/speech-dispatcher-0.8:=
727 app-arch/bzip2:=
728 app-arch/snappy:=
729 cups? ( >=net-print/cups-1.3.11:= )
730 >=dev-libs/elfutils-0.149
731 dev-libs/expat:=
732 dev-libs/glib:=
733 >=dev-libs/icu-55.1:=
734 >=dev-libs/jsoncpp-0.5.0-r1:=
735 >=dev-libs/libevent-1.4.13:=
736 dev-libs/libxml2:=[icu]
737 dev-libs/libxslt:=
738 dev-libs/nspr:=
739 >=dev-libs/nss-3.14.3:=
740 dev-libs/re2:=
741 gnome? ( >=gnome-base/gconf-2.24.0:= )
742 gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
743 >=media-libs/alsa-lib-1.0.19:=
744 media-libs/flac:=
745 media-libs/fontconfig:=
746 media-libs/freetype:=
747 media-libs/harfbuzz:=[icu(+)]
748 media-libs/libexif:=
749 >=media-libs/libjpeg-turbo-1.2.0-r1:=
750 media-libs/libpng:0=
751 >=media-libs/libwebp-0.4.0:=
752 media-libs/speex:=
753 pulseaudio? ( media-sound/pulseaudio:= )
754 sys-apps/dbus:=
755 sys-apps/pciutils:=
756 >=sys-libs/libcap-2.22:=
757 sys-libs/zlib:=[minizip]
758 virtual/udev
759 x11-libs/cairo:=
760 x11-libs/gdk-pixbuf:=
761 x11-libs/gtk+:2=
762 x11-libs/libdrm
763 x11-libs/libX11:=
764 x11-libs/libXcomposite:=
765 x11-libs/libXcursor:=
766 x11-libs/libXdamage:=
767 x11-libs/libXext:=
768 x11-libs/libXfixes:=
769 >=x11-libs/libXi-1.6.0:=
770 x11-libs/libXinerama:=
771 x11-libs/libXrandr:=
772 x11-libs/libXrender:=
773 x11-libs/libXScrnSaver:=
774 x11-libs/libXtst:=
775 x11-libs/pango:=
776 kerberos? ( virtual/krb5 )"
777 DEPEND="${RDEPEND}
778 !arm? (
779 dev-lang/yasm
780 )
781 dev-lang/perl
782 dev-perl/JSON
783 >=dev-util/gperf-3.0.3
784 dev-util/ninja
785 sys-apps/hwids[usb(+)]
786 >=sys-devel/bison-2.4.3
787 sys-devel/flex
788 virtual/pkgconfig"
789
790 # For nvidia-drivers blocker, see bug #413637 .
791 RDEPEND+="
792 !=www-client/chromium-9999
793 !<www-plugins/chrome-binary-plugins-37
794 x11-misc/xdg-utils
795 virtual/opengl
796 virtual/ttf-fonts
797 selinux? ( sec-policy/selinux-chromium )
798 tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )"
799
800 # Python dependencies. The DEPEND part needs to be kept in sync
801 # with python_check_deps.
802 DEPEND+=" $(python_gen_any_dep '
803 dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
804 dev-python/jinja[${PYTHON_USEDEP}]
805 dev-python/ply[${PYTHON_USEDEP}]
806 dev-python/simplejson[${PYTHON_USEDEP}]
807 ')"
808 python_check_deps() {
809 has_version "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" && \
810 has_version "dev-python/jinja[${PYTHON_USEDEP}]" && \
811 has_version "dev-python/ply[${PYTHON_USEDEP}]" && \
812 has_version "dev-python/simplejson[${PYTHON_USEDEP}]"
813 }
814
815 if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
816 EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
817 fi
818
819 DISABLE_AUTOFORMATTING="yes"
820 DOC_CONTENTS="
821 Some web pages may require additional fonts to display properly.
822 Try installing some of the following packages if some characters
823 are not displayed properly:
824 - media-fonts/arphicfonts
825 - media-fonts/bitstream-cyberbit
826 - media-fonts/droid
827 - media-fonts/ipamonafont
828 - media-fonts/ja-ipafonts
829 - media-fonts/takao-fonts
830 - media-fonts/wqy-microhei
831 - media-fonts/wqy-zenhei
832
833 Depending on your desktop environment, you may need
834 to install additional packages to get icons on the Downloads page.
835
836 For KDE, the required package is kde-apps/oxygen-icons.
837
838 For other desktop environments, try one of the following:
839 - x11-themes/gnome-icon-theme
840 - x11-themes/tango-icon-theme
841 "
842
843 pkg_pretend() {
844 if [[ $(tc-getCC)$ == *gcc* ]] && \
845 [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
846 die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
847 fi
848
849 # Check build requirements, bug #541816 and bug #471810 .
850 CHECKREQS_MEMORY="3G"
851 CHECKREQS_DISK_BUILD="5G"
852 eshopts_push -s extglob
853 if is-flagq '-g?(gdb)?([1-9])'; then
854 CHECKREQS_DISK_BUILD="25G"
855 fi
856 eshopts_pop
857 check-reqs_pkg_pretend
858 }
859
860 pkg_setup() {
861 if [[ "${SLOT}" == "0" ]]; then
862 CHROMIUM_SUFFIX=""
863 else
864 CHROMIUM_SUFFIX="-${SLOT}"
865 fi
866 CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
867
868 # Make sure the build system will use the right python, bug #344367.
869 python-any-r1_pkg_setup
870
871 chromium_suid_sandbox_check_kernel_config
872 }
873
874 src_prepare() {
875 # if ! use arm; then
876 # mkdir -p out/Release/gen/sdk/toolchain || die
877 # # Do not preserve SELinux context, bug #460892 .
878 # cp -a --no-preserve=context /usr/$(get_libdir)/nacl-toolchain-newlib \
879 # out/Release/gen/sdk/toolchain/linux_x86_newlib || die
880 # touch out/Release/gen/sdk/toolchain/linux_x86_newlib/stamp.untar || die
881 # fi
882
883 epatch "${FILESDIR}/${PN}-system-jinja-r7.patch"
884
885 epatch_user
886
887 # Remove most bundled libraries. Some are still needed.
888 build/linux/unbundle/remove_bundled_libraries.py \
889 'base/third_party/dmg_fp' \
890 'base/third_party/dynamic_annotations' \
891 'base/third_party/icu' \
892 'base/third_party/nspr' \
893 'base/third_party/superfasthash' \
894 'base/third_party/symbolize' \
895 'base/third_party/valgrind' \
896 'base/third_party/xdg_mime' \
897 'base/third_party/xdg_user_dirs' \
898 'breakpad/src/third_party/curl' \
899 'chrome/third_party/mozilla_security_manager' \
900 'courgette/third_party' \
901 'crypto/third_party/nss' \
902 'net/third_party/mozilla_security_manager' \
903 'net/third_party/nss' \
904 'third_party/WebKit' \
905 'third_party/analytics' \
906 'third_party/angle' \
907 'third_party/angle/src/third_party/compiler' \
908 'third_party/boringssl' \
909 'third_party/brotli' \
910 'third_party/cacheinvalidation' \
911 'third_party/cld_2' \
912 'third_party/cros_system_api' \
913 'third_party/cython/python_flags.py' \
914 'third_party/devscripts' \
915 'third_party/dom_distiller_js' \
916 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \
917 'third_party/ffmpeg' \
918 'third_party/fips181' \
919 'third_party/flot' \
920 'third_party/google_input_tools' \
921 'third_party/google_input_tools/third_party/closure_library' \
922 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
923 'third_party/hunspell' \
924 'third_party/iccjpeg' \
925 'third_party/jstemplate' \
926 'third_party/khronos' \
927 'third_party/leveldatabase' \
928 'third_party/libXNVCtrl' \
929 'third_party/libaddressinput' \
930 'third_party/libjingle' \
931 'third_party/libphonenumber' \
932 'third_party/libsecret' \
933 'third_party/libsrtp' \
934 'third_party/libudev' \
935 'third_party/libusb' \
936 'third_party/libvpx' \
937 'third_party/libvpx/source/libvpx/third_party/x86inc' \
938 'third_party/libxml/chromium' \
939 'third_party/libwebm' \
940 'third_party/libyuv' \
941 'third_party/lss' \
942 'third_party/lzma_sdk' \
943 'third_party/mesa' \
944 'third_party/modp_b64' \
945 'third_party/mojo' \
946 'third_party/mt19937ar' \
947 'third_party/npapi' \
948 'third_party/openmax_dl' \
949 'third_party/opus' \
950 'third_party/ots' \
951 'third_party/pdfium' \
952 'third_party/pdfium/third_party/agg23' \
953 'third_party/pdfium/third_party/base' \
954 'third_party/pdfium/third_party/bigint' \
955 'third_party/pdfium/third_party/freetype' \
956 'third_party/pdfium/third_party/lcms2-2.6' \
957 'third_party/pdfium/third_party/libjpeg' \
958 'third_party/pdfium/third_party/libopenjpeg20' \
959 'third_party/pdfium/third_party/zlib_v128' \
960 'third_party/polymer' \
961 'third_party/protobuf' \
962 'third_party/qcms' \
963 'third_party/readability' \
964 'third_party/sfntly' \
965 'third_party/skia' \
966 'third_party/smhasher' \
967 'third_party/sqlite' \
968 'third_party/tcmalloc' \
969 'third_party/trace-viewer' \
970 'third_party/trace-viewer/tracing/third_party/components/polymer' \
971 'third_party/trace-viewer/tracing/third_party/d3' \
972 'third_party/trace-viewer/tracing/third_party/gl-matrix' \
973 'third_party/trace-viewer/tracing/third_party/jszip' \
974 'third_party/trace-viewer/tracing/third_party/tvcm' \
975 'third_party/trace-viewer/tracing/third_party/tvcm/third_party/beautifulsoup/polymer_soup.py' \
976 'third_party/trace-viewer/tracing/third_party/tvcm/third_party/rcssmin' \
977 'third_party/trace-viewer/tracing/third_party/tvcm/third_party/rjsmin' \
978 'third_party/usrsctp' \
979 'third_party/web-animations-js' \
980 'third_party/webdriver' \
981 'third_party/webrtc' \
982 'third_party/widevine' \
983 'third_party/x86inc' \
984 'third_party/zlib/google' \
985 'url/third_party/mozilla' \
986 'v8/src/third_party/fdlibm' \
987 'v8/src/third_party/valgrind' \
988 --do-remove || die
989 }
990
991 src_configure() {
992 local myconf=""
993
994 # Never tell the build system to "enable" SSE2, it has a few unexpected
995 # additions, bug #336871.
996 myconf+=" -Ddisable_sse2=1"
997
998 # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
999 myconf+=" -Ddisable_nacl=1"
1000
1001 # Disable glibc Native Client toolchain, we don't need it (bug #417019).
1002 # myconf+=" -Ddisable_glibc=1"
1003
1004 # TODO: also build with pnacl
1005 # myconf+=" -Ddisable_pnacl=1"
1006
1007 # It would be awkward for us to tar the toolchain and get it untarred again
1008 # during the build.
1009 # myconf+=" -Ddisable_newlib_untar=1"
1010
1011 # Make it possible to remove third_party/adobe.
1012 echo > "${T}/flapper_version.h" || die
1013 myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h"
1014
1015 # Use system-provided libraries.
1016 # TODO: use_system_hunspell (upstream changes needed).
1017 # TODO: use_system_libsrtp (bug #459932).
1018 # TODO: use_system_libusb (http://crbug.com/266149).
1019 # TODO: use_system_libvpx (http://crbug.com/494939).
1020 # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
1021 # TODO: use_system_protobuf (bug #525560).
1022 # TODO: use_system_ssl (http://crbug.com/58087).
1023 # TODO: use_system_sqlite (http://crbug.com/22208).
1024 myconf+="
1025 -Duse_system_bzip2=1
1026 -Duse_system_flac=1
1027 -Duse_system_harfbuzz=1
1028 -Duse_system_icu=1
1029 -Duse_system_jsoncpp=1
1030 -Duse_system_libevent=1
1031 -Duse_system_libjpeg=1
1032 -Duse_system_libpng=1
1033 -Duse_system_libwebp=1
1034 -Duse_system_libxml=1
1035 -Duse_system_libxslt=1
1036 -Duse_system_minizip=1
1037 -Duse_system_nspr=1
1038 -Duse_system_re2=1
1039 -Duse_system_snappy=1
1040 -Duse_system_speex=1
1041 -Duse_system_xdg_utils=1
1042 -Duse_system_zlib=1"
1043
1044 # Needed for system icu - we don't need additional data files.
1045 myconf+=" -Dicu_use_data_file_flag=0"
1046
1047 # TODO: patch gyp so that this arm conditional is not needed.
1048 if ! use arm; then
1049 myconf+="
1050 -Duse_system_yasm=1"
1051 fi
1052
1053 # Optional dependencies.
1054 # TODO: linux_link_kerberos, bug #381289.
1055 myconf+="
1056 $(gyp_use cups)
1057 $(gyp_use gnome use_gconf)
1058 $(gyp_use gnome-keyring use_gnome_keyring)
1059 $(gyp_use gnome-keyring linux_link_gnome_keyring)
1060 $(gyp_use hidpi enable_hidpi)
1061 $(gyp_use hotwording enable_hotwording)
1062 $(gyp_use kerberos)
1063 $(gyp_use pulseaudio)
1064 $(gyp_use tcmalloc use_allocator tcmalloc none)"
1065
1066 # Use explicit library dependencies instead of dlopen.
1067 # This makes breakages easier to detect by revdep-rebuild.
1068 myconf+="
1069 -Dlinux_link_gsettings=1
1070 -Dlinux_link_libpci=1
1071 -Dlinux_link_libspeechd=1
1072 -Dlibspeechd_h_prefix=speech-dispatcher/"
1073
1074 # TODO: use the file at run time instead of effectively compiling it in.
1075 myconf+="
1076 -Dusb_ids_path=/usr/share/misc/usb.ids"
1077
1078 # Save space by removing DLOG and DCHECK messages (about 6% reduction).
1079 myconf+="
1080 -Dlogging_like_official_build=1"
1081
1082 if [[ $(tc-getCC) == *clang* ]]; then
1083 myconf+=" -Dclang=1"
1084 else
1085 myconf+=" -Dclang=0"
1086 fi
1087
1088 # Never use bundled gold binary. Disable gold linker flags for now.
1089 # Do not use bundled clang.
1090 myconf+="
1091 -Dclang_use_chrome_plugins=0
1092 -Dhost_clang=0
1093 -Dlinux_use_bundled_binutils=0
1094 -Dlinux_use_bundled_gold=0
1095 -Dlinux_use_gold_flags=0"
1096
1097 ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
1098 myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
1099
1100 # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
1101 # Note: these are for Gentoo use ONLY. For your own distribution,
1102 # please get your own set of keys. Feel free to contact chromium@g.o
1103 # for more info.
1104 myconf+=" -Dgoogle_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
1105 -Dgoogle_default_client_id=329227923882.apps.googleusercontent.com
1106 -Dgoogle_default_client_secret=vgKG0NNv7GoDpbtoFNLxCUXu"
1107
1108 local myarch="$(tc-arch)"
1109 if [[ $myarch = amd64 ]] ; then
1110 target_arch=x64
1111 ffmpeg_target_arch=x64
1112 elif [[ $myarch = x86 ]] ; then
1113 target_arch=ia32
1114 ffmpeg_target_arch=ia32
1115 elif [[ $myarch = arm ]] ; then
1116 target_arch=arm
1117 ffmpeg_target_arch=$(usex neon arm-neon arm)
1118 # TODO: re-enable NaCl (NativeClient).
1119 local CTARGET=${CTARGET:-${CHOST}}
1120 if [[ $(tc-is-softfloat) == "no" ]]; then
1121
1122 myconf+=" -Darm_float_abi=hard"
1123 fi
1124 filter-flags "-mfpu=*"
1125 use neon || myconf+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
1126
1127 if [[ ${CTARGET} == armv[78]* ]]; then
1128 myconf+=" -Darmv7=1"
1129 else
1130 myconf+=" -Darmv7=0"
1131 fi
1132 myconf+=" -Dsysroot=
1133 $(gyp_use neon arm_neon)
1134 -Ddisable_nacl=1"
1135 else
1136 die "Failed to determine target arch, got '$myarch'."
1137 fi
1138
1139 myconf+=" -Dtarget_arch=${target_arch}"
1140
1141 # Make sure that -Werror doesn't get added to CFLAGS by the build system.
1142 # Depending on GCC version the warnings are different and we don't want
1143 # the build to fail because of that.
1144 myconf+=" -Dwerror="
1145
1146 # Disable fatal linker warnings, bug 506268.
1147 myconf+=" -Ddisable_fatal_linker_warnings=1"
1148
1149 # Avoid CFLAGS problems, bug #352457, bug #390147.
1150 if ! use custom-cflags; then
1151 replace-flags "-Os" "-O2"
1152 strip-flags
1153
1154 # Prevent linker from running out of address space, bug #471810 .
1155 if use x86; then
1156 filter-flags "-g*"
1157 fi
1158
1159 # Prevent libvpx build failures. Bug 530248, 544702, 546984.
1160 if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
1161 filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx2
1162 fi
1163 fi
1164
1165 # Make sure the build system will use the right tools, bug #340795.
1166 tc-export AR CC CXX RANLIB
1167
1168 # Tools for building programs to be executed on the build system, bug #410883.
1169 export AR_host=$(tc-getBUILD_AR)
1170 export CC_host=$(tc-getBUILD_CC)
1171 export CXX_host=$(tc-getBUILD_CXX)
1172 export LD_host=${CXX_host}
1173
1174 # Bug 491582.
1175 export TMPDIR="${WORKDIR}/temp"
1176 mkdir -m 755 "${TMPDIR}" || die
1177
1178 local build_ffmpeg_args=""
1179 if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
1180 build_ffmpeg_args+=" --disable-asm"
1181 fi
1182
1183 # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
1184 einfo "Configuring bundled ffmpeg..."
1185 pushd third_party/ffmpeg > /dev/null || die
1186 chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
1187 --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
1188 chromium/scripts/copy_config.sh || die
1189 chromium/scripts/generate_gyp.py || die
1190 popd > /dev/null || die
1191
1192 third_party/libaddressinput/chromium/tools/update-strings.py || die
1193
1194 cat <<EOF >chrome/test/data/webui_test_resources.grd || die
1195 <?xml version="1.0" encoding="UTF-8"?>
1196 <grit latest_public_release="0" current_release="1">
1197 <outputs>
1198 <output filename="chrome/test/data/grit/webui_test_resources.h" type="rc_header">
1199 <emit emit_type='prepend'></emit>
1200 </output>
1201 <output filename="webui_test_resources.pak" type="data_package" />
1202 </outputs>
1203 <release seq="1">
1204 </release>
1205 </grit>
1206 EOF
1207
1208 einfo "Configuring Chromium..."
1209 build/linux/unbundle/replace_gyp_files.py ${myconf} || die
1210 egyp_chromium ${myconf} || die
1211 }
1212
1213 eninja() {
1214 if [[ -z ${NINJAOPTS+set} ]]; then
1215 local jobs=$(makeopts_jobs)
1216 local loadavg=$(makeopts_loadavg)
1217
1218 if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
1219 NINJAOPTS+=" -j ${jobs}"
1220 fi
1221 if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
1222 NINJAOPTS+=" -l ${loadavg}"
1223 fi
1224 fi
1225 set -- ninja -v ${NINJAOPTS} "$@"
1226 echo "$@"
1227 "$@"
1228 }
1229
1230 src_compile() {
1231 local ninja_targets="chrome chrome_sandbox chromedriver"
1232
1233 # Build mksnapshot and pax-mark it.
1234 eninja -C out/Release mksnapshot || die
1235 pax-mark m out/Release/mksnapshot
1236
1237 # Even though ninja autodetects number of CPUs, we respect
1238 # user's options, for debugging with -j 1 or any other reason.
1239 eninja -C out/Release ${ninja_targets} || die
1240
1241 pax-mark m out/Release/chrome
1242 }
1243
1244 src_install() {
1245 exeinto "${CHROMIUM_HOME}"
1246 doexe out/Release/chrome || die
1247
1248 newexe out/Release/chrome_sandbox chrome-sandbox || die
1249 fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
1250
1251 doexe out/Release/chromedriver || die
1252
1253 # if ! use arm; then
1254 # doexe out/Release/nacl_helper{,_bootstrap} || die
1255 # insinto "${CHROMIUM_HOME}"
1256 # doins out/Release/nacl_irt_*.nexe || die
1257 # doins out/Release/libppGoogleNaClPluginChrome.so || die
1258 # fi
1259
1260 local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
1261 if [[ -n ${CHROMIUM_SUFFIX} ]]; then
1262 sedargs+=(
1263 -e "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g"
1264 -e "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g"
1265 -e "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:"
1266 )
1267 fi
1268 sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
1269 doexe chromium-launcher.sh
1270
1271 # It is important that we name the target "chromium-browser",
1272 # xdg-utils expect it; bug #355517.
1273 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
1274 # keep the old symlink around for consistency
1275 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
1276
1277 dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${CHROMIUM_SUFFIX} || die
1278
1279 # Allow users to override command-line options, bug #357629.
1280 dodir /etc/chromium || die
1281 insinto /etc/chromium
1282 newins "${FILESDIR}/chromium.default" "default" || die
1283
1284 pushd out/Release/locales > /dev/null || die
1285 chromium_remove_language_paks
1286 popd
1287
1288 insinto "${CHROMIUM_HOME}"
1289 doins out/Release/*.bin || die
1290 doins out/Release/*.pak || die
1291
1292 doins -r out/Release/locales || die
1293 doins -r out/Release/resources || die
1294
1295 newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
1296 newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
1297
1298 # Install icons and desktop entry.
1299 local branding size
1300 for size in 16 22 24 32 48 64 128 256 ; do
1301 case ${size} in
1302 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
1303 *) branding="chrome/app/theme/chromium" ;;
1304 esac
1305 newicon -s ${size} "${branding}/product_logo_${size}.png" \
1306 chromium-browser${CHROMIUM_SUFFIX}.png
1307 done
1308
1309 local mime_types="text/html;text/xml;application/xhtml+xml;"
1310 mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
1311 mime_types+="x-scheme-handler/ftp;" # bug #412185
1312 mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
1313 make_desktop_entry \
1314 chromium-browser${CHROMIUM_SUFFIX} \
1315 "Chromium${CHROMIUM_SUFFIX}" \
1316 chromium-browser${CHROMIUM_SUFFIX} \
1317 "Network;WebBrowser" \
1318 "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
1319 sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
1320
1321 # Install GNOME default application entry (bug #303100).
1322 if use gnome; then
1323 dodir /usr/share/gnome-control-center/default-apps || die
1324 insinto /usr/share/gnome-control-center/default-apps
1325 newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
1326 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
1327 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
1328 "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
1329 fi
1330 fi
1331
1332 readme.gentoo_create_doc
1333 }
1334
1335 pkg_postinst() {
1336 fdo-mime_desktop_database_update
1337 gnome2_icon_cache_update
1338 readme.gentoo_print_elog
1339 }