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: Tue, 29 May 2018 01:10:23
Message-Id: 1527556216.f37c9712a4c73b526e4b98ee1ec52ebefbeffb85.floppym@gentoo
1 commit: f37c9712a4c73b526e4b98ee1ec52ebefbeffb85
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 29 01:09:12 2018 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Tue May 29 01:10:16 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f37c9712
7
8 www-client/chromium: stable channel bump (66.0.3359.181)
9
10 Package-Manager: Portage-2.3.40_p8, Repoman-2.3.9_p240
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-66.0.3359.181.ebuild | 701 ++++++++++++++++++++++
14 2 files changed, 702 insertions(+)
15
16 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
17 index 99309555676..218c50b1da7 100644
18 --- a/www-client/chromium/Manifest
19 +++ b/www-client/chromium/Manifest
20 @@ -1,5 +1,6 @@
21 DIST chromium-66.0.3359.139.tar.xz 583978636 BLAKE2B 0727ba9f87a738b691b2120dee7f45f7b16b234e871988b1257f01589a6a5ec2cd2470e8d95fc3087be2ab140f71afce63c7fccc851e87a932f69326966c3303 SHA512 9fe78fb6970fc5a3455e6545a4869d3a73075329ccd26719f503fd9bbfbdd6aec4f3db4cc748e8f12abb81adb318b8f8b42c7ab5c289a1f698536e81b7d2f14f
22 DIST chromium-66.0.3359.170.tar.xz 583956312 BLAKE2B 313ac8c785147e940ead222aeb30181af3c5848bdc7e706bf83a42078c63ce71431a7d17ad4937a6a37cc72beb67725ead790f489a1d31c70a9a94a2e73a9c45 SHA512 69c78975c517d6d59225c92968c1be879e3a2ca2a3671f38a5f8b6303719f6bc441b1d1fe0b19818ab7f9a06cd15bf8631d03ad4931da6fdc641ba2894eecad2
23 +DIST chromium-66.0.3359.181.tar.xz 583985908 BLAKE2B 22794b379591da9e4bfb1ea38aec2f53e88584079ef8d0e56434d65b2f86bddf37ac41a82b9e94ae41700f10ce8b7a8bfe2c794ffe63ce9d04b2704bfe2a209d SHA512 3549cae27ce33a19bab857c91da1ed96c1ae36123b71bdf41a8bbacdc9554d15b4902e835dc4a8ef8016e69344b809aab4e1e3b1b26bd54d5ca651048bcb9886
24 DIST chromium-67.0.3396.30.tar.xz 589816436 BLAKE2B 05f2d9c1119f5819793e343c485d49296b0e6b852bb49aef7558c8f492ed62db29e30957d7f299aef45eae3ea8a292c526975141abd843524e776ffe20d716e9 SHA512 c1ce45d899f34a1ee492ee4176a23aceefc3aaeacbe36effda7616c6cfe40187102b07763267295d07d862c6dba0210e03db7447320dd02b4cc95b52ac6e6ac0
25 DIST chromium-67.0.3396.40.tar.xz 589878296 BLAKE2B e02d8980cb882fb67eb6e048dfa8534fb423259af257040cdda8198aac9433a221d6218873a8e5623ae3cfb8e081f22bfc40444e53be38b17a0ebff77537263d SHA512 1d4986d444076a4a48bf9ad7061dbb424f520e46f2f58f8f84dfee2fefea05a3b019ef27acda553efb9a75db9731acbc0c80f5dfb39a9137e9e27336306d5981
26 DIST chromium-68.0.3409.2.tar.xz 595647380 BLAKE2B 3f3ebb7de759ae92b8feca74a931c10c4bdf4f75a0a7aeb2f56b59e635e1f03becccdf2b26d306e5753d9379eadede6ef50ec4e44338a3a6bdfb960b74003770 SHA512 2ce35251392570bcfe0cc02813bf6cee1761b2227888a135491828bfdfa9eafa4538e8fb981165503f901eecbf91cc8ce17cebab1681c63a43f0625dae7a2dd8
27
28 diff --git a/www-client/chromium/chromium-66.0.3359.181.ebuild b/www-client/chromium/chromium-66.0.3359.181.ebuild
29 new file mode 100644
30 index 00000000000..dc900e5faf6
31 --- /dev/null
32 +++ b/www-client/chromium/chromium-66.0.3359.181.ebuild
33 @@ -0,0 +1,701 @@
34 +# Copyright 1999-2018 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI="6"
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
41 + 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
42 + sv sw ta te th tr uk vi zh-CN zh-TW"
43 +
44 +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
45 +
46 +DESCRIPTION="Open-source version of Google Chrome web browser"
47 +HOMEPAGE="http://chromium.org/"
48 +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz"
49 +
50 +LICENSE="BSD"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~arm64 ~x86"
53 +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"
54 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
55 +
56 +COMMON_DEPEND="
57 + app-accessibility/at-spi2-atk:2
58 + app-arch/bzip2:=
59 + cups? ( >=net-print/cups-1.3.11:= )
60 + dev-libs/atk
61 + dev-libs/expat:=
62 + dev-libs/glib:2
63 + system-icu? ( >=dev-libs/icu-59:= )
64 + >=dev-libs/libxml2-2.9.4-r3:=[icu]
65 + dev-libs/libxslt:=
66 + dev-libs/nspr:=
67 + >=dev-libs/nss-3.26:=
68 + >=dev-libs/re2-0.2016.05.01:=
69 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
70 + >=media-libs/alsa-lib-1.0.19:=
71 + media-libs/fontconfig:=
72 + media-libs/freetype:=
73 + >=media-libs/harfbuzz-1.6.0:=[icu(-)]
74 + media-libs/libjpeg-turbo:=
75 + media-libs/libpng:=
76 + system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
77 + >=media-libs/openh264-1.6.0:=
78 + pulseaudio? ( media-sound/pulseaudio:= )
79 + system-ffmpeg? (
80 + >=media-video/ffmpeg-3:=
81 + || (
82 + media-video/ffmpeg[-samba]
83 + >=net-fs/samba-4.5.10-r1[-debug(-)]
84 + )
85 + !=net-fs/samba-4.5.12
86 + media-libs/opus:=
87 + )
88 + sys-apps/dbus:=
89 + sys-apps/pciutils:=
90 + virtual/udev
91 + x11-libs/cairo:=
92 + x11-libs/gdk-pixbuf:2
93 + x11-libs/gtk+:3[X]
94 + x11-libs/libX11:=
95 + x11-libs/libXcomposite:=
96 + x11-libs/libXcursor:=
97 + x11-libs/libXdamage:=
98 + x11-libs/libXext:=
99 + x11-libs/libXfixes:=
100 + >=x11-libs/libXi-1.6.0:=
101 + x11-libs/libXrandr:=
102 + x11-libs/libXrender:=
103 + x11-libs/libXScrnSaver:=
104 + x11-libs/libXtst:=
105 + x11-libs/pango:=
106 + app-arch/snappy:=
107 + media-libs/flac:=
108 + >=media-libs/libwebp-0.4.0:=
109 + sys-libs/zlib:=[minizip]
110 + kerberos? ( virtual/krb5 )
111 +"
112 +# For nvidia-drivers blocker, see bug #413637 .
113 +RDEPEND="${COMMON_DEPEND}
114 + !=www-client/chromium-9999
115 + !<www-plugins/chrome-binary-plugins-57
116 + x11-misc/xdg-utils
117 + virtual/opengl
118 + virtual/ttf-fonts
119 + selinux? ( sec-policy/selinux-chromium )
120 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
121 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
122 +"
123 +# dev-vcs/git - https://bugs.gentoo.org/593476
124 +# sys-apps/sandbox - https://crbug.com/586444
125 +DEPEND="${COMMON_DEPEND}
126 + >=app-arch/gzip-1.7
127 + !arm? (
128 + dev-lang/yasm
129 + )
130 + dev-lang/perl
131 + >=dev-util/gperf-3.0.3
132 + >=dev-util/ninja-1.7.2
133 + >=net-libs/nodejs-6.9.4
134 + sys-apps/hwids[usb(+)]
135 + >=sys-devel/bison-2.4.3
136 + sys-devel/flex
137 + >=sys-devel/clang-5
138 + virtual/pkgconfig
139 + dev-vcs/git
140 + $(python_gen_any_dep '
141 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
142 + >=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]
143 + dev-python/html5lib[${PYTHON_USEDEP}]
144 + dev-python/simplejson[${PYTHON_USEDEP}]
145 + ')
146 +"
147 +
148 +# Keep this in sync with the python_gen_any_dep call.
149 +python_check_deps() {
150 + has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
151 + has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
152 + has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
153 + has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
154 +}
155 +
156 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
157 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
158 +fi
159 +
160 +DISABLE_AUTOFORMATTING="yes"
161 +DOC_CONTENTS="
162 +Some web pages may require additional fonts to display properly.
163 +Try installing some of the following packages if some characters
164 +are not displayed properly:
165 +- media-fonts/arphicfonts
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 + # https://bugs.gentoo.org/654216
585 + addpredict /dev/dri/
586 +
587 + if ! use system-ffmpeg; then
588 + local build_ffmpeg_args=""
589 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
590 + build_ffmpeg_args+=" --disable-asm"
591 + fi
592 +
593 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
594 + einfo "Configuring bundled ffmpeg..."
595 + pushd third_party/ffmpeg > /dev/null || die
596 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
597 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
598 + chromium/scripts/copy_config.sh || die
599 + chromium/scripts/generate_gn.py || die
600 + popd > /dev/null || die
601 + fi
602 +
603 + bootstrap_gn
604 +
605 + einfo "Configuring Chromium..."
606 + set -- out/Release/gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
607 + echo "$@"
608 + "$@" || die
609 +}
610 +
611 +src_compile() {
612 + # Calling this here supports resumption via FEATURES=keepwork
613 + python_setup
614 +
615 + #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
616 +
617 + # Build mksnapshot and pax-mark it.
618 + local x
619 + for x in mksnapshot v8_context_snapshot_generator; do
620 + if tc-is-cross-compiler; then
621 + eninja -C out/Release "host/${x}"
622 + pax-mark m "out/Release/host/${x}"
623 + else
624 + eninja -C out/Release "${x}"
625 + pax-mark m "out/Release/${x}"
626 + fi
627 + done
628 +
629 + # Even though ninja autodetects number of CPUs, we respect
630 + # user's options, for debugging with -j 1 or any other reason.
631 + eninja -C out/Release chrome chromedriver
632 + use suid && eninja -C out/Release chrome_sandbox
633 +
634 + pax-mark m out/Release/chrome
635 +}
636 +
637 +src_install() {
638 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
639 + exeinto "${CHROMIUM_HOME}"
640 + doexe out/Release/chrome
641 +
642 + if use suid; then
643 + newexe out/Release/chrome_sandbox chrome-sandbox
644 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
645 + fi
646 +
647 + doexe out/Release/chromedriver
648 +
649 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
650 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
651 + doexe chromium-launcher.sh
652 +
653 + # It is important that we name the target "chromium-browser",
654 + # xdg-utils expect it; bug #355517.
655 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
656 + # keep the old symlink around for consistency
657 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
658 +
659 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
660 +
661 + # Allow users to override command-line options, bug #357629.
662 + insinto /etc/chromium
663 + newins "${FILESDIR}/chromium.default" "default"
664 +
665 + pushd out/Release/locales > /dev/null || die
666 + chromium_remove_language_paks
667 + popd
668 +
669 + if use widevine; then
670 + # These will be provided by chrome-binary-plugins
671 + rm out/Release/libwidevinecdm*.so || die
672 + fi
673 +
674 + insinto "${CHROMIUM_HOME}"
675 + doins out/Release/*.bin
676 + doins out/Release/*.pak
677 + doins out/Release/*.so
678 +
679 + if ! use system-icu; then
680 + doins out/Release/icudtl.dat
681 + fi
682 +
683 + doins -r out/Release/locales
684 + doins -r out/Release/resources
685 +
686 + if [[ -d out/Release/swiftshader ]]; then
687 + insinto "${CHROMIUM_HOME}/swiftshader"
688 + doins out/Release/swiftshader/*.so
689 + fi
690 +
691 + # Install icons and desktop entry.
692 + local branding size
693 + for size in 16 22 24 32 48 64 128 256 ; do
694 + case ${size} in
695 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
696 + *) branding="chrome/app/theme/chromium" ;;
697 + esac
698 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
699 + chromium-browser.png
700 + done
701 +
702 + local mime_types="text/html;text/xml;application/xhtml+xml;"
703 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
704 + mime_types+="x-scheme-handler/ftp;" # bug #412185
705 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
706 + make_desktop_entry \
707 + chromium-browser \
708 + "Chromium" \
709 + chromium-browser \
710 + "Network;WebBrowser" \
711 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
712 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
713 +
714 + # Install GNOME default application entry (bug #303100).
715 + insinto /usr/share/gnome-control-center/default-apps
716 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
717 +
718 + readme.gentoo_create_doc
719 +}
720 +
721 +pkg_preinst() {
722 + gnome2_icon_savelist
723 +}
724 +
725 +pkg_postrm() {
726 + gnome2_icon_cache_update
727 + xdg_desktop_database_update
728 +}
729 +
730 +pkg_postinst() {
731 + gnome2_icon_cache_update
732 + xdg_desktop_database_update
733 + readme.gentoo_print_elog
734 +}