Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/
Date: Sun, 29 Apr 2018 17:19:20
Message-Id: 1525022352.5c2036314444f96296098b22b310a5ed0cc9dede.floppym@gentoo
1 commit: 5c2036314444f96296098b22b310a5ed0cc9dede
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 29 17:18:54 2018 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 29 17:19:12 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c203631
7
8 www-client/chromium: stable channel bump (66.0.3359.139)
9
10 Package-Manager: Portage-2.3.31_p60, Repoman-2.3.9_p116
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-66.0.3359.139.ebuild | 699 ++++++++++++++++++++++
14 2 files changed, 700 insertions(+)
15
16 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
17 index 8cf49124d9d..5e4c84f9ee3 100644
18 --- a/www-client/chromium/Manifest
19 +++ b/www-client/chromium/Manifest
20 @@ -1,4 +1,5 @@
21 DIST chromium-66.0.3359.117-blink.tar.xz 10604 BLAKE2B f458afe8ca21dbae62037cf9b962726a0b48177bcd209ca15eb2a717ca33307ab631e85422fce8bc5990e8f78ee30dd5b58d972eae4cc511f593ee82227ec2b3 SHA512 846ed1ecaa51d945057d0a9f6a72e1dd871a9556fd1a8ff79a5b9e342363d6a2d60378dbc0e84046e7274f9d09dd2d9b444a76af7fc25e7a2869c15c858606d3
22 DIST chromium-66.0.3359.117.tar.xz 583947452 BLAKE2B b9e860f0f966ec9aaa2ab5627bbc12486a67b658866763f82d1687cb6cd5ae0cf8b2ccfa3bf045417688a771d7662ba2f8ba149b88802ab3f54015e14ceb7fec SHA512 93fba91783a2109a74fcf7fb0a70a1e1eb062d9277a78783832230638a3371e35fa725494989236c5e5be5494548c4869e1b2e645c65f794a7296efeef8eb27c
23 +DIST chromium-66.0.3359.139.tar.xz 583978636 BLAKE2B 0727ba9f87a738b691b2120dee7f45f7b16b234e871988b1257f01589a6a5ec2cd2470e8d95fc3087be2ab140f71afce63c7fccc851e87a932f69326966c3303 SHA512 9fe78fb6970fc5a3455e6545a4869d3a73075329ccd26719f503fd9bbfbdd6aec4f3db4cc748e8f12abb81adb318b8f8b42c7ab5c289a1f698536e81b7d2f14f
24 DIST chromium-67.0.3377.1.tar.xz 585310180 BLAKE2B 9e543ad2796c617e9c6237a938600ddd4fd7f7245f78e7aec25e2160ed8ab128e70c97d5a7d70021fd7b79707ceaf1e5e0a836e25474ad5e2999bc1f6b7e43b1 SHA512 e0e5c092895d676551ad75cf18595a641676cde0a6a414180a7e23046cb47fe61256634ac50fa6b3f05153a75125e88417bada12f662ee3fa71aad3ba7cf7684
25 DIST chromium-67.0.3396.18.tar.xz 589707412 BLAKE2B 925d258b388b9c28c64db8a423139d52ff4bada2a3971c1c3735e8caf9c9f6991e44153ae57650285f76f5b185046259d6305abaa2bf6ed9ff00c87a91162da2 SHA512 38e19697d4386fc0497312f2dd408f0e950fabb58f78572509caa68cbdbc7f5c5e54bb945c1afe17c64ef5180711759735d5cacb61fb8847b4fe3ac1a4485066
26
27 diff --git a/www-client/chromium/chromium-66.0.3359.139.ebuild b/www-client/chromium/chromium-66.0.3359.139.ebuild
28 new file mode 100644
29 index 00000000000..cf52ce6305d
30 --- /dev/null
31 +++ b/www-client/chromium/chromium-66.0.3359.139.ebuild
32 @@ -0,0 +1,699 @@
33 +# Copyright 1999-2018 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI="6"
37 +PYTHON_COMPAT=( python2_7 )
38 +
39 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
40 + 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
41 + sv sw ta te th tr uk vi zh-CN zh-TW"
42 +
43 +inherit check-reqs chromium-2 eutils gnome2-utils flag-o-matic multilib ninja-utils pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs versionator xdg-utils
44 +
45 +DESCRIPTION="Open-source version of Google Chrome web browser"
46 +HOMEPAGE="http://chromium.org/"
47 +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz"
48 +
49 +LICENSE="BSD"
50 +SLOT="0"
51 +KEYWORDS="~amd64 ~arm64 ~x86"
52 +IUSE="component-build cups gnome-keyring +hangouts jumbo-build kerberos neon pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +system-libvpx +tcmalloc widevine"
53 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
54 +
55 +COMMON_DEPEND="
56 + app-accessibility/at-spi2-atk:2
57 + app-arch/bzip2:=
58 + cups? ( >=net-print/cups-1.3.11:= )
59 + dev-libs/atk
60 + dev-libs/expat:=
61 + dev-libs/glib:2
62 + system-icu? ( >=dev-libs/icu-59:= )
63 + >=dev-libs/libxml2-2.9.4-r3:=[icu]
64 + dev-libs/libxslt:=
65 + dev-libs/nspr:=
66 + >=dev-libs/nss-3.26:=
67 + >=dev-libs/re2-0.2016.05.01:=
68 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
69 + >=media-libs/alsa-lib-1.0.19:=
70 + media-libs/fontconfig:=
71 + media-libs/freetype:=
72 + >=media-libs/harfbuzz-1.6.0:=[icu(-)]
73 + media-libs/libjpeg-turbo:=
74 + media-libs/libpng:=
75 + system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
76 + >=media-libs/openh264-1.6.0:=
77 + pulseaudio? ( media-sound/pulseaudio:= )
78 + system-ffmpeg? (
79 + >=media-video/ffmpeg-3:=
80 + || (
81 + media-video/ffmpeg[-samba]
82 + >=net-fs/samba-4.5.10-r1[-debug(-)]
83 + )
84 + !=net-fs/samba-4.5.12
85 + media-libs/opus:=
86 + )
87 + sys-apps/dbus:=
88 + sys-apps/pciutils:=
89 + virtual/udev
90 + x11-libs/cairo:=
91 + x11-libs/gdk-pixbuf:2
92 + x11-libs/gtk+:3[X]
93 + x11-libs/libX11:=
94 + x11-libs/libXcomposite:=
95 + x11-libs/libXcursor:=
96 + x11-libs/libXdamage:=
97 + x11-libs/libXext:=
98 + x11-libs/libXfixes:=
99 + >=x11-libs/libXi-1.6.0:=
100 + x11-libs/libXrandr:=
101 + x11-libs/libXrender:=
102 + x11-libs/libXScrnSaver:=
103 + x11-libs/libXtst:=
104 + x11-libs/pango:=
105 + app-arch/snappy:=
106 + media-libs/flac:=
107 + >=media-libs/libwebp-0.4.0:=
108 + sys-libs/zlib:=[minizip]
109 + kerberos? ( virtual/krb5 )
110 +"
111 +# For nvidia-drivers blocker, see bug #413637 .
112 +RDEPEND="${COMMON_DEPEND}
113 + !=www-client/chromium-9999
114 + !<www-plugins/chrome-binary-plugins-57
115 + x11-misc/xdg-utils
116 + virtual/opengl
117 + virtual/ttf-fonts
118 + selinux? ( sec-policy/selinux-chromium )
119 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
120 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
121 +"
122 +# dev-vcs/git - https://bugs.gentoo.org/593476
123 +# sys-apps/sandbox - https://crbug.com/586444
124 +DEPEND="${COMMON_DEPEND}
125 + >=app-arch/gzip-1.7
126 + !arm? (
127 + dev-lang/yasm
128 + )
129 + dev-lang/perl
130 + >=dev-util/gperf-3.0.3
131 + >=dev-util/ninja-1.7.2
132 + >=net-libs/nodejs-6.9.4
133 + sys-apps/hwids[usb(+)]
134 + >=sys-devel/bison-2.4.3
135 + sys-devel/flex
136 + >=sys-devel/clang-5
137 + virtual/pkgconfig
138 + dev-vcs/git
139 + $(python_gen_any_dep '
140 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
141 + >=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]
142 + dev-python/html5lib[${PYTHON_USEDEP}]
143 + dev-python/simplejson[${PYTHON_USEDEP}]
144 + ')
145 +"
146 +
147 +# Keep this in sync with the python_gen_any_dep call.
148 +python_check_deps() {
149 + has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
150 + has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
151 + has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
152 + has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
153 +}
154 +
155 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
156 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
157 +fi
158 +
159 +DISABLE_AUTOFORMATTING="yes"
160 +DOC_CONTENTS="
161 +Some web pages may require additional fonts to display properly.
162 +Try installing some of the following packages if some characters
163 +are not displayed properly:
164 +- media-fonts/arphicfonts
165 +- media-fonts/bitstream-cyberbit
166 +- media-fonts/droid
167 +- media-fonts/ipamonafont
168 +- media-fonts/noto
169 +- media-fonts/ja-ipafonts
170 +- media-fonts/takao-fonts
171 +- media-fonts/wqy-microhei
172 +- media-fonts/wqy-zenhei
173 +
174 +To fix broken icons on the Downloads page, you should install an icon
175 +theme that covers the appropriate MIME types, and configure this as your
176 +GTK+ icon theme.
177 +"
178 +
179 +PATCHES=(
180 + "${FILESDIR}/chromium-widevine-r1.patch"
181 + "${FILESDIR}/chromium-FORTIFY_SOURCE-r2.patch"
182 + "${FILESDIR}/chromium-webrtc-r0.patch"
183 + "${FILESDIR}/chromium-memcpy-r0.patch"
184 + "${FILESDIR}/chromium-clang-r2.patch"
185 + "${FILESDIR}/chromium-math.h-r0.patch"
186 + "${FILESDIR}/chromium-stdint.patch"
187 + "${FILESDIR}/chromium-clang-r4.patch"
188 + "${FILESDIR}/chromium-ffmpeg-r1.patch"
189 + "${FILESDIR}/chromium-ffmpeg-clang.patch"
190 +)
191 +
192 +pre_build_checks() {
193 + #if [[ ${MERGE_TYPE} != binary ]]; then
194 + # local -x CPP="$(tc-getCXX) -E"
195 + # if tc-is-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
196 + # # bugs: #601654
197 + # die "At least clang 3.9.1 is required"
198 + # fi
199 + # if tc-is-gcc && ! version_is_at_least 5.0 "$(gcc-version)"; then
200 + # # bugs: #535730, #525374, #518668, #600288, #627356
201 + # die "At least gcc 5.0 is required"
202 + # fi
203 + #fi
204 +
205 + # Check build requirements, bug #541816 and bug #471810 .
206 + CHECKREQS_MEMORY="3G"
207 + CHECKREQS_DISK_BUILD="5G"
208 + eshopts_push -s extglob
209 + if is-flagq '-g?(gdb)?([1-9])'; then
210 + CHECKREQS_DISK_BUILD="25G"
211 + if ! use component-build; then
212 + CHECKREQS_MEMORY="16G"
213 + fi
214 + fi
215 + eshopts_pop
216 + check-reqs_pkg_setup
217 +}
218 +
219 +pkg_pretend() {
220 + pre_build_checks
221 +}
222 +
223 +pkg_setup() {
224 + pre_build_checks
225 +
226 + chromium_suid_sandbox_check_kernel_config
227 +}
228 +
229 +src_prepare() {
230 + # Calling this here supports resumption via FEATURES=keepwork
231 + python_setup
232 +
233 + default
234 +
235 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
236 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
237 +
238 + local keeplibs=(
239 + base/third_party/dmg_fp
240 + base/third_party/dynamic_annotations
241 + base/third_party/icu
242 + base/third_party/nspr
243 + base/third_party/superfasthash
244 + base/third_party/symbolize
245 + base/third_party/valgrind
246 + base/third_party/xdg_mime
247 + base/third_party/xdg_user_dirs
248 + buildtools/third_party/libc++
249 + buildtools/third_party/libc++abi
250 + chrome/third_party/mozilla_security_manager
251 + courgette/third_party
252 + net/third_party/mozilla_security_manager
253 + net/third_party/nss
254 + third_party/WebKit
255 + third_party/analytics
256 + third_party/angle
257 + third_party/angle/src/common/third_party/base
258 + third_party/angle/src/common/third_party/smhasher
259 + third_party/angle/src/third_party/compiler
260 + third_party/angle/src/third_party/libXNVCtrl
261 + third_party/angle/src/third_party/trace_event
262 + third_party/angle/third_party/glslang
263 + third_party/angle/third_party/spirv-headers
264 + third_party/angle/third_party/spirv-tools
265 + third_party/angle/third_party/vulkan-validation-layers
266 + third_party/blink
267 + third_party/boringssl
268 + third_party/boringssl/src/third_party/fiat
269 + third_party/breakpad
270 + third_party/breakpad/breakpad/src/third_party/curl
271 + third_party/brotli
272 + third_party/cacheinvalidation
273 + third_party/catapult
274 + third_party/catapult/common/py_vulcanize/third_party/rcssmin
275 + third_party/catapult/common/py_vulcanize/third_party/rjsmin
276 + third_party/catapult/third_party/polymer
277 + third_party/catapult/tracing/third_party/d3
278 + third_party/catapult/tracing/third_party/gl-matrix
279 + third_party/catapult/tracing/third_party/jszip
280 + third_party/catapult/tracing/third_party/mannwhitneyu
281 + third_party/catapult/tracing/third_party/oboe
282 + third_party/catapult/tracing/third_party/pako
283 + third_party/ced
284 + third_party/cld_3
285 + third_party/crc32c
286 + third_party/cros_system_api
287 + third_party/devscripts
288 + third_party/dom_distiller_js
289 + third_party/fips181
290 + third_party/flatbuffers
291 + third_party/flot
292 + third_party/freetype
293 + third_party/glslang-angle
294 + third_party/google_input_tools
295 + third_party/google_input_tools/third_party/closure_library
296 + third_party/google_input_tools/third_party/closure_library/third_party/closure
297 + third_party/googletest
298 + third_party/hunspell
299 + third_party/iccjpeg
300 + third_party/inspector_protocol
301 + third_party/jinja2
302 + third_party/jstemplate
303 + third_party/khronos
304 + third_party/leveldatabase
305 + third_party/libXNVCtrl
306 + third_party/libaddressinput
307 + third_party/libaom
308 + third_party/libaom/source/libaom/third_party/x86inc
309 + third_party/libjingle
310 + third_party/libphonenumber
311 + third_party/libsecret
312 + third_party/libsrtp
313 + third_party/libudev
314 + third_party/libwebm
315 + third_party/libxml/chromium
316 + third_party/libyuv
317 + third_party/llvm
318 + third_party/lss
319 + third_party/lzma_sdk
320 + third_party/markupsafe
321 + third_party/mesa
322 + third_party/metrics_proto
323 + third_party/modp_b64
324 + third_party/node
325 + third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2
326 + third_party/openmax_dl
327 + third_party/ots
328 + third_party/pdfium
329 + third_party/pdfium/third_party/agg23
330 + third_party/pdfium/third_party/base
331 + third_party/pdfium/third_party/bigint
332 + third_party/pdfium/third_party/freetype
333 + third_party/pdfium/third_party/lcms
334 + third_party/pdfium/third_party/libopenjpeg20
335 + third_party/pdfium/third_party/libpng16
336 + third_party/pdfium/third_party/libtiff
337 + third_party/pdfium/third_party/skia_shared
338 + third_party/ply
339 + third_party/polymer
340 + third_party/protobuf
341 + third_party/protobuf/third_party/six
342 + third_party/qcms
343 + third_party/s2cellid
344 + third_party/sfntly
345 + third_party/skia
346 + third_party/skia/third_party/gif
347 + third_party/skia/third_party/vulkan
348 + third_party/smhasher
349 + third_party/spirv-headers
350 + third_party/spirv-tools-angle
351 + third_party/sqlite
352 + third_party/swiftshader
353 + third_party/swiftshader/third_party/llvm-subzero
354 + third_party/swiftshader/third_party/subzero
355 + third_party/unrar
356 + third_party/usrsctp
357 + third_party/vulkan
358 + third_party/vulkan-validation-layers
359 + third_party/web-animations-js
360 + third_party/webdriver
361 + third_party/webrtc
362 + third_party/widevine
363 + third_party/woff2
364 + third_party/zlib/google
365 + url/third_party/mozilla
366 + v8/src/third_party/valgrind
367 + v8/src/third_party/utf8-decoder
368 + v8/third_party/inspector_protocol
369 +
370 + # gyp -> gn leftovers
371 + base/third_party/libevent
372 + third_party/adobe
373 + third_party/speech-dispatcher
374 + third_party/usb_ids
375 + third_party/xdg-utils
376 + third_party/yasm/run_yasm.py
377 + )
378 + if ! use system-ffmpeg; then
379 + keeplibs+=( third_party/ffmpeg third_party/opus )
380 + fi
381 + if ! use system-icu; then
382 + keeplibs+=( third_party/icu )
383 + fi
384 + if ! use system-libvpx; then
385 + keeplibs+=( third_party/libvpx )
386 + keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc )
387 + fi
388 + if use tcmalloc; then
389 + keeplibs+=( third_party/tcmalloc )
390 + fi
391 +
392 + # Remove most bundled libraries. Some are still needed.
393 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
394 +}
395 +
396 +bootstrap_gn() {
397 + if tc-is-cross-compiler; then
398 + local -x AR=${BUILD_AR}
399 + local -x CC=${BUILD_CC}
400 + local -x CXX=${BUILD_CXX}
401 + local -x NM=${BUILD_NM}
402 + local -x CFLAGS=${BUILD_CFLAGS}
403 + local -x CXXFLAGS=${BUILD_CXXFLAGS}
404 + local -x LDFLAGS=${BUILD_LDFLAGS}
405 + fi
406 + einfo "Building GN..."
407 + set -- tools/gn/bootstrap/bootstrap.py -s -v --no-clean
408 + echo "$@"
409 + "$@" || die
410 +}
411 +
412 +src_configure() {
413 + # Calling this here supports resumption via FEATURES=keepwork
414 + python_setup
415 +
416 + local myconf_gn=""
417 +
418 + # Make sure the build system will use the right tools, bug #340795.
419 + tc-export AR CC CXX NM
420 +
421 + if ! tc-is-clang; then
422 + # Force clang since gcc is pretty broken at the moment.
423 + CC=${CHOST}-clang
424 + CXX=${CHOST}-clang++
425 + strip-unsupported-flags
426 + fi
427 +
428 + if tc-is-clang; then
429 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
430 + else
431 + myconf_gn+=" is_clang=false"
432 + fi
433 +
434 + # Define a custom toolchain for GN
435 + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
436 +
437 + if tc-is-cross-compiler; then
438 + tc-export BUILD_{AR,CC,CXX,NM}
439 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
440 + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
441 + else
442 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
443 + fi
444 +
445 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
446 + myconf_gn+=" is_debug=false"
447 +
448 + # Component build isn't generally intended for use by end users. It's mostly useful
449 + # for development and debugging.
450 + myconf_gn+=" is_component_build=$(usex component-build true false)"
451 +
452 + # https://chromium.googlesource.com/chromium/src/+/lkcr/docs/jumbo.md
453 + myconf_gn+=" use_jumbo_build=$(usex jumbo-build true false)"
454 +
455 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
456 +
457 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
458 + myconf_gn+=" enable_nacl=false"
459 +
460 + # Use system-provided libraries.
461 + # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
462 + # TODO: use_system_hunspell (upstream changes needed).
463 + # TODO: use_system_libsrtp (bug #459932).
464 + # TODO: use_system_protobuf (bug #525560).
465 + # TODO: use_system_ssl (http://crbug.com/58087).
466 + # TODO: use_system_sqlite (http://crbug.com/22208).
467 +
468 + # libevent: https://bugs.gentoo.org/593458
469 + local gn_system_libraries=(
470 + flac
471 + fontconfig
472 + freetype
473 + # Need harfbuzz_from_pkgconfig target
474 + #harfbuzz-ng
475 + libdrm
476 + libjpeg
477 + libpng
478 + libwebp
479 + libxml
480 + libxslt
481 + openh264
482 + re2
483 + snappy
484 + yasm
485 + zlib
486 + )
487 + if use system-ffmpeg; then
488 + gn_system_libraries+=( ffmpeg opus )
489 + fi
490 + if use system-icu; then
491 + gn_system_libraries+=( icu )
492 + fi
493 + if use system-libvpx; then
494 + gn_system_libraries+=( libvpx )
495 + fi
496 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
497 +
498 + # See dependency logic in third_party/BUILD.gn
499 + myconf_gn+=" use_system_harfbuzz=true"
500 +
501 + # Optional dependencies.
502 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
503 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
504 + myconf_gn+=" use_cups=$(usex cups true false)"
505 + myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
506 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
507 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
508 +
509 + # TODO: link_pulseaudio=true for GN.
510 +
511 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
512 +
513 + # Never use bundled gold binary. Disable gold linker flags for now.
514 + # Do not use bundled clang.
515 + # Trying to use gold results in linker crash.
516 + myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false use_custom_libcxx=false"
517 +
518 + # Disable forced lld, bug 641556
519 + myconf_gn+=" use_lld=false"
520 +
521 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
522 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
523 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
524 +
525 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
526 + # Note: these are for Gentoo use ONLY. For your own distribution,
527 + # please get your own set of keys. Feel free to contact chromium@g.o
528 + # for more info.
529 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
530 + local google_default_client_id="329227923882.apps.googleusercontent.com"
531 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
532 + myconf_gn+=" google_api_key=\"${google_api_key}\""
533 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
534 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
535 +
536 + local myarch="$(tc-arch)"
537 + if [[ $myarch = amd64 ]] ; then
538 + myconf_gn+=" target_cpu=\"x64\""
539 + ffmpeg_target_arch=x64
540 + elif [[ $myarch = x86 ]] ; then
541 + myconf_gn+=" target_cpu=\"x86\""
542 + ffmpeg_target_arch=ia32
543 + elif [[ $myarch = arm64 ]] ; then
544 + myconf_gn+=" target_cpu=\"arm64\""
545 + ffmpeg_target_arch=arm64
546 + elif [[ $myarch = arm ]] ; then
547 + myconf_gn+=" target_cpu=\"arm\""
548 + ffmpeg_target_arch=$(usex neon arm-neon arm)
549 + else
550 + die "Failed to determine target arch, got '$myarch'."
551 + fi
552 +
553 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
554 + # Depending on GCC version the warnings are different and we don't want
555 + # the build to fail because of that.
556 + myconf_gn+=" treat_warnings_as_errors=false"
557 +
558 + # Disable fatal linker warnings, bug 506268.
559 + myconf_gn+=" fatal_linker_warnings=false"
560 +
561 + # Avoid CFLAGS problems, bug #352457, bug #390147.
562 + if ! use custom-cflags; then
563 + replace-flags "-Os" "-O2"
564 + strip-flags
565 +
566 + # Prevent linker from running out of address space, bug #471810 .
567 + if use x86; then
568 + filter-flags "-g*"
569 + fi
570 +
571 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
572 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
573 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
574 + fi
575 + fi
576 +
577 + # https://bugs.gentoo.org/588596
578 + #append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks)
579 +
580 + # Bug 491582.
581 + export TMPDIR="${WORKDIR}/temp"
582 + mkdir -p -m 755 "${TMPDIR}" || die
583 +
584 + if ! use system-ffmpeg; then
585 + local build_ffmpeg_args=""
586 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
587 + build_ffmpeg_args+=" --disable-asm"
588 + fi
589 +
590 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
591 + einfo "Configuring bundled ffmpeg..."
592 + pushd third_party/ffmpeg > /dev/null || die
593 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
594 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
595 + chromium/scripts/copy_config.sh || die
596 + chromium/scripts/generate_gn.py || die
597 + popd > /dev/null || die
598 + fi
599 +
600 + bootstrap_gn
601 +
602 + einfo "Configuring Chromium..."
603 + set -- out/Release/gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
604 + echo "$@"
605 + "$@" || die
606 +}
607 +
608 +src_compile() {
609 + # Calling this here supports resumption via FEATURES=keepwork
610 + python_setup
611 +
612 + #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
613 +
614 + # Build mksnapshot and pax-mark it.
615 + local x
616 + for x in mksnapshot v8_context_snapshot_generator; do
617 + if tc-is-cross-compiler; then
618 + eninja -C out/Release "host/${x}"
619 + pax-mark m "out/Release/host/${x}"
620 + else
621 + eninja -C out/Release "${x}"
622 + pax-mark m "out/Release/${x}"
623 + fi
624 + done
625 +
626 + # Even though ninja autodetects number of CPUs, we respect
627 + # user's options, for debugging with -j 1 or any other reason.
628 + eninja -C out/Release chrome chromedriver
629 + use suid && eninja -C out/Release chrome_sandbox
630 +
631 + pax-mark m out/Release/chrome
632 +}
633 +
634 +src_install() {
635 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
636 + exeinto "${CHROMIUM_HOME}"
637 + doexe out/Release/chrome
638 +
639 + if use suid; then
640 + newexe out/Release/chrome_sandbox chrome-sandbox
641 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
642 + fi
643 +
644 + doexe out/Release/chromedriver
645 +
646 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
647 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
648 + doexe chromium-launcher.sh
649 +
650 + # It is important that we name the target "chromium-browser",
651 + # xdg-utils expect it; bug #355517.
652 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
653 + # keep the old symlink around for consistency
654 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
655 +
656 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
657 +
658 + # Allow users to override command-line options, bug #357629.
659 + insinto /etc/chromium
660 + newins "${FILESDIR}/chromium.default" "default"
661 +
662 + pushd out/Release/locales > /dev/null || die
663 + chromium_remove_language_paks
664 + popd
665 +
666 + if use widevine; then
667 + # These will be provided by chrome-binary-plugins
668 + rm out/Release/libwidevinecdm*.so || die
669 + fi
670 +
671 + insinto "${CHROMIUM_HOME}"
672 + doins out/Release/*.bin
673 + doins out/Release/*.pak
674 + doins out/Release/*.so
675 +
676 + if ! use system-icu; then
677 + doins out/Release/icudtl.dat
678 + fi
679 +
680 + doins -r out/Release/locales
681 + doins -r out/Release/resources
682 +
683 + if [[ -d out/Release/swiftshader ]]; then
684 + insinto "${CHROMIUM_HOME}/swiftshader"
685 + doins out/Release/swiftshader/*.so
686 + fi
687 +
688 + # Install icons and desktop entry.
689 + local branding size
690 + for size in 16 22 24 32 48 64 128 256 ; do
691 + case ${size} in
692 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
693 + *) branding="chrome/app/theme/chromium" ;;
694 + esac
695 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
696 + chromium-browser.png
697 + done
698 +
699 + local mime_types="text/html;text/xml;application/xhtml+xml;"
700 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
701 + mime_types+="x-scheme-handler/ftp;" # bug #412185
702 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
703 + make_desktop_entry \
704 + chromium-browser \
705 + "Chromium" \
706 + chromium-browser \
707 + "Network;WebBrowser" \
708 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
709 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
710 +
711 + # Install GNOME default application entry (bug #303100).
712 + insinto /usr/share/gnome-control-center/default-apps
713 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
714 +
715 + readme.gentoo_create_doc
716 +}
717 +
718 +pkg_preinst() {
719 + gnome2_icon_savelist
720 +}
721 +
722 +pkg_postrm() {
723 + gnome2_icon_cache_update
724 + xdg_desktop_database_update
725 +}
726 +
727 +pkg_postinst() {
728 + gnome2_icon_cache_update
729 + xdg_desktop_database_update
730 + readme.gentoo_print_elog
731 +}