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