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, 07 Feb 2018 19:09:25
Message-Id: 1518030553.c34acc217ab6b0181556dface2efbac0c14f756f.floppym@gentoo
1 commit: c34acc217ab6b0181556dface2efbac0c14f756f
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 7 19:08:30 2018 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 7 19:09:13 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c34acc21
7
8 www-client/chromium: stable channel bump (64.0.3282.140)
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6_p81
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-64.0.3282.140.ebuild | 678 ++++++++++++++++++++++
14 2 files changed, 679 insertions(+)
15
16 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
17 index 3d6c3460ac7..213aa81b660 100644
18 --- a/www-client/chromium/Manifest
19 +++ b/www-client/chromium/Manifest
20 @@ -1,6 +1,7 @@
21 DIST chromium-63.0.3239.108.tar.xz 534294640 BLAKE2B f0f87115e91d7a2aa331cbab05475cac098f6ec37b8ca82b6a84911edcf0104a89557304467704911a3f3b3232d8a83d575bd545df1c31518e50c2563d83c095 SHA512 3cb7c8569d2d061f5abf4ad68d9ea1716a1b07bdf8dfa7b600d558d308374ff5dbda9f947e67e21186e3e716fe9524fc63e8eabd9eac1fa805f0eb7d994c32c8
22 DIST chromium-63.0.3239.132.tar.xz 534286424 BLAKE2B 52658d4e8ff50bb8bdb1d397bc90a36e73407810198c4f28eea29bd0a4ad98bd4af947bdb8a5ecdbd73a248be8f375ba80c74c9a097aa57ef51eed1dc440ff95 SHA512 96e9ebdf1c3dc14a914bee50ced9547d5a94838ed602552379711ba67f00381173059ceb8a552efadd3175ceaa4cb6c15902fe582fc2eba7b7bdb8a19f47d1a0
23 DIST chromium-64.0.3282.119.tar.xz 482256308 BLAKE2B 786a03cfa5affbf1d3e0b69d6094ca1bdea953cd88a91c8f9df50c35e01f7d24908cb986f59672f904c693027778b01437a68eba2b0f57a328f6091bedaa6b55 SHA512 5ad3e110dcecd8f37a98c32ff8837e6b1f81c3375afdcb03c0375aebe148a2f2f49b6dc91bd3565d25e29bc587fbc9721062d2f04cee647b3cfdadd03437865a
24 +DIST chromium-64.0.3282.140.tar.xz 482252896 BLAKE2B 68d71353fca6f6022119baeeb4db42722d82a9f2d2c1738b372cc8d35b58ee5fada8af96b08ffc3599555b4f9f41be29eed2df3cc43ce4e5f3a94db07ac8efff SHA512 84a559e594d544ce3784b2d30831bd0cf4ef04896c0d107793b158f996aac0a41b731ed0c0fb751da2e06de7202df8235348468ff28fb4aef6e8cfb56ab0d89d
25 DIST chromium-64.0.3282.85.tar.xz 482224568 BLAKE2B f8650721a2a30ea7f9c651efab58c54a225d7dda177c924c2ade132d488bb4b415e6155426384a005bafbcff5affbc99e142f45c85042cc6367e17c88c806f12 SHA512 52842b4f8304b4eb4e8fb25b586e0d03af5a5d0aebe2fc9ae517f97e05ee5ece3f71fd2b48a4f148fccec859b13c98a669ccbb4183d99ebd3bcf7e617ca241d0
26 DIST chromium-65.0.3298.3.tar.xz 485716108 BLAKE2B 185b3f683b2a732343fa5f98b24171f1d3cf2cf8eeb63c56efa7699f6b038d2a7eea4f9277b0b7ee2fdfa207a4f13edbaf2cc9a591a79ec4d058a131ce44366b SHA512 f1ed9a403036e87da7897f173eeb1aa71fe2650efc5ef5b98f814c7d4d9c879971597f9ded11324c86d6edc7f12f3bcf2786a6fb022e9697dbdb8eae086e18b7
27 DIST chromium-65.0.3315.3.tar.xz 532475512 BLAKE2B 1a118ddd05f2b939ff0fd84f85e1c22789713351776d889bafb55ddb2b897b2921050a3df3b7d5e3224be84539d95dddce1a27a948c61b29c788ed9f8e194e02 SHA512 c7f0feda90c0df15058473d39482e9b9a9b3236dcb90ff8ba7ad53afde2fce4901b2cbd678d8470560cc0cb6e31c8d3caee9f0a9f100d82d95feacabcdb7f8ce
28
29 diff --git a/www-client/chromium/chromium-64.0.3282.140.ebuild b/www-client/chromium/chromium-64.0.3282.140.ebuild
30 new file mode 100644
31 index 00000000000..f9d0c892ec1
32 --- /dev/null
33 +++ b/www-client/chromium/chromium-64.0.3282.140.ebuild
34 @@ -0,0 +1,678 @@
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI="6"
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 eutils gnome2-utils flag-o-matic multilib ninja-utils pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs versionator 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 ~arm ~arm64 ~x86"
54 +IUSE="component-build cups gnome-keyring +hangouts jumbo-build kerberos neon pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +system-libvpx +tcmalloc widevine"
55 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
56 +
57 +COMMON_DEPEND="
58 + app-accessibility/at-spi2-atk:2
59 + app-arch/bzip2:=
60 + cups? ( >=net-print/cups-1.3.11:= )
61 + dev-libs/atk
62 + dev-libs/expat:=
63 + dev-libs/glib:2
64 + system-icu? ( >=dev-libs/icu-59:= )
65 + >=dev-libs/libxml2-2.9.4-r3:=[icu]
66 + dev-libs/libxslt:=
67 + dev-libs/nspr:=
68 + >=dev-libs/nss-3.26:=
69 + >=dev-libs/re2-0.2016.05.01:=
70 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
71 + >=media-libs/alsa-lib-1.0.19:=
72 + media-libs/fontconfig:=
73 + media-libs/freetype:=
74 + >=media-libs/harfbuzz-1.5.0:=[icu(-)]
75 + media-libs/libjpeg-turbo:=
76 + media-libs/libpng:=
77 + system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
78 + >=media-libs/openh264-1.6.0:=
79 + pulseaudio? ( media-sound/pulseaudio:= )
80 + system-ffmpeg? (
81 + >=media-video/ffmpeg-3:=
82 + || (
83 + media-video/ffmpeg[-samba]
84 + >=net-fs/samba-4.5.10-r1[-debug(-)]
85 + )
86 + !=net-fs/samba-4.5.12
87 + media-libs/opus:=
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 + !=www-client/chromium-9999
116 + !<www-plugins/chrome-binary-plugins-57
117 + x11-misc/xdg-utils
118 + virtual/opengl
119 + virtual/ttf-fonts
120 + selinux? ( sec-policy/selinux-chromium )
121 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
122 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
123 +"
124 +# dev-vcs/git - https://bugs.gentoo.org/593476
125 +# sys-apps/sandbox - https://crbug.com/586444
126 +DEPEND="${COMMON_DEPEND}
127 + >=app-arch/gzip-1.7
128 + !arm? (
129 + dev-lang/yasm
130 + )
131 + dev-lang/perl
132 + >=dev-util/gperf-3.0.3
133 + >=dev-util/ninja-1.7.2
134 + >=net-libs/nodejs-6.9.4
135 + sys-apps/hwids[usb(+)]
136 + >=sys-devel/bison-2.4.3
137 + sys-devel/flex
138 + virtual/pkgconfig
139 + dev-vcs/git
140 + $(python_gen_any_dep '
141 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
142 + >=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]
143 + dev-python/html5lib[${PYTHON_USEDEP}]
144 + dev-python/simplejson[${PYTHON_USEDEP}]
145 + ')
146 +"
147 +
148 +# Keep this in sync with the python_gen_any_dep call.
149 +python_check_deps() {
150 + has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
151 + has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
152 + has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
153 + has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
154 +}
155 +
156 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
157 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
158 +fi
159 +
160 +DISABLE_AUTOFORMATTING="yes"
161 +DOC_CONTENTS="
162 +Some web pages may require additional fonts to display properly.
163 +Try installing some of the following packages if some characters
164 +are not displayed properly:
165 +- media-fonts/arphicfonts
166 +- media-fonts/bitstream-cyberbit
167 +- media-fonts/droid
168 +- media-fonts/ipamonafont
169 +- media-fonts/noto
170 +- media-fonts/ja-ipafonts
171 +- media-fonts/takao-fonts
172 +- media-fonts/wqy-microhei
173 +- media-fonts/wqy-zenhei
174 +
175 +To fix broken icons on the Downloads page, you should install an icon
176 +theme that covers the appropriate MIME types, and configure this as your
177 +GTK+ icon theme.
178 +"
179 +
180 +PATCHES=(
181 + "${FILESDIR}/chromium-widevine-r1.patch"
182 + "${FILESDIR}/chromium-FORTIFY_SOURCE-r2.patch"
183 + "${FILESDIR}/chromium-webrtc-r0.patch"
184 + "${FILESDIR}/chromium-memcpy-r0.patch"
185 + "${FILESDIR}/chromium-cups-r0.patch"
186 + "${FILESDIR}/chromium-clang-r2.patch"
187 + "${FILESDIR}/chromium-angle-r0.patch"
188 +)
189 +
190 +pre_build_checks() {
191 + if [[ ${MERGE_TYPE} != binary ]]; then
192 + local -x CPP="$(tc-getCXX) -E"
193 + if tc-is-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
194 + # bugs: #601654
195 + die "At least clang 3.9.1 is required"
196 + fi
197 + if tc-is-gcc && ! version_is_at_least 5.0 "$(gcc-version)"; then
198 + # bugs: #535730, #525374, #518668, #600288, #627356
199 + die "At least gcc 5.0 is required"
200 + fi
201 + fi
202 +
203 + # Check build requirements, bug #541816 and bug #471810 .
204 + CHECKREQS_MEMORY="3G"
205 + CHECKREQS_DISK_BUILD="5G"
206 + eshopts_push -s extglob
207 + if is-flagq '-g?(gdb)?([1-9])'; then
208 + CHECKREQS_DISK_BUILD="25G"
209 + if ! use component-build; then
210 + CHECKREQS_MEMORY="16G"
211 + fi
212 + fi
213 + eshopts_pop
214 + check-reqs_pkg_setup
215 +}
216 +
217 +pkg_pretend() {
218 + pre_build_checks
219 +}
220 +
221 +pkg_setup() {
222 + pre_build_checks
223 +
224 + chromium_suid_sandbox_check_kernel_config
225 +}
226 +
227 +src_prepare() {
228 + # Calling this here supports resumption via FEATURES=keepwork
229 + python_setup
230 +
231 + default
232 +
233 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
234 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
235 +
236 + local keeplibs=(
237 + base/third_party/dmg_fp
238 + base/third_party/dynamic_annotations
239 + base/third_party/icu
240 + base/third_party/nspr
241 + base/third_party/superfasthash
242 + base/third_party/symbolize
243 + base/third_party/valgrind
244 + base/third_party/xdg_mime
245 + base/third_party/xdg_user_dirs
246 + chrome/third_party/mozilla_security_manager
247 + courgette/third_party
248 + net/third_party/mozilla_security_manager
249 + net/third_party/nss
250 + third_party/WebKit
251 + third_party/analytics
252 + third_party/angle
253 + third_party/angle/src/common/third_party/base
254 + third_party/angle/src/common/third_party/smhasher
255 + third_party/angle/src/third_party/compiler
256 + third_party/angle/src/third_party/libXNVCtrl
257 + third_party/angle/src/third_party/trace_event
258 + third_party/blink
259 + third_party/boringssl
260 + third_party/boringssl/src/third_party/fiat
261 + third_party/breakpad
262 + third_party/breakpad/breakpad/src/third_party/curl
263 + third_party/brotli
264 + third_party/cacheinvalidation
265 + third_party/catapult
266 + third_party/catapult/common/py_vulcanize/third_party/rcssmin
267 + third_party/catapult/common/py_vulcanize/third_party/rjsmin
268 + third_party/catapult/third_party/polymer
269 + third_party/catapult/tracing/third_party/d3
270 + third_party/catapult/tracing/third_party/gl-matrix
271 + third_party/catapult/tracing/third_party/jszip
272 + third_party/catapult/tracing/third_party/mannwhitneyu
273 + third_party/catapult/tracing/third_party/oboe
274 + third_party/catapult/tracing/third_party/pako
275 + third_party/ced
276 + third_party/cld_3
277 + third_party/crc32c
278 + third_party/cros_system_api
279 + third_party/devscripts
280 + third_party/dom_distiller_js
281 + third_party/fips181
282 + third_party/flatbuffers
283 + third_party/flot
284 + third_party/freetype
285 + third_party/glslang-angle
286 + third_party/google_input_tools
287 + third_party/google_input_tools/third_party/closure_library
288 + third_party/google_input_tools/third_party/closure_library/third_party/closure
289 + third_party/googletest
290 + third_party/hunspell
291 + third_party/iccjpeg
292 + third_party/inspector_protocol
293 + third_party/jinja2
294 + third_party/jstemplate
295 + third_party/khronos
296 + third_party/leveldatabase
297 + third_party/libXNVCtrl
298 + third_party/libaddressinput
299 + third_party/libjingle
300 + third_party/libphonenumber
301 + third_party/libsecret
302 + third_party/libsrtp
303 + third_party/libudev
304 + third_party/libwebm
305 + third_party/libxml/chromium
306 + third_party/libyuv
307 + third_party/lss
308 + third_party/lzma_sdk
309 + third_party/markupsafe
310 + third_party/mesa
311 + third_party/metrics_proto
312 + third_party/modp_b64
313 + third_party/mt19937ar
314 + third_party/node
315 + third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2
316 + third_party/openmax_dl
317 + third_party/ots
318 + third_party/pdfium
319 + third_party/pdfium/third_party/agg23
320 + third_party/pdfium/third_party/base
321 + third_party/pdfium/third_party/build
322 + third_party/pdfium/third_party/bigint
323 + third_party/pdfium/third_party/freetype
324 + third_party/pdfium/third_party/lcms
325 + third_party/pdfium/third_party/libopenjpeg20
326 + third_party/pdfium/third_party/libpng16
327 + third_party/pdfium/third_party/libtiff
328 + third_party/ply
329 + third_party/polymer
330 + third_party/protobuf
331 + third_party/protobuf/third_party/six
332 + third_party/qcms
333 + third_party/sfntly
334 + third_party/skia
335 + third_party/skia/third_party/gif
336 + third_party/skia/third_party/vulkan
337 + third_party/smhasher
338 + third_party/spirv-headers
339 + third_party/spirv-tools-angle
340 + third_party/sqlite
341 + third_party/swiftshader
342 + third_party/swiftshader/third_party/llvm-subzero
343 + third_party/swiftshader/third_party/subzero
344 + third_party/usrsctp
345 + third_party/vulkan
346 + third_party/vulkan-validation-layers
347 + third_party/web-animations-js
348 + third_party/webdriver
349 + third_party/webrtc
350 + third_party/widevine
351 + third_party/woff2
352 + third_party/zlib/google
353 + url/third_party/mozilla
354 + v8/src/third_party/valgrind
355 + v8/third_party/inspector_protocol
356 +
357 + # gyp -> gn leftovers
358 + base/third_party/libevent
359 + third_party/adobe
360 + third_party/speech-dispatcher
361 + third_party/usb_ids
362 + third_party/xdg-utils
363 + third_party/yasm/run_yasm.py
364 + )
365 + if ! use system-ffmpeg; then
366 + keeplibs+=( third_party/ffmpeg third_party/opus )
367 + fi
368 + if ! use system-icu; then
369 + keeplibs+=( third_party/icu )
370 + fi
371 + if ! use system-libvpx; then
372 + keeplibs+=( third_party/libvpx )
373 + keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc )
374 + fi
375 + if use tcmalloc; then
376 + keeplibs+=( third_party/tcmalloc )
377 + fi
378 +
379 + # Remove most bundled libraries. Some are still needed.
380 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
381 +}
382 +
383 +bootstrap_gn() {
384 + if tc-is-cross-compiler; then
385 + local -x AR=${BUILD_AR}
386 + local -x CC=${BUILD_CC}
387 + local -x CXX=${BUILD_CXX}
388 + local -x NM=${BUILD_NM}
389 + local -x CFLAGS=${BUILD_CFLAGS}
390 + local -x CXXFLAGS=${BUILD_CXXFLAGS}
391 + local -x LDFLAGS=${BUILD_LDFLAGS}
392 + fi
393 + einfo "Building GN..."
394 + set -- tools/gn/bootstrap/bootstrap.py -s -v --no-clean
395 + echo "$@"
396 + "$@" || die
397 +}
398 +
399 +src_configure() {
400 + # Calling this here supports resumption via FEATURES=keepwork
401 + python_setup
402 +
403 + local myconf_gn=""
404 +
405 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
406 + myconf_gn+=" is_debug=false"
407 +
408 + # Component build isn't generally intended for use by end users. It's mostly useful
409 + # for development and debugging.
410 + myconf_gn+=" is_component_build=$(usex component-build true false)"
411 +
412 + # https://chromium.googlesource.com/chromium/src/+/lkcr/docs/jumbo.md
413 + myconf_gn+=" use_jumbo_build=$(usex jumbo-build true false)"
414 +
415 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
416 +
417 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
418 + myconf_gn+=" enable_nacl=false"
419 +
420 + # Use system-provided libraries.
421 + # TODO: freetype (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
422 + # TODO: use_system_hunspell (upstream changes needed).
423 + # TODO: use_system_libsrtp (bug #459932).
424 + # TODO: use_system_protobuf (bug #525560).
425 + # TODO: use_system_ssl (http://crbug.com/58087).
426 + # TODO: use_system_sqlite (http://crbug.com/22208).
427 +
428 + # libevent: https://bugs.gentoo.org/593458
429 + local gn_system_libraries=(
430 + flac
431 + # Need harfbuzz_from_pkgconfig target
432 + #harfbuzz-ng
433 + libdrm
434 + libjpeg
435 + libpng
436 + libwebp
437 + libxml
438 + libxslt
439 + openh264
440 + re2
441 + snappy
442 + yasm
443 + zlib
444 + )
445 + if use system-ffmpeg; then
446 + gn_system_libraries+=( ffmpeg opus )
447 + fi
448 + if use system-icu; then
449 + gn_system_libraries+=( icu )
450 + fi
451 + if use system-libvpx; then
452 + gn_system_libraries+=( libvpx )
453 + fi
454 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
455 +
456 + # See dependency logic in third_party/BUILD.gn
457 + myconf_gn+=" use_system_harfbuzz=true"
458 +
459 + # Optional dependencies.
460 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
461 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
462 + myconf_gn+=" use_cups=$(usex cups true false)"
463 + myconf_gn+=" use_gconf=false"
464 + myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
465 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
466 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
467 +
468 + # TODO: link_pulseaudio=true for GN.
469 +
470 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
471 +
472 + if tc-is-clang; then
473 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
474 + else
475 + myconf_gn+=" is_clang=false"
476 + fi
477 +
478 + # Never use bundled gold binary. Disable gold linker flags for now.
479 + # Do not use bundled clang.
480 + # Trying to use gold results in linker crash.
481 + myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false use_custom_libcxx=false"
482 +
483 + # Disable forced lld, bug 641556
484 + myconf_gn+=" use_lld=false"
485 +
486 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
487 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
488 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
489 +
490 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
491 + # Note: these are for Gentoo use ONLY. For your own distribution,
492 + # please get your own set of keys. Feel free to contact chromium@g.o
493 + # for more info.
494 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
495 + local google_default_client_id="329227923882.apps.googleusercontent.com"
496 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
497 + myconf_gn+=" google_api_key=\"${google_api_key}\""
498 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
499 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
500 +
501 + local myarch="$(tc-arch)"
502 + if [[ $myarch = amd64 ]] ; then
503 + myconf_gn+=" target_cpu=\"x64\""
504 + ffmpeg_target_arch=x64
505 + elif [[ $myarch = x86 ]] ; then
506 + myconf_gn+=" target_cpu=\"x86\""
507 + ffmpeg_target_arch=ia32
508 + elif [[ $myarch = arm64 ]] ; then
509 + myconf_gn+=" target_cpu=\"arm64\""
510 + ffmpeg_target_arch=arm64
511 + elif [[ $myarch = arm ]] ; then
512 + myconf_gn+=" target_cpu=\"arm\""
513 + ffmpeg_target_arch=$(usex neon arm-neon arm)
514 + else
515 + die "Failed to determine target arch, got '$myarch'."
516 + fi
517 +
518 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
519 + # Depending on GCC version the warnings are different and we don't want
520 + # the build to fail because of that.
521 + myconf_gn+=" treat_warnings_as_errors=false"
522 +
523 + # Disable fatal linker warnings, bug 506268.
524 + myconf_gn+=" fatal_linker_warnings=false"
525 +
526 + # Avoid CFLAGS problems, bug #352457, bug #390147.
527 + if ! use custom-cflags; then
528 + replace-flags "-Os" "-O2"
529 + strip-flags
530 +
531 + # Prevent linker from running out of address space, bug #471810 .
532 + if use x86; then
533 + filter-flags "-g*"
534 + fi
535 +
536 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
537 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
538 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
539 + fi
540 + fi
541 +
542 + # Make sure the build system will use the right tools, bug #340795.
543 + tc-export AR CC CXX NM
544 +
545 + # Define a custom toolchain for GN
546 + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
547 +
548 + if tc-is-cross-compiler; then
549 + tc-export BUILD_{AR,CC,CXX,NM}
550 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
551 + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
552 + else
553 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
554 + fi
555 +
556 + # https://bugs.gentoo.org/588596
557 + append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks)
558 +
559 + # Bug 491582.
560 + export TMPDIR="${WORKDIR}/temp"
561 + mkdir -p -m 755 "${TMPDIR}" || die
562 +
563 + if ! use system-ffmpeg; then
564 + local build_ffmpeg_args=""
565 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
566 + build_ffmpeg_args+=" --disable-asm"
567 + fi
568 +
569 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
570 + einfo "Configuring bundled ffmpeg..."
571 + pushd third_party/ffmpeg > /dev/null || die
572 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
573 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
574 + chromium/scripts/copy_config.sh || die
575 + chromium/scripts/generate_gn.py || die
576 + popd > /dev/null || die
577 + fi
578 +
579 + bootstrap_gn
580 +
581 + einfo "Configuring Chromium..."
582 + set -- out/Release/gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
583 + echo "$@"
584 + "$@" || die
585 +}
586 +
587 +src_compile() {
588 + # Calling this here supports resumption via FEATURES=keepwork
589 + python_setup
590 +
591 + # Build mksnapshot and pax-mark it.
592 + local x
593 + for x in mksnapshot v8_context_snapshot_generator; do
594 + if tc-is-cross-compiler; then
595 + eninja -C out/Release "host/${x}"
596 + pax-mark m "out/Release/host/${x}"
597 + else
598 + eninja -C out/Release "${x}"
599 + pax-mark m "out/Release/${x}"
600 + fi
601 + done
602 +
603 + # Work around circular dep issue
604 + # https://chromium-review.googlesource.com/c/chromium/src/+/617768
605 + eninja -C out/Release gen/ui/accessibility/ax_enums.h
606 +
607 + # Even though ninja autodetects number of CPUs, we respect
608 + # user's options, for debugging with -j 1 or any other reason.
609 + eninja -C out/Release chrome chromedriver
610 + use suid && eninja -C out/Release chrome_sandbox
611 +
612 + pax-mark m out/Release/chrome
613 +}
614 +
615 +src_install() {
616 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
617 + exeinto "${CHROMIUM_HOME}"
618 + doexe out/Release/chrome
619 +
620 + if use suid; then
621 + newexe out/Release/chrome_sandbox chrome-sandbox
622 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
623 + fi
624 +
625 + doexe out/Release/chromedriver
626 +
627 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
628 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
629 + doexe chromium-launcher.sh
630 +
631 + # It is important that we name the target "chromium-browser",
632 + # xdg-utils expect it; bug #355517.
633 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
634 + # keep the old symlink around for consistency
635 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
636 +
637 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
638 +
639 + # Allow users to override command-line options, bug #357629.
640 + insinto /etc/chromium
641 + newins "${FILESDIR}/chromium.default" "default"
642 +
643 + pushd out/Release/locales > /dev/null || die
644 + chromium_remove_language_paks
645 + popd
646 +
647 + if use widevine; then
648 + # These will be provided by chrome-binary-plugins
649 + rm out/Release/libwidevinecdm*.so || die
650 + fi
651 +
652 + insinto "${CHROMIUM_HOME}"
653 + doins out/Release/*.bin
654 + doins out/Release/*.pak
655 + doins out/Release/*.so
656 +
657 + if ! use system-icu; then
658 + doins out/Release/icudtl.dat
659 + fi
660 +
661 + doins -r out/Release/locales
662 + doins -r out/Release/resources
663 +
664 + if [[ -d out/Release/swiftshader ]]; then
665 + insinto "${CHROMIUM_HOME}/swiftshader"
666 + doins out/Release/swiftshader/*.so
667 + fi
668 +
669 + # Install icons and desktop entry.
670 + local branding size
671 + for size in 16 22 24 32 48 64 128 256 ; do
672 + case ${size} in
673 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
674 + *) branding="chrome/app/theme/chromium" ;;
675 + esac
676 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
677 + chromium-browser.png
678 + done
679 +
680 + local mime_types="text/html;text/xml;application/xhtml+xml;"
681 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
682 + mime_types+="x-scheme-handler/ftp;" # bug #412185
683 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
684 + make_desktop_entry \
685 + chromium-browser \
686 + "Chromium" \
687 + chromium-browser \
688 + "Network;WebBrowser" \
689 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
690 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
691 +
692 + # Install GNOME default application entry (bug #303100).
693 + insinto /usr/share/gnome-control-center/default-apps
694 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
695 +
696 + readme.gentoo_create_doc
697 +}
698 +
699 +pkg_preinst() {
700 + gnome2_icon_savelist
701 +}
702 +
703 +pkg_postrm() {
704 + gnome2_icon_cache_update
705 + xdg_desktop_database_update
706 +}
707 +
708 +pkg_postinst() {
709 + gnome2_icon_cache_update
710 + xdg_desktop_database_update
711 + readme.gentoo_print_elog
712 +}