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