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