Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/
Date: Sun, 11 Aug 2019 18:10:53
Message-Id: 1565547046.0f8b409485b7365f0ce2a3cd638ffc0695ae762e.floppym@gentoo
1 commit: 0f8b409485b7365f0ce2a3cd638ffc0695ae762e
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 11 18:10:32 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 11 18:10:46 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f8b4094
7
8 www-client/chromium: restore stable ebuild
9
10 Package-Manager: Portage-2.3.71, Repoman-2.3.16_p24
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 www-client/chromium/Manifest | 1 +
14 www-client/chromium/chromium-76.0.3809.87.ebuild | 719 +++++++++++++++++++++++
15 2 files changed, 720 insertions(+)
16
17 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
18 index 8b25d5d7a4b..acf7b4a3c1c 100644
19 --- a/www-client/chromium/Manifest
20 +++ b/www-client/chromium/Manifest
21 @@ -1,2 +1,3 @@
22 DIST chromium-76.0.3809.100.tar.xz 728852892 BLAKE2B 1bd80f7fd50f82843f9367bd8d5648bcbe4b763594679cc7f57084390da840cc89d7771ffd844e3d0a3c3248d8f98a1babecabaf4c3104fa7a89efed88eae608 SHA512 63cfb45dc6bb0b1662ba4ffebc6313c24d65dae10a61752575e34a24d8d3d6f80e0422a984b560b259c299d6e493dfa177907201a1c1f785a7e294c9a03bd8a1
23 +DIST chromium-76.0.3809.87.tar.xz 728890984 BLAKE2B d09b6b4dd84d6e2ad6a24602296bfab99294ca09c21553312fa55979eb308d1b3a42cc0e31b4e619cd19c0dfc38dda89bca3b5d2787a96b8836d720f0763f124 SHA512 f237cb794bff68cbc2ea3daadea2852df810543873ceaefa4be901702b3578ce7b23a0f083b76373de20e60ea2dc1245c58de0888fb6c72ca465bca0ee0e7c1a
24 DIST chromium-77.0.3865.10.tar.xz 733122900 BLAKE2B 23b3cf4b8d4ab8e99d2a1ed0ef56c40faaea64f74c359d56e3140c33f1cff5954d73077c0c48851bc6da332b7131770ab2379c5229d674021b7a0596f7c5e8c5 SHA512 d1d76accae2b7877b2ef6b5544b8aee074d55c36e67ff5816a5ddd48a7b7af77d8467341d2a410e899ea0d7e29bcfffd3887460482a3fb6e77ed31888d31f293
25
26 diff --git a/www-client/chromium/chromium-76.0.3809.87.ebuild b/www-client/chromium/chromium-76.0.3809.87.ebuild
27 new file mode 100644
28 index 00000000000..2771f0fc1ff
29 --- /dev/null
30 +++ b/www-client/chromium/chromium-76.0.3809.87.ebuild
31 @@ -0,0 +1,719 @@
32 +# Copyright 1999-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.2.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 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
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-0.1583
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-widevine-r4.patch"
177 + "${FILESDIR}/chromium-fix-char_traits.patch"
178 + "${FILESDIR}/chromium-angle-inline.patch"
179 + "${FILESDIR}/chromium-76-arm64-skia.patch"
180 + "${FILESDIR}/chromium-76-quiche.patch"
181 + "${FILESDIR}/chromium-76-gcc-vulkan.patch"
182 + "${FILESDIR}/chromium-76-gcc-private.patch"
183 + "${FILESDIR}/chromium-76-gcc-noexcept.patch"
184 + "${FILESDIR}/chromium-76-gcc-gl-init.patch"
185 + "${FILESDIR}/chromium-76-gcc-blink-namespace1.patch"
186 + "${FILESDIR}/chromium-76-gcc-blink-namespace2.patch"
187 + "${FILESDIR}/chromium-76-gcc-blink-constexpr.patch"
188 + "${FILESDIR}/chromium-76-gcc-uint32.patch"
189 + "${FILESDIR}/chromium-76-gcc-ambiguous-nodestructor.patch"
190 + "${FILESDIR}/chromium-76-gcc-include.patch"
191 + "${FILESDIR}/chromium-76-gcc-pure-virtual.patch"
192 +)
193 +
194 +pre_build_checks() {
195 + if [[ ${MERGE_TYPE} != binary ]]; then
196 + local -x CPP="$(tc-getCXX) -E"
197 + if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 8.0; then
198 + die "At least gcc 8.0 is required"
199 + fi
200 + fi
201 +
202 + # Check build requirements, bug #541816 and bug #471810 .
203 + CHECKREQS_MEMORY="3G"
204 + CHECKREQS_DISK_BUILD="7G"
205 + if ( shopt -s extglob; is-flagq '-g?(gdb)?([1-9])' ); then
206 + CHECKREQS_DISK_BUILD="25G"
207 + if ! use component-build; then
208 + CHECKREQS_MEMORY="16G"
209 + fi
210 + fi
211 + check-reqs_pkg_setup
212 +}
213 +
214 +pkg_pretend() {
215 + pre_build_checks
216 +}
217 +
218 +pkg_setup() {
219 + pre_build_checks
220 +
221 + chromium_suid_sandbox_check_kernel_config
222 +}
223 +
224 +src_prepare() {
225 + # Calling this here supports resumption via FEATURES=keepwork
226 + python_setup
227 +
228 + default
229 +
230 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
231 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
232 +
233 + local keeplibs=(
234 + base/third_party/cityhash
235 + base/third_party/dmg_fp
236 + base/third_party/dynamic_annotations
237 + base/third_party/icu
238 + base/third_party/nspr
239 + base/third_party/superfasthash
240 + base/third_party/symbolize
241 + base/third_party/valgrind
242 + base/third_party/xdg_mime
243 + base/third_party/xdg_user_dirs
244 + buildtools/third_party/libc++
245 + buildtools/third_party/libc++abi
246 + chrome/third_party/mozilla_security_manager
247 + courgette/third_party
248 + net/third_party/mozilla_security_manager
249 + net/third_party/nss
250 + net/third_party/quic
251 + net/third_party/uri_template
252 + third_party/abseil-cpp
253 + third_party/angle
254 + third_party/angle/src/common/third_party/base
255 + third_party/angle/src/common/third_party/smhasher
256 + third_party/angle/src/common/third_party/xxhash
257 + third_party/angle/src/third_party/compiler
258 + third_party/angle/src/third_party/libXNVCtrl
259 + third_party/angle/src/third_party/trace_event
260 + third_party/angle/third_party/glslang
261 + third_party/angle/third_party/spirv-headers
262 + third_party/angle/third_party/spirv-tools
263 + third_party/angle/third_party/vulkan-headers
264 + third_party/angle/third_party/vulkan-loader
265 + third_party/angle/third_party/vulkan-tools
266 + third_party/angle/third_party/vulkan-validation-layers
267 + third_party/apple_apsl
268 + third_party/axe-core
269 + third_party/blink
270 + third_party/boringssl
271 + third_party/boringssl/src/third_party/fiat
272 + third_party/boringssl/src/third_party/sike
273 + third_party/boringssl/linux-aarch64/crypto/third_party/sike
274 + third_party/boringssl/linux-x86_64/crypto/third_party/sike
275 + third_party/breakpad
276 + third_party/breakpad/breakpad/src/third_party/curl
277 + third_party/brotli
278 + third_party/cacheinvalidation
279 + third_party/catapult
280 + third_party/catapult/common/py_vulcanize/third_party/rcssmin
281 + third_party/catapult/common/py_vulcanize/third_party/rjsmin
282 + third_party/catapult/third_party/beautifulsoup4
283 + third_party/catapult/third_party/html5lib-python
284 + third_party/catapult/third_party/polymer
285 + third_party/catapult/third_party/six
286 + third_party/catapult/tracing/third_party/d3
287 + third_party/catapult/tracing/third_party/gl-matrix
288 + third_party/catapult/tracing/third_party/jszip
289 + third_party/catapult/tracing/third_party/mannwhitneyu
290 + third_party/catapult/tracing/third_party/oboe
291 + third_party/catapult/tracing/third_party/pako
292 + third_party/ced
293 + third_party/cld_3
294 + third_party/closure_compiler
295 + third_party/crashpad
296 + third_party/crashpad/crashpad/third_party/lss
297 + third_party/crashpad/crashpad/third_party/zlib
298 + third_party/crc32c
299 + third_party/cros_system_api
300 + third_party/dav1d
301 + third_party/dawn
302 + third_party/devscripts
303 + third_party/dom_distiller_js
304 + third_party/emoji-segmenter
305 + third_party/flatbuffers
306 + third_party/flot
307 + third_party/freetype
308 + third_party/glslang
309 + third_party/google_input_tools
310 + third_party/google_input_tools/third_party/closure_library
311 + third_party/google_input_tools/third_party/closure_library/third_party/closure
312 + third_party/googletest
313 + third_party/hunspell
314 + third_party/iccjpeg
315 + third_party/inspector_protocol
316 + third_party/jinja2
317 + third_party/jsoncpp
318 + third_party/jstemplate
319 + third_party/khronos
320 + third_party/leveldatabase
321 + third_party/libXNVCtrl
322 + third_party/libaddressinput
323 + third_party/libaom
324 + third_party/libaom/source/libaom/third_party/vector
325 + third_party/libaom/source/libaom/third_party/x86inc
326 + third_party/libjingle
327 + third_party/libphonenumber
328 + third_party/libsecret
329 + third_party/libsrtp
330 + third_party/libsync
331 + third_party/libudev
332 + third_party/libwebm
333 + third_party/libxml/chromium
334 + third_party/libyuv
335 + third_party/llvm
336 + third_party/lss
337 + third_party/lzma_sdk
338 + third_party/markupsafe
339 + third_party/mesa
340 + third_party/metrics_proto
341 + third_party/modp_b64
342 + third_party/nasm
343 + third_party/node
344 + third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2
345 + third_party/openscreen
346 + third_party/ots
347 + third_party/pdfium
348 + third_party/pdfium/third_party/agg23
349 + third_party/pdfium/third_party/base
350 + third_party/pdfium/third_party/bigint
351 + third_party/pdfium/third_party/freetype
352 + third_party/pdfium/third_party/lcms
353 + third_party/pdfium/third_party/libopenjpeg20
354 + third_party/pdfium/third_party/libpng16
355 + third_party/pdfium/third_party/libtiff
356 + third_party/pdfium/third_party/skia_shared
357 + third_party/perfetto
358 + third_party/pffft
359 + third_party/ply
360 + third_party/polymer
361 + third_party/protobuf
362 + third_party/protobuf/third_party/six
363 + third_party/pyjson5
364 + third_party/qcms
365 + third_party/rnnoise
366 + third_party/s2cellid
367 + third_party/sfntly
368 + third_party/simplejson
369 + third_party/skia
370 + third_party/skia/include/third_party/skcms
371 + third_party/skia/include/third_party/vulkan
372 + third_party/skia/third_party/gif
373 + third_party/skia/third_party/skcms
374 + third_party/skia/third_party/vulkan
375 + third_party/smhasher
376 + third_party/spirv-headers
377 + third_party/SPIRV-Tools
378 + third_party/sqlite
379 + third_party/swiftshader
380 + third_party/swiftshader/third_party/llvm-7.0
381 + third_party/swiftshader/third_party/llvm-subzero
382 + third_party/swiftshader/third_party/subzero
383 + third_party/unrar
384 + third_party/usrsctp
385 + third_party/vulkan
386 + third_party/web-animations-js
387 + third_party/webdriver
388 + third_party/webrtc
389 + third_party/webrtc/common_audio/third_party/fft4g
390 + third_party/webrtc/common_audio/third_party/spl_sqrt_floor
391 + third_party/webrtc/modules/third_party/fft
392 + third_party/webrtc/modules/third_party/g711
393 + third_party/webrtc/modules/third_party/g722
394 + third_party/webrtc/rtc_base/third_party/base64
395 + third_party/webrtc/rtc_base/third_party/sigslot
396 + third_party/widevine
397 + third_party/woff2
398 + third_party/zlib/google
399 + url/third_party/mozilla
400 + v8/src/third_party/siphash
401 + v8/src/third_party/valgrind
402 + v8/src/third_party/utf8-decoder
403 + v8/third_party/inspector_protocol
404 + v8/third_party/v8
405 +
406 + # gyp -> gn leftovers
407 + base/third_party/libevent
408 + third_party/adobe
409 + third_party/speech-dispatcher
410 + third_party/usb_ids
411 + third_party/xdg-utils
412 + third_party/yasm/run_yasm.py
413 + )
414 + if ! use system-ffmpeg; then
415 + keeplibs+=( third_party/ffmpeg third_party/opus )
416 + fi
417 + if ! use system-icu; then
418 + keeplibs+=( third_party/icu )
419 + fi
420 + if ! use system-libvpx; then
421 + keeplibs+=( third_party/libvpx )
422 + keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc )
423 + fi
424 + if use tcmalloc; then
425 + keeplibs+=( third_party/tcmalloc )
426 + fi
427 +
428 + # Remove most bundled libraries. Some are still needed.
429 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
430 +}
431 +
432 +src_configure() {
433 + # Calling this here supports resumption via FEATURES=keepwork
434 + python_setup
435 +
436 + local myconf_gn=""
437 +
438 + # Make sure the build system will use the right tools, bug #340795.
439 + tc-export AR CC CXX NM
440 +
441 + if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] && ! tc-is-clang; then
442 + # Force clang since gcc is pretty broken at the moment.
443 + CC=${CHOST}-clang
444 + CXX=${CHOST}-clang++
445 + strip-unsupported-flags
446 + fi
447 +
448 + if tc-is-clang; then
449 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
450 + else
451 + myconf_gn+=" is_clang=false"
452 + fi
453 +
454 + # Define a custom toolchain for GN
455 + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
456 +
457 + if tc-is-cross-compiler; then
458 + tc-export BUILD_{AR,CC,CXX,NM}
459 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
460 + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
461 + else
462 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
463 + fi
464 +
465 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
466 + myconf_gn+=" is_debug=false"
467 +
468 + # Component build isn't generally intended for use by end users. It's mostly useful
469 + # for development and debugging.
470 + myconf_gn+=" is_component_build=$(usex component-build true false)"
471 +
472 + # https://chromium.googlesource.com/chromium/src/+/lkcr/docs/jumbo.md
473 + myconf_gn+=" use_jumbo_build=$(usex jumbo-build true false)"
474 +
475 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
476 +
477 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
478 + myconf_gn+=" enable_nacl=false"
479 +
480 + # Use system-provided libraries.
481 + # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
482 + # TODO: use_system_hunspell (upstream changes needed).
483 + # TODO: use_system_libsrtp (bug #459932).
484 + # TODO: use_system_protobuf (bug #525560).
485 + # TODO: use_system_ssl (http://crbug.com/58087).
486 + # TODO: use_system_sqlite (http://crbug.com/22208).
487 +
488 + # libevent: https://bugs.gentoo.org/593458
489 + local gn_system_libraries=(
490 + flac
491 + fontconfig
492 + freetype
493 + # Need harfbuzz_from_pkgconfig target
494 + #harfbuzz-ng
495 + libdrm
496 + libjpeg
497 + libpng
498 + libwebp
499 + libxml
500 + libxslt
501 + openh264
502 + re2
503 + snappy
504 + yasm
505 + zlib
506 + )
507 + if use system-ffmpeg; then
508 + gn_system_libraries+=( ffmpeg opus )
509 + fi
510 + if use system-icu; then
511 + gn_system_libraries+=( icu )
512 + fi
513 + if use system-libvpx; then
514 + gn_system_libraries+=( libvpx )
515 + fi
516 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
517 +
518 + # See dependency logic in third_party/BUILD.gn
519 + myconf_gn+=" use_system_harfbuzz=true"
520 +
521 + # Optional dependencies.
522 + myconf_gn+=" closure_compile=$(usex closure-compile true false)"
523 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
524 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
525 + myconf_gn+=" use_cups=$(usex cups true false)"
526 + myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
527 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
528 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
529 +
530 + # TODO: link_pulseaudio=true for GN.
531 +
532 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
533 +
534 + # Never use bundled gold binary. Disable gold linker flags for now.
535 + # Do not use bundled clang.
536 + # Trying to use gold results in linker crash.
537 + myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false use_custom_libcxx=false"
538 +
539 + # Disable forced lld, bug 641556
540 + myconf_gn+=" use_lld=false"
541 +
542 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
543 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
544 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
545 +
546 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
547 + # Note: these are for Gentoo use ONLY. For your own distribution,
548 + # please get your own set of keys. Feel free to contact chromium@g.o
549 + # for more info.
550 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
551 + local google_default_client_id="329227923882.apps.googleusercontent.com"
552 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
553 + myconf_gn+=" google_api_key=\"${google_api_key}\""
554 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
555 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
556 +
557 + local myarch="$(tc-arch)"
558 +
559 + # Avoid CFLAGS problems, bug #352457, bug #390147.
560 + if ! use custom-cflags; then
561 + replace-flags "-Os" "-O2"
562 + strip-flags
563 +
564 + # Prevent linker from running out of address space, bug #471810 .
565 + if use x86; then
566 + filter-flags "-g*"
567 + fi
568 +
569 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
570 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
571 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
572 + fi
573 + fi
574 +
575 + if [[ $myarch = amd64 ]] ; then
576 + myconf_gn+=" target_cpu=\"x64\""
577 + ffmpeg_target_arch=x64
578 + elif [[ $myarch = x86 ]] ; then
579 + myconf_gn+=" target_cpu=\"x86\""
580 + ffmpeg_target_arch=ia32
581 +
582 + # This is normally defined by compiler_cpu_abi in
583 + # build/config/compiler/BUILD.gn, but we patch that part out.
584 + append-flags -msse2 -mfpmath=sse -mmmx
585 + elif [[ $myarch = arm64 ]] ; then
586 + myconf_gn+=" target_cpu=\"arm64\""
587 + ffmpeg_target_arch=arm64
588 + elif [[ $myarch = arm ]] ; then
589 + myconf_gn+=" target_cpu=\"arm\""
590 + ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm)
591 + else
592 + die "Failed to determine target arch, got '$myarch'."
593 + fi
594 +
595 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
596 + # Depending on GCC version the warnings are different and we don't want
597 + # the build to fail because of that.
598 + myconf_gn+=" treat_warnings_as_errors=false"
599 +
600 + # Disable fatal linker warnings, bug 506268.
601 + myconf_gn+=" fatal_linker_warnings=false"
602 +
603 + # Bug 491582.
604 + export TMPDIR="${WORKDIR}/temp"
605 + mkdir -p -m 755 "${TMPDIR}" || die
606 +
607 + # https://bugs.gentoo.org/654216
608 + addpredict /dev/dri/ #nowarn
609 +
610 + #if ! use system-ffmpeg; then
611 + if false; then
612 + local build_ffmpeg_args=""
613 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
614 + build_ffmpeg_args+=" --disable-asm"
615 + fi
616 +
617 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
618 + einfo "Configuring bundled ffmpeg..."
619 + pushd third_party/ffmpeg > /dev/null || die
620 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
621 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
622 + chromium/scripts/copy_config.sh || die
623 + chromium/scripts/generate_gn.py || die
624 + popd > /dev/null || die
625 + fi
626 +
627 + einfo "Configuring Chromium..."
628 + set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
629 + echo "$@"
630 + "$@" || die
631 +}
632 +
633 +src_compile() {
634 + # Final link uses lots of file descriptors.
635 + ulimit -n 2048
636 +
637 + # Calling this here supports resumption via FEATURES=keepwork
638 + python_setup
639 +
640 + #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
641 +
642 + # Build mksnapshot and pax-mark it.
643 + local x
644 + for x in mksnapshot v8_context_snapshot_generator; do
645 + if tc-is-cross-compiler; then
646 + eninja -C out/Release "host/${x}"
647 + pax-mark m "out/Release/host/${x}"
648 + else
649 + eninja -C out/Release "${x}"
650 + pax-mark m "out/Release/${x}"
651 + fi
652 + done
653 +
654 + # Even though ninja autodetects number of CPUs, we respect
655 + # user's options, for debugging with -j 1 or any other reason.
656 + eninja -C out/Release chrome chromedriver
657 + use suid && eninja -C out/Release chrome_sandbox
658 +
659 + pax-mark m out/Release/chrome
660 +}
661 +
662 +src_install() {
663 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
664 + exeinto "${CHROMIUM_HOME}"
665 + doexe out/Release/chrome
666 +
667 + if use suid; then
668 + newexe out/Release/chrome_sandbox chrome-sandbox
669 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
670 + fi
671 +
672 + doexe out/Release/chromedriver
673 +
674 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
675 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
676 + doexe chromium-launcher.sh
677 +
678 + # It is important that we name the target "chromium-browser",
679 + # xdg-utils expect it; bug #355517.
680 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
681 + # keep the old symlink around for consistency
682 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
683 +
684 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
685 +
686 + # Allow users to override command-line options, bug #357629.
687 + insinto /etc/chromium
688 + newins "${FILESDIR}/chromium.default" "default"
689 +
690 + pushd out/Release/locales > /dev/null || die
691 + chromium_remove_language_paks
692 + popd
693 +
694 + insinto "${CHROMIUM_HOME}"
695 + doins out/Release/*.bin
696 + doins out/Release/*.pak
697 + doins out/Release/*.so
698 +
699 + if ! use system-icu; then
700 + doins out/Release/icudtl.dat
701 + fi
702 +
703 + doins -r out/Release/locales
704 + doins -r out/Release/resources
705 +
706 + if [[ -d out/Release/swiftshader ]]; then
707 + insinto "${CHROMIUM_HOME}/swiftshader"
708 + doins out/Release/swiftshader/*.so
709 + fi
710 +
711 + # Install icons and desktop entry.
712 + local branding size
713 + for size in 16 22 24 32 48 64 128 256 ; do
714 + case ${size} in
715 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
716 + *) branding="chrome/app/theme/chromium" ;;
717 + esac
718 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
719 + chromium-browser.png
720 + done
721 +
722 + local mime_types="text/html;text/xml;application/xhtml+xml;"
723 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
724 + mime_types+="x-scheme-handler/ftp;" # bug #412185
725 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
726 + make_desktop_entry \
727 + chromium-browser \
728 + "Chromium" \
729 + chromium-browser \
730 + "Network;WebBrowser" \
731 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
732 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
733 +
734 + # Install GNOME default application entry (bug #303100).
735 + insinto /usr/share/gnome-control-center/default-apps
736 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
737 +
738 + readme.gentoo_create_doc
739 +}
740 +
741 +pkg_postrm() {
742 + xdg_icon_cache_update
743 + xdg_desktop_database_update
744 +}
745 +
746 +pkg_postinst() {
747 + xdg_icon_cache_update
748 + xdg_desktop_database_update
749 + readme.gentoo_print_elog
750 +}