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