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