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