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