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