Gentoo Archives: gentoo-commits

From: "Paweł Hajdan" <phajdan.jr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/
Date: Wed, 08 Feb 2017 11:56:34
Message-Id: 1486554957.a52173b342212c4962006369dcfa4899db3e227e.phajdan.jr@gentoo
1 commit: a52173b342212c4962006369dcfa4899db3e227e
2 Author: Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 8 11:50:48 2017 +0000
4 Commit: Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 8 11:55:57 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a52173b3
7
8 www-client/chromium: dev channel bump (58.0.3004.3)
9
10 www-client/chromium/Manifest | 1 +
11 www-client/chromium/chromium-58.0.3004.3.ebuild | 651 ++++++++++++++++++++++++
12 2 files changed, 652 insertions(+)
13
14 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
15 index ef9b60bb84..25ab82927d 100644
16 --- a/www-client/chromium/Manifest
17 +++ b/www-client/chromium/Manifest
18 @@ -2,3 +2,4 @@ DIST chromium-55.0.2883.75.tar.xz 511256096 SHA256 5bcf7180935bebc7648f7e2577f61
19 DIST chromium-56.0.2924.76.tar.xz 513487700 SHA256 cfb08e226b9c16ad887eb96d715a9cc4ab097d1a79e2e68c8749a7a4164b3c38 SHA512 ddcb2f0c76bdad3b87dc9219367764cb9adb900d7581dc5a371184ebfe2581f6ecbfc9aae02115e87291a5b90587fc145dada2b0940ae60fc19d25f5c505022d WHIRLPOOL db244681d9b1e325179328a64fb46ffb7a2492b48bafc327500ef491a676d3783cdf4ba400283c0c7a505958d376f784c35d28f4418557d6ba4cdd6bcf2cd5e9
20 DIST chromium-57.0.2987.13.tar.xz 521667288 SHA256 61b7501202b79e07fe435d1402c89195c3ac34e12e494d1f5cdfc91a09d3ccb8 SHA512 8f5d59f02b7b5c079ca891f99aa8ebbdfdb9ecf63482bd5ff8e027e31c6ea62021bd35b827058e9c6187a6c6c1d91fc8fec2e7664ae5530660cb0f2563e26162 WHIRLPOOL cf16c4e09e61586b03358f240b1b6aa86fc0e46381dd1e07e0f0d220625e3ec957dcafb03b88a2a78ed9fa6ca13902bbb9bbe66a93dec0a1cf3572f925fc1198
21 DIST chromium-57.0.2987.21.tar.xz 522738052 SHA256 632189c16d56fc23e6c3ef8174fd59ee3bae9b1c6a6740bf9a41dfb83cd39c57 SHA512 c968a7ef00e136e67f827370c7489195ec173e56cc37cba105f7558bd56ec918f5beb8f74b54f3c5224067f513e69a5c6cf497d1d5bb7f9dec1fde9fff88710b WHIRLPOOL b99b2f4d731a9c0772424ac50603905d7db76f8705533cb3fa4e13403083316020ea29b47aa8e817364cc6e4cc071768cac950b34bd29206fc6d744ec0e77337
22 +DIST chromium-58.0.3004.3.tar.xz 505630076 SHA256 4110ce13c1655b1ff9dc67adafb8f8d1861e0df27b4e143cb80800f4967d24d9 SHA512 628c0c623be8674d32961f51b30a32cb13f06a83869a527addb1d28445e4bf92b93019be5a2179909780af80741da475f960ce62cae05fb2f7eb539f3ca28345 WHIRLPOOL a73e8878a1e8ba8a5f568f29061bf3524b800f0fdbe2e532f9299f8e3d4967576d22f0aa6dbe716914b1de8d6be7e43e79d97b85c63d5834e2d0d03ca9840909
23
24 diff --git a/www-client/chromium/chromium-58.0.3004.3.ebuild b/www-client/chromium/chromium-58.0.3004.3.ebuild
25 new file mode 100644
26 index 0000000000..b08d49efd6
27 --- /dev/null
28 +++ b/www-client/chromium/chromium-58.0.3004.3.ebuild
29 @@ -0,0 +1,651 @@
30 +# Copyright 1999-2017 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +# $Id$
33 +
34 +EAPI="6"
35 +PYTHON_COMPAT=( python2_7 )
36 +
37 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
38 + 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
39 + sv sw ta te th tr uk vi zh-CN zh-TW"
40 +
41 +inherit check-reqs chromium-2 eutils gnome2-utils flag-o-matic multilib multiprocessing pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs versionator virtualx xdg-utils
42 +
43 +DESCRIPTION="Open-source version of Google Chrome web browser"
44 +HOMEPAGE="http://chromium.org/"
45 +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz"
46 +
47 +LICENSE="BSD"
48 +SLOT="0"
49 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
50 +IUSE="component-build cups gconf gnome-keyring gtk3 +hangouts kerberos neon pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-libvpx +tcmalloc widevine"
51 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
52 +
53 +# Native Client binaries are compiled with different set of flags, bug #452066.
54 +QA_FLAGS_IGNORED=".*\.nexe"
55 +
56 +# Native Client binaries may be stripped by the build system, which uses the
57 +# right tools for it, bug #469144 .
58 +QA_PRESTRIPPED=".*\.nexe"
59 +
60 +COMMON_DEPEND="
61 + app-arch/bzip2:=
62 + cups? ( >=net-print/cups-1.3.11:= )
63 + >=dev-libs/elfutils-0.149
64 + dev-libs/expat:=
65 + dev-libs/glib:2
66 + dev-libs/icu:=
67 + >=dev-libs/jsoncpp-0.5.0-r1:=
68 + dev-libs/libxml2:=[icu]
69 + dev-libs/libxslt:=
70 + dev-libs/nspr:=
71 + >=dev-libs/nss-3.14.3:=
72 + >=dev-libs/re2-0.2016.05.01:=
73 + gconf? ( >=gnome-base/gconf-2.24.0:= )
74 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
75 + >=media-libs/alsa-lib-1.0.19:=
76 + media-libs/fontconfig:=
77 + media-libs/freetype:=
78 + >=media-libs/harfbuzz-1.3.1:=[icu(+)]
79 + media-libs/libexif:=
80 + media-libs/libjpeg-turbo:=
81 + media-libs/libpng:=
82 + system-libvpx? ( media-libs/libvpx:=[svc] )
83 + media-libs/speex:=
84 + pulseaudio? ( media-sound/pulseaudio:= )
85 + system-ffmpeg? ( >=media-video/ffmpeg-3:= )
86 + sys-apps/dbus:=
87 + sys-apps/pciutils:=
88 + >=sys-libs/libcap-2.22:=
89 + virtual/udev
90 + x11-libs/cairo:=
91 + x11-libs/gdk-pixbuf:2
92 + x11-libs/libdrm
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/libXinerama:=
101 + x11-libs/libXrandr:=
102 + x11-libs/libXrender:=
103 + x11-libs/libXScrnSaver:=
104 + x11-libs/libXtst:=
105 + x11-libs/pango:=
106 + app-arch/snappy:=
107 + media-libs/flac:=
108 + >=media-libs/libwebp-0.4.0:=
109 + sys-libs/zlib:=[minizip]
110 + kerberos? ( virtual/krb5 )
111 +"
112 +# For nvidia-drivers blocker, see bug #413637 .
113 +RDEPEND="${COMMON_DEPEND}
114 + !=www-client/chromium-9999
115 + !<www-plugins/chrome-binary-plugins-37
116 + x11-misc/xdg-utils
117 + virtual/opengl
118 + virtual/ttf-fonts
119 + !gtk3? ( x11-libs/gtk+:2 )
120 + gtk3? ( x11-libs/gtk+:3 )
121 + selinux? ( sec-policy/selinux-chromium )
122 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
123 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
124 +"
125 +# dev-vcs/git - https://bugs.gentoo.org/593476
126 +DEPEND="${COMMON_DEPEND}
127 + >=app-arch/gzip-1.7
128 + !arm? (
129 + dev-lang/yasm
130 + )
131 + dev-lang/perl
132 + dev-perl/JSON
133 + >=dev-util/gperf-3.0.3
134 + dev-util/ninja
135 + net-libs/nodejs
136 + sys-apps/hwids[usb(+)]
137 + >=sys-devel/bison-2.4.3
138 + sys-devel/flex
139 + virtual/pkgconfig
140 + dev-vcs/git
141 + x11-libs/gtk+:2
142 + x11-libs/gtk+:3
143 + $(python_gen_any_dep '
144 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
145 + >=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]
146 + dev-python/html5lib[${PYTHON_USEDEP}]
147 + dev-python/simplejson[${PYTHON_USEDEP}]
148 + ')
149 +"
150 +
151 +# Keep this in sync with the python_gen_any_dep call.
152 +python_check_deps() {
153 + has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
154 + has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
155 + has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
156 + has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
157 +}
158 +
159 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
160 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
161 +fi
162 +
163 +DISABLE_AUTOFORMATTING="yes"
164 +DOC_CONTENTS="
165 +Some web pages may require additional fonts to display properly.
166 +Try installing some of the following packages if some characters
167 +are not displayed properly:
168 +- media-fonts/arphicfonts
169 +- media-fonts/bitstream-cyberbit
170 +- media-fonts/droid
171 +- media-fonts/ipamonafont
172 +- media-fonts/noto
173 +- media-fonts/ja-ipafonts
174 +- media-fonts/takao-fonts
175 +- media-fonts/wqy-microhei
176 +- media-fonts/wqy-zenhei
177 +
178 +Depending on your desktop environment, you may need
179 +to install additional packages to get icons on the Downloads page.
180 +
181 +For KDE, the required package is kde-frameworks/oxygen-icons.
182 +
183 +For other desktop environments, try one of the following:
184 +- x11-themes/gnome-icon-theme
185 +- x11-themes/tango-icon-theme
186 +"
187 +
188 +pre_build_checks() {
189 + if [[ ${MERGE_TYPE} != binary ]]; then
190 + local -x CPP="$(tc-getCXX) -E"
191 + if tc-is-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
192 + # bugs: #601654
193 + die "At least clang 3.9.1 is required"
194 + fi
195 + if tc-is-gcc && ! version_is_at_least 5 "$(gcc-major-version)"; then
196 + # bugs: #535730, #525374, #518668, #600288
197 + die "At least gcc 5 is required"
198 + fi
199 + fi
200 +
201 + # Check build requirements, bug #541816 and bug #471810 .
202 + CHECKREQS_MEMORY="3G"
203 + CHECKREQS_DISK_BUILD="5G"
204 + eshopts_push -s extglob
205 + if is-flagq '-g?(gdb)?([1-9])'; then
206 + CHECKREQS_DISK_BUILD="25G"
207 + if ! use component-build; then
208 + CHECKREQS_MEMORY="16G"
209 + fi
210 + fi
211 + eshopts_pop
212 + check-reqs_pkg_setup
213 +}
214 +
215 +pkg_pretend() {
216 + pre_build_checks
217 +}
218 +
219 +pkg_setup() {
220 + pre_build_checks
221 +
222 + # Make sure the build system will use the right python, bug #344367.
223 + python-any-r1_pkg_setup
224 +
225 + chromium_suid_sandbox_check_kernel_config
226 +}
227 +
228 +src_prepare() {
229 + local PATCHES=(
230 + "${FILESDIR}/${PN}-widevine-r1.patch"
231 + "${FILESDIR}/${PN}-FORTIFY_SOURCE.patch"
232 + )
233 +
234 + use system-ffmpeg && PATCHES+=( "${FILESDIR}/${PN}-system-ffmpeg-r4.patch" )
235 +
236 + default
237 +
238 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
239 + ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
240 +
241 + local keeplibs=(
242 + base/third_party/dmg_fp
243 + base/third_party/dynamic_annotations
244 + base/third_party/icu
245 + base/third_party/nspr
246 + base/third_party/superfasthash
247 + base/third_party/symbolize
248 + base/third_party/valgrind
249 + base/third_party/xdg_mime
250 + base/third_party/xdg_user_dirs
251 + breakpad/src/third_party/curl
252 + chrome/third_party/mozilla_security_manager
253 + courgette/third_party
254 + net/third_party/mozilla_security_manager
255 + net/third_party/nss
256 + third_party/WebKit
257 + third_party/analytics
258 + third_party/angle
259 + third_party/angle/src/common/third_party/numerics
260 + third_party/angle/src/third_party/compiler
261 + third_party/angle/src/third_party/libXNVCtrl
262 + third_party/angle/src/third_party/murmurhash
263 + third_party/angle/src/third_party/trace_event
264 + third_party/boringssl
265 + third_party/brotli
266 + third_party/cacheinvalidation
267 + third_party/catapult
268 + third_party/catapult/third_party/polymer
269 + third_party/catapult/third_party/py_vulcanize
270 + third_party/catapult/third_party/py_vulcanize/third_party/rcssmin
271 + third_party/catapult/third_party/py_vulcanize/third_party/rjsmin
272 + third_party/catapult/tracing/third_party/d3
273 + third_party/catapult/tracing/third_party/gl-matrix
274 + third_party/catapult/tracing/third_party/jszip
275 + third_party/catapult/tracing/third_party/mannwhitneyu
276 + third_party/ced
277 + third_party/cld_2
278 + third_party/cld_3
279 + third_party/cros_system_api
280 + third_party/devscripts
281 + third_party/dom_distiller_js
282 + third_party/fips181
283 + third_party/flatbuffers
284 + third_party/flot
285 + third_party/google_input_tools
286 + third_party/google_input_tools/third_party/closure_library
287 + third_party/google_input_tools/third_party/closure_library/third_party/closure
288 + third_party/hunspell
289 + third_party/iccjpeg
290 + third_party/inspector_protocol
291 + third_party/jinja2
292 + third_party/jstemplate
293 + third_party/khronos
294 + third_party/leveldatabase
295 + third_party/libXNVCtrl
296 + third_party/libaddressinput
297 + third_party/libjingle
298 + third_party/libphonenumber
299 + third_party/libsecret
300 + third_party/libsrtp
301 + third_party/libudev
302 + third_party/libusb
303 + third_party/libwebm
304 + third_party/libxml/chromium
305 + third_party/libyuv
306 + third_party/lss
307 + third_party/lzma_sdk
308 + third_party/markupsafe
309 + third_party/mesa
310 + third_party/modp_b64
311 + third_party/mt19937ar
312 + third_party/node
313 + third_party/node/node_modules/vulcanize/third_party/UglifyJS2
314 + third_party/openh264
315 + third_party/openmax_dl
316 + third_party/opus
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/bigint
322 + third_party/pdfium/third_party/freetype
323 + third_party/pdfium/third_party/lcms2-2.6
324 + third_party/pdfium/third_party/libjpeg
325 + third_party/pdfium/third_party/libopenjpeg20
326 + third_party/pdfium/third_party/libpng16
327 + third_party/pdfium/third_party/libtiff
328 + third_party/pdfium/third_party/zlib_v128
329 + third_party/ply
330 + third_party/polymer
331 + third_party/protobuf
332 + third_party/protobuf/third_party/six
333 + third_party/qcms
334 + third_party/sfntly
335 + third_party/skia
336 + third_party/smhasher
337 + third_party/sqlite
338 + third_party/tcmalloc
339 + third_party/usrsctp
340 + third_party/web-animations-js
341 + third_party/webdriver
342 + third_party/webrtc
343 + third_party/widevine
344 + third_party/woff2
345 + third_party/x86inc
346 + third_party/zlib/google
347 + url/third_party/mozilla
348 + v8/src/third_party/valgrind
349 + v8/third_party/inspector_protocol
350 +
351 + # gyp -> gn leftovers
352 + base/third_party/libevent
353 + third_party/adobe
354 + third_party/speech-dispatcher
355 + third_party/usb_ids
356 + third_party/xdg-utils
357 + third_party/yasm/run_yasm.py
358 + )
359 + if ! use system-ffmpeg; then
360 + keeplibs+=( third_party/ffmpeg )
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 +
367 + # Remove most bundled libraries. Some are still needed.
368 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
369 +}
370 +
371 +src_configure() {
372 + local myconf_gn=""
373 +
374 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
375 + myconf_gn+=" is_debug=false"
376 +
377 + # Component build isn't generally intended for use by end users. It's mostly useful
378 + # for development and debugging.
379 + myconf_gn+=" is_component_build=$(usex component-build true false)"
380 +
381 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
382 + myconf_gn+=" enable_nacl=false"
383 +
384 + # Use system-provided libraries.
385 + # TODO: use_system_hunspell (upstream changes needed).
386 + # TODO: use_system_libsrtp (bug #459932).
387 + # TODO: use_system_libusb (http://crbug.com/266149).
388 + # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
389 + # TODO: use_system_protobuf (bug #525560).
390 + # TODO: use_system_ssl (http://crbug.com/58087).
391 + # TODO: use_system_sqlite (http://crbug.com/22208).
392 +
393 + # libevent: https://bugs.gentoo.org/593458
394 + local gn_system_libraries=(
395 + flac
396 + harfbuzz-ng
397 + icu
398 + libjpeg
399 + libpng
400 + libwebp
401 + libxml
402 + libxslt
403 + re2
404 + snappy
405 + yasm
406 + zlib
407 + )
408 + if use system-ffmpeg; then
409 + gn_system_libraries+=( ffmpeg )
410 + fi
411 + if use system-libvpx; then
412 + gn_system_libraries+=( libvpx )
413 + fi
414 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
415 +
416 + # Optional dependencies.
417 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
418 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
419 + myconf_gn+=" use_cups=$(usex cups true false)"
420 + myconf_gn+=" use_gconf=$(usex gconf true false)"
421 + myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
422 + myconf_gn+=" use_gtk3=$(usex gtk3 true false)"
423 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
424 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
425 +
426 + # TODO: link_pulseaudio=true for GN.
427 +
428 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
429 +
430 + if tc-is-clang; then
431 + myconf_gn+=" is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false"
432 + else
433 + myconf_gn+=" is_clang=false"
434 + fi
435 +
436 + # Never use bundled gold binary. Disable gold linker flags for now.
437 + # Do not use bundled clang.
438 + # Trying to use gold results in linker crash.
439 + myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false"
440 +
441 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
442 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
443 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
444 +
445 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
446 + # Note: these are for Gentoo use ONLY. For your own distribution,
447 + # please get your own set of keys. Feel free to contact chromium@g.o
448 + # for more info.
449 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
450 + local google_default_client_id="329227923882.apps.googleusercontent.com"
451 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
452 + myconf_gn+=" google_api_key=\"${google_api_key}\""
453 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
454 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
455 +
456 + local myarch="$(tc-arch)"
457 + if [[ $myarch = amd64 ]] ; then
458 + target_arch=x64
459 + ffmpeg_target_arch=x64
460 + elif [[ $myarch = x86 ]] ; then
461 + target_arch=ia32
462 + ffmpeg_target_arch=ia32
463 + elif [[ $myarch = arm64 ]] ; then
464 + target_arch=arm64
465 + ffmpeg_target_arch=arm64
466 + elif [[ $myarch = arm ]] ; then
467 + target_arch=arm
468 + ffmpeg_target_arch=$(usex neon arm-neon arm)
469 + else
470 + die "Failed to determine target arch, got '$myarch'."
471 + fi
472 +
473 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
474 + # Depending on GCC version the warnings are different and we don't want
475 + # the build to fail because of that.
476 + myconf_gn+=" treat_warnings_as_errors=false"
477 +
478 + # Disable fatal linker warnings, bug 506268.
479 + myconf_gn+=" fatal_linker_warnings=false"
480 +
481 + # Avoid CFLAGS problems, bug #352457, bug #390147.
482 + if ! use custom-cflags; then
483 + replace-flags "-Os" "-O2"
484 + strip-flags
485 +
486 + # Prevent linker from running out of address space, bug #471810 .
487 + if use x86; then
488 + filter-flags "-g*"
489 + fi
490 +
491 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
492 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
493 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
494 + fi
495 + fi
496 +
497 + # Make sure the build system will use the right tools, bug #340795.
498 + tc-export AR CC CXX NM
499 +
500 + # https://bugs.gentoo.org/588596
501 + append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks)
502 +
503 + # Define a custom toolchain for GN
504 + myconf_gn+=" custom_toolchain=\"${FILESDIR}/toolchain:default\""
505 +
506 + # Tools for building programs to be executed on the build system, bug #410883.
507 + if tc-is-cross-compiler; then
508 + export AR_host=$(tc-getBUILD_AR)
509 + export CC_host=$(tc-getBUILD_CC)
510 + export CXX_host=$(tc-getBUILD_CXX)
511 + export NM_host=$(tc-getBUILD_NM)
512 + fi
513 +
514 + # Bug 491582.
515 + export TMPDIR="${WORKDIR}/temp"
516 + mkdir -p -m 755 "${TMPDIR}" || die
517 +
518 + if ! use system-ffmpeg; then
519 + local build_ffmpeg_args=""
520 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
521 + build_ffmpeg_args+=" --disable-asm"
522 + fi
523 +
524 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
525 + einfo "Configuring bundled ffmpeg..."
526 + pushd third_party/ffmpeg > /dev/null || die
527 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
528 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
529 + chromium/scripts/copy_config.sh || die
530 + chromium/scripts/generate_gn.py || die
531 + popd > /dev/null || die
532 + fi
533 +
534 + third_party/libaddressinput/chromium/tools/update-strings.py || die
535 +
536 + touch chrome/test/data/webui/i18n_process_css_test.html || die
537 +
538 + einfo "Configuring Chromium..."
539 + # TODO: bootstrapped gn binary hangs when using tcmalloc with portage's sandbox.
540 + tools/gn/bootstrap/bootstrap.py -v --gn-gen-args "${myconf_gn} use_allocator=\"none\"" || die
541 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
542 + out/Release/gn gen --args="${myconf_gn}" out/Release || die
543 +}
544 +
545 +eninja() {
546 + if [[ -z ${NINJAOPTS+set} ]]; then
547 + local jobs=$(makeopts_jobs)
548 + local loadavg=$(makeopts_loadavg)
549 +
550 + if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
551 + NINJAOPTS+=" -j ${jobs}"
552 + fi
553 + if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
554 + NINJAOPTS+=" -l ${loadavg}"
555 + fi
556 + fi
557 + set -- ninja -v ${NINJAOPTS} "$@"
558 + echo "$@"
559 + "$@"
560 +}
561 +
562 +src_compile() {
563 + local ninja_targets="chrome chromedriver"
564 + if use suid; then
565 + ninja_targets+=" chrome_sandbox"
566 + fi
567 +
568 + # Build mksnapshot and pax-mark it.
569 + eninja -C out/Release mksnapshot || die
570 + pax-mark m out/Release/mksnapshot
571 +
572 + # Even though ninja autodetects number of CPUs, we respect
573 + # user's options, for debugging with -j 1 or any other reason.
574 + eninja -C out/Release ${ninja_targets} || die
575 +
576 + pax-mark m out/Release/chrome
577 +}
578 +
579 +src_install() {
580 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
581 + exeinto "${CHROMIUM_HOME}"
582 + doexe out/Release/chrome
583 +
584 + if use suid; then
585 + newexe out/Release/chrome_sandbox chrome-sandbox
586 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
587 + fi
588 +
589 + doexe out/Release/chromedriver
590 +
591 + # if ! use arm; then
592 + # doexe out/Release/nacl_helper{,_bootstrap} || die
593 + # insinto "${CHROMIUM_HOME}"
594 + # doins out/Release/nacl_irt_*.nexe || die
595 + # doins out/Release/libppGoogleNaClPluginChrome.so || die
596 + # fi
597 +
598 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
599 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
600 + doexe chromium-launcher.sh
601 +
602 + # It is important that we name the target "chromium-browser",
603 + # xdg-utils expect it; bug #355517.
604 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
605 + # keep the old symlink around for consistency
606 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
607 +
608 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
609 +
610 + # Allow users to override command-line options, bug #357629.
611 + insinto /etc/chromium
612 + newins "${FILESDIR}/chromium.default" "default"
613 +
614 + pushd out/Release/locales > /dev/null || die
615 + chromium_remove_language_paks
616 + popd
617 +
618 + if use widevine; then
619 + # These will be provided by chrome-binary-plugins
620 + rm out/Release/libwidevinecdm*.so || die
621 + fi
622 +
623 + insinto "${CHROMIUM_HOME}"
624 + doins out/Release/*.bin
625 + doins out/Release/*.pak
626 + doins out/Release/*.so
627 +
628 + # Needed by bundled icu
629 + # doins out/Release/icudtl.dat
630 +
631 + doins -r out/Release/locales
632 + doins -r out/Release/resources
633 +
634 + newman out/Release/chrome.1 chromium.1
635 + newman out/Release/chrome.1 chromium-browser.1
636 +
637 + # Install icons and desktop entry.
638 + local branding size
639 + for size in 16 22 24 32 48 64 128 256 ; do
640 + case ${size} in
641 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
642 + *) branding="chrome/app/theme/chromium" ;;
643 + esac
644 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
645 + chromium-browser.png
646 + done
647 +
648 + local mime_types="text/html;text/xml;application/xhtml+xml;"
649 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
650 + mime_types+="x-scheme-handler/ftp;" # bug #412185
651 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
652 + make_desktop_entry \
653 + chromium-browser \
654 + "Chromium" \
655 + chromium-browser \
656 + "Network;WebBrowser" \
657 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
658 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
659 +
660 + # Install GNOME default application entry (bug #303100).
661 + insinto /usr/share/gnome-control-center/default-apps
662 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
663 +
664 + readme.gentoo_create_doc
665 +}
666 +
667 +pkg_preinst() {
668 + gnome2_icon_savelist
669 +}
670 +
671 +pkg_postrm() {
672 + gnome2_icon_cache_update
673 + xdg_desktop_database_update
674 +}
675 +
676 +pkg_postinst() {
677 + gnome2_icon_cache_update
678 + xdg_desktop_database_update
679 + readme.gentoo_print_elog
680 +}