1 |
commit: de743f65ee5c615cb4aa9b6118c2a9fe414eb484 |
2 |
Author: Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 30 20:29:16 2015 +0000 |
4 |
Commit: Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 30 20:29:16 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de743f65 |
7 |
|
8 |
www-client/chromium: use system ffmpeg |
9 |
|
10 |
This is based on patch by Andreas Cadhalpun |
11 |
from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763632#29 |
12 |
|
13 |
Also dropping ~arm. |
14 |
|
15 |
Package-Manager: portage-2.2.20.1 |
16 |
|
17 |
www-client/chromium/chromium-47.0.2522.1-r1.ebuild | 627 +++++++++++++++++++++ |
18 |
.../chromium/files/chromium-system-ffmpeg-r0.patch | 54 ++ |
19 |
2 files changed, 681 insertions(+) |
20 |
|
21 |
diff --git a/www-client/chromium/chromium-47.0.2522.1-r1.ebuild b/www-client/chromium/chromium-47.0.2522.1-r1.ebuild |
22 |
new file mode 100644 |
23 |
index 0000000..c525ab0 |
24 |
--- /dev/null |
25 |
+++ b/www-client/chromium/chromium-47.0.2522.1-r1.ebuild |
26 |
@@ -0,0 +1,627 @@ |
27 |
+# Copyright 1999-2015 Gentoo Foundation |
28 |
+# Distributed under the terms of the GNU General Public License v2 |
29 |
+# $Id$ |
30 |
+ |
31 |
+EAPI="5" |
32 |
+PYTHON_COMPAT=( python2_7 ) |
33 |
+ |
34 |
+CHROMIUM_LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he |
35 |
+ 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 |
36 |
+ sv sw ta te th tr uk vi zh_CN zh_TW" |
37 |
+ |
38 |
+inherit check-reqs chromium eutils flag-o-matic multilib multiprocessing pax-utils \ |
39 |
+ portability python-any-r1 readme.gentoo toolchain-funcs versionator virtualx |
40 |
+ |
41 |
+DESCRIPTION="Open-source version of Google Chrome web browser" |
42 |
+HOMEPAGE="http://chromium.org/" |
43 |
+SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}-lite.tar.xz" |
44 |
+ |
45 |
+LICENSE="BSD hotwording? ( no-source-code )" |
46 |
+SLOT="0" |
47 |
+KEYWORDS="~amd64 ~x86" |
48 |
+IUSE="cups gnome gnome-keyring gtk3 hidpi hotwording kerberos neon pic pulseaudio selinux +tcmalloc widevine" |
49 |
+ |
50 |
+# Native Client binaries are compiled with different set of flags, bug #452066. |
51 |
+QA_FLAGS_IGNORED=".*\.nexe" |
52 |
+ |
53 |
+# Native Client binaries may be stripped by the build system, which uses the |
54 |
+# right tools for it, bug #469144 . |
55 |
+QA_PRESTRIPPED=".*\.nexe" |
56 |
+ |
57 |
+RDEPEND=">=app-accessibility/speech-dispatcher-0.8:= |
58 |
+ app-arch/bzip2:= |
59 |
+ app-arch/snappy:= |
60 |
+ cups? ( >=net-print/cups-1.3.11:= ) |
61 |
+ >=dev-libs/elfutils-0.149 |
62 |
+ dev-libs/expat:= |
63 |
+ dev-libs/glib:= |
64 |
+ >=dev-libs/icu-55.1:= |
65 |
+ >=dev-libs/jsoncpp-0.5.0-r1:= |
66 |
+ >=dev-libs/libevent-1.4.13:= |
67 |
+ dev-libs/libxml2:=[icu] |
68 |
+ dev-libs/libxslt:= |
69 |
+ dev-libs/nspr:= |
70 |
+ >=dev-libs/nss-3.14.3:= |
71 |
+ dev-libs/re2:= |
72 |
+ gnome? ( >=gnome-base/gconf-2.24.0:= ) |
73 |
+ gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= ) |
74 |
+ >=media-libs/alsa-lib-1.0.19:= |
75 |
+ media-libs/flac:= |
76 |
+ media-libs/fontconfig:= |
77 |
+ media-libs/freetype:= |
78 |
+ media-libs/harfbuzz:=[icu(+)] |
79 |
+ media-libs/libexif:= |
80 |
+ >=media-libs/libjpeg-turbo-1.2.0-r1:= |
81 |
+ media-libs/libpng:0= |
82 |
+ >=media-libs/libwebp-0.4.0:= |
83 |
+ media-libs/speex:= |
84 |
+ pulseaudio? ( media-sound/pulseaudio:= ) |
85 |
+ >=media-video/ffmpeg-2.7.2:=[opus,vorbis,vpx] |
86 |
+ sys-apps/dbus:= |
87 |
+ sys-apps/pciutils:= |
88 |
+ >=sys-libs/libcap-2.22:= |
89 |
+ sys-libs/zlib:=[minizip] |
90 |
+ virtual/udev |
91 |
+ x11-libs/cairo:= |
92 |
+ x11-libs/gdk-pixbuf:= |
93 |
+ gtk3? ( x11-libs/gtk+:3= ) |
94 |
+ !gtk3? ( x11-libs/gtk+:2= ) |
95 |
+ x11-libs/libdrm |
96 |
+ x11-libs/libX11:= |
97 |
+ x11-libs/libXcomposite:= |
98 |
+ x11-libs/libXcursor:= |
99 |
+ x11-libs/libXdamage:= |
100 |
+ x11-libs/libXext:= |
101 |
+ x11-libs/libXfixes:= |
102 |
+ >=x11-libs/libXi-1.6.0:= |
103 |
+ x11-libs/libXinerama:= |
104 |
+ x11-libs/libXrandr:= |
105 |
+ x11-libs/libXrender:= |
106 |
+ x11-libs/libXScrnSaver:= |
107 |
+ x11-libs/libXtst:= |
108 |
+ x11-libs/pango:= |
109 |
+ kerberos? ( virtual/krb5 )" |
110 |
+DEPEND="${RDEPEND} |
111 |
+ !arm? ( |
112 |
+ dev-lang/yasm |
113 |
+ ) |
114 |
+ dev-lang/perl |
115 |
+ dev-perl/JSON |
116 |
+ >=dev-util/gperf-3.0.3 |
117 |
+ dev-util/ninja |
118 |
+ sys-apps/hwids[usb(+)] |
119 |
+ >=sys-devel/bison-2.4.3 |
120 |
+ sys-devel/flex |
121 |
+ virtual/pkgconfig" |
122 |
+ |
123 |
+# For nvidia-drivers blocker, see bug #413637 . |
124 |
+RDEPEND+=" |
125 |
+ !=www-client/chromium-9999 |
126 |
+ !<www-plugins/chrome-binary-plugins-37 |
127 |
+ x11-misc/xdg-utils |
128 |
+ virtual/opengl |
129 |
+ virtual/ttf-fonts |
130 |
+ selinux? ( sec-policy/selinux-chromium ) |
131 |
+ tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 ) |
132 |
+ widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )" |
133 |
+ |
134 |
+# Python dependencies. The DEPEND part needs to be kept in sync |
135 |
+# with python_check_deps. |
136 |
+DEPEND+=" $(python_gen_any_dep ' |
137 |
+ dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}] |
138 |
+ dev-python/beautifulsoup:4[${PYTHON_USEDEP}] |
139 |
+ dev-python/html5lib[${PYTHON_USEDEP}] |
140 |
+ dev-python/jinja[${PYTHON_USEDEP}] |
141 |
+ dev-python/ply[${PYTHON_USEDEP}] |
142 |
+ dev-python/simplejson[${PYTHON_USEDEP}] |
143 |
+')" |
144 |
+python_check_deps() { |
145 |
+ has_version "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" && \ |
146 |
+ has_version "dev-python/beautifulsoup:4[${PYTHON_USEDEP}]" && \ |
147 |
+ has_version "dev-python/html5lib[${PYTHON_USEDEP}]" && \ |
148 |
+ has_version "dev-python/jinja[${PYTHON_USEDEP}]" && \ |
149 |
+ has_version "dev-python/ply[${PYTHON_USEDEP}]" && \ |
150 |
+ has_version "dev-python/simplejson[${PYTHON_USEDEP}]" |
151 |
+} |
152 |
+ |
153 |
+if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then |
154 |
+ EBUILD_DEATH_HOOKS+=" chromium_pkg_die"; |
155 |
+fi |
156 |
+ |
157 |
+DISABLE_AUTOFORMATTING="yes" |
158 |
+DOC_CONTENTS=" |
159 |
+Some web pages may require additional fonts to display properly. |
160 |
+Try installing some of the following packages if some characters |
161 |
+are not displayed properly: |
162 |
+- media-fonts/arphicfonts |
163 |
+- media-fonts/bitstream-cyberbit |
164 |
+- media-fonts/droid |
165 |
+- media-fonts/ipamonafont |
166 |
+- media-fonts/ja-ipafonts |
167 |
+- media-fonts/takao-fonts |
168 |
+- media-fonts/wqy-microhei |
169 |
+- media-fonts/wqy-zenhei |
170 |
+ |
171 |
+Depending on your desktop environment, you may need |
172 |
+to install additional packages to get icons on the Downloads page. |
173 |
+ |
174 |
+For KDE, the required package is kde-apps/oxygen-icons. |
175 |
+ |
176 |
+For other desktop environments, try one of the following: |
177 |
+- x11-themes/gnome-icon-theme |
178 |
+- x11-themes/tango-icon-theme |
179 |
+" |
180 |
+ |
181 |
+pkg_pretend() { |
182 |
+ if [[ $(tc-getCC)$ == *gcc* ]] && \ |
183 |
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then |
184 |
+ die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.' |
185 |
+ fi |
186 |
+ |
187 |
+ # Check build requirements, bug #541816 and bug #471810 . |
188 |
+ CHECKREQS_MEMORY="3G" |
189 |
+ CHECKREQS_DISK_BUILD="5G" |
190 |
+ eshopts_push -s extglob |
191 |
+ if is-flagq '-g?(gdb)?([1-9])'; then |
192 |
+ CHECKREQS_DISK_BUILD="25G" |
193 |
+ fi |
194 |
+ eshopts_pop |
195 |
+ check-reqs_pkg_pretend |
196 |
+} |
197 |
+ |
198 |
+pkg_setup() { |
199 |
+ if [[ "${SLOT}" == "0" ]]; then |
200 |
+ CHROMIUM_SUFFIX="" |
201 |
+ else |
202 |
+ CHROMIUM_SUFFIX="-${SLOT}" |
203 |
+ fi |
204 |
+ CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}" |
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 |
+ # if ! use arm; then |
214 |
+ # mkdir -p out/Release/gen/sdk/toolchain || die |
215 |
+ # # Do not preserve SELinux context, bug #460892 . |
216 |
+ # cp -a --no-preserve=context /usr/$(get_libdir)/nacl-toolchain-newlib \ |
217 |
+ # out/Release/gen/sdk/toolchain/linux_x86_newlib || die |
218 |
+ # touch out/Release/gen/sdk/toolchain/linux_x86_newlib/stamp.untar || die |
219 |
+ # fi |
220 |
+ |
221 |
+ epatch "${FILESDIR}/${PN}-system-ffmpeg-r0.patch" |
222 |
+ epatch "${FILESDIR}/${PN}-system-jinja-r7.patch" |
223 |
+ epatch "${FILESDIR}/chromium-widevine-r1.patch" |
224 |
+ |
225 |
+ epatch_user |
226 |
+ |
227 |
+ # Remove most bundled libraries. Some are still needed. |
228 |
+ build/linux/unbundle/remove_bundled_libraries.py \ |
229 |
+ 'base/third_party/dmg_fp' \ |
230 |
+ 'base/third_party/dynamic_annotations' \ |
231 |
+ 'base/third_party/icu' \ |
232 |
+ 'base/third_party/nspr' \ |
233 |
+ 'base/third_party/superfasthash' \ |
234 |
+ 'base/third_party/symbolize' \ |
235 |
+ 'base/third_party/valgrind' \ |
236 |
+ 'base/third_party/xdg_mime' \ |
237 |
+ 'base/third_party/xdg_user_dirs' \ |
238 |
+ 'breakpad/src/third_party/curl' \ |
239 |
+ 'chrome/third_party/mozilla_security_manager' \ |
240 |
+ 'courgette/third_party' \ |
241 |
+ 'crypto/third_party/nss' \ |
242 |
+ 'net/third_party/mozilla_security_manager' \ |
243 |
+ 'net/third_party/nss' \ |
244 |
+ 'third_party/WebKit' \ |
245 |
+ 'third_party/analytics' \ |
246 |
+ 'third_party/angle' \ |
247 |
+ 'third_party/angle/src/third_party/compiler' \ |
248 |
+ 'third_party/boringssl' \ |
249 |
+ 'third_party/brotli' \ |
250 |
+ 'third_party/cacheinvalidation' \ |
251 |
+ 'third_party/catapult' \ |
252 |
+ 'third_party/catapult/tracing/third_party/components/polymer' \ |
253 |
+ 'third_party/catapult/tracing/third_party/d3' \ |
254 |
+ 'third_party/catapult/tracing/third_party/gl-matrix' \ |
255 |
+ 'third_party/catapult/tracing/third_party/jszip' \ |
256 |
+ 'third_party/catapult/tracing/third_party/tvcm' \ |
257 |
+ 'third_party/catapult/tracing/third_party/tvcm/third_party/rcssmin' \ |
258 |
+ 'third_party/catapult/tracing/third_party/tvcm/third_party/rjsmin' \ |
259 |
+ 'third_party/cld_2' \ |
260 |
+ 'third_party/cros_system_api' \ |
261 |
+ 'third_party/cython/python_flags.py' \ |
262 |
+ 'third_party/devscripts' \ |
263 |
+ 'third_party/dom_distiller_js' \ |
264 |
+ 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \ |
265 |
+ 'third_party/fips181' \ |
266 |
+ 'third_party/flot' \ |
267 |
+ 'third_party/google_input_tools' \ |
268 |
+ 'third_party/google_input_tools/third_party/closure_library' \ |
269 |
+ 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \ |
270 |
+ 'third_party/hunspell' \ |
271 |
+ 'third_party/iccjpeg' \ |
272 |
+ 'third_party/jstemplate' \ |
273 |
+ 'third_party/khronos' \ |
274 |
+ 'third_party/leveldatabase' \ |
275 |
+ 'third_party/libXNVCtrl' \ |
276 |
+ 'third_party/libaddressinput' \ |
277 |
+ 'third_party/libjingle' \ |
278 |
+ 'third_party/libphonenumber' \ |
279 |
+ 'third_party/libsecret' \ |
280 |
+ 'third_party/libsrtp' \ |
281 |
+ 'third_party/libudev' \ |
282 |
+ 'third_party/libusb' \ |
283 |
+ 'third_party/libvpx_new' \ |
284 |
+ 'third_party/libvpx_new/source/libvpx/third_party/x86inc' \ |
285 |
+ 'third_party/libxml/chromium' \ |
286 |
+ 'third_party/libwebm' \ |
287 |
+ 'third_party/libyuv' \ |
288 |
+ 'third_party/lss' \ |
289 |
+ 'third_party/lzma_sdk' \ |
290 |
+ 'third_party/mesa' \ |
291 |
+ 'third_party/modp_b64' \ |
292 |
+ 'third_party/mojo' \ |
293 |
+ 'third_party/mt19937ar' \ |
294 |
+ 'third_party/npapi' \ |
295 |
+ 'third_party/openmax_dl' \ |
296 |
+ 'third_party/opus' \ |
297 |
+ 'third_party/ots' \ |
298 |
+ 'third_party/pdfium' \ |
299 |
+ 'third_party/pdfium/third_party/agg23' \ |
300 |
+ 'third_party/pdfium/third_party/base' \ |
301 |
+ 'third_party/pdfium/third_party/bigint' \ |
302 |
+ 'third_party/pdfium/third_party/freetype' \ |
303 |
+ 'third_party/pdfium/third_party/lcms2-2.6' \ |
304 |
+ 'third_party/pdfium/third_party/libjpeg' \ |
305 |
+ 'third_party/pdfium/third_party/libopenjpeg20' \ |
306 |
+ 'third_party/pdfium/third_party/zlib_v128' \ |
307 |
+ 'third_party/polymer' \ |
308 |
+ 'third_party/protobuf' \ |
309 |
+ 'third_party/qcms' \ |
310 |
+ 'third_party/readability' \ |
311 |
+ 'third_party/sfntly' \ |
312 |
+ 'third_party/skia' \ |
313 |
+ 'third_party/smhasher' \ |
314 |
+ 'third_party/sqlite' \ |
315 |
+ 'third_party/tcmalloc' \ |
316 |
+ 'third_party/usrsctp' \ |
317 |
+ 'third_party/web-animations-js' \ |
318 |
+ 'third_party/webdriver' \ |
319 |
+ 'third_party/webrtc' \ |
320 |
+ 'third_party/widevine' \ |
321 |
+ 'third_party/x86inc' \ |
322 |
+ 'third_party/zlib/google' \ |
323 |
+ 'url/third_party/mozilla' \ |
324 |
+ 'v8/src/third_party/fdlibm' \ |
325 |
+ 'v8/src/third_party/valgrind' \ |
326 |
+ --do-remove || die |
327 |
+} |
328 |
+ |
329 |
+src_configure() { |
330 |
+ local myconf="" |
331 |
+ |
332 |
+ # Never tell the build system to "enable" SSE2, it has a few unexpected |
333 |
+ # additions, bug #336871. |
334 |
+ myconf+=" -Ddisable_sse2=1" |
335 |
+ |
336 |
+ # Disable nacl, we can't build without pnacl (http://crbug.com/269560). |
337 |
+ myconf+=" -Ddisable_nacl=1" |
338 |
+ |
339 |
+ # Disable glibc Native Client toolchain, we don't need it (bug #417019). |
340 |
+ # myconf+=" -Ddisable_glibc=1" |
341 |
+ |
342 |
+ # TODO: also build with pnacl |
343 |
+ # myconf+=" -Ddisable_pnacl=1" |
344 |
+ |
345 |
+ # It would be awkward for us to tar the toolchain and get it untarred again |
346 |
+ # during the build. |
347 |
+ # myconf+=" -Ddisable_newlib_untar=1" |
348 |
+ |
349 |
+ # Make it possible to remove third_party/adobe. |
350 |
+ echo > "${T}/flapper_version.h" || die |
351 |
+ myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h" |
352 |
+ |
353 |
+ # Use system-provided libraries. |
354 |
+ # TODO: use_system_hunspell (upstream changes needed). |
355 |
+ # TODO: use_system_libsrtp (bug #459932). |
356 |
+ # TODO: use_system_libusb (http://crbug.com/266149). |
357 |
+ # TODO: use_system_libvpx (http://crbug.com/494939). |
358 |
+ # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077). |
359 |
+ # TODO: use_system_protobuf (bug #525560). |
360 |
+ # TODO: use_system_ssl (http://crbug.com/58087). |
361 |
+ # TODO: use_system_sqlite (http://crbug.com/22208). |
362 |
+ myconf+=" |
363 |
+ -Duse_system_bzip2=1 |
364 |
+ -Duse_system_ffmpeg=1 |
365 |
+ -Duse_system_flac=1 |
366 |
+ -Duse_system_harfbuzz=1 |
367 |
+ -Duse_system_icu=1 |
368 |
+ -Duse_system_jsoncpp=1 |
369 |
+ -Duse_system_libevent=1 |
370 |
+ -Duse_system_libjpeg=1 |
371 |
+ -Duse_system_libpng=1 |
372 |
+ -Duse_system_libwebp=1 |
373 |
+ -Duse_system_libxml=1 |
374 |
+ -Duse_system_libxslt=1 |
375 |
+ -Duse_system_minizip=1 |
376 |
+ -Duse_system_nspr=1 |
377 |
+ -Duse_system_re2=1 |
378 |
+ -Duse_system_snappy=1 |
379 |
+ -Duse_system_speex=1 |
380 |
+ -Duse_system_xdg_utils=1 |
381 |
+ -Duse_system_zlib=1" |
382 |
+ |
383 |
+ # Needed for system icu - we don't need additional data files. |
384 |
+ myconf+=" -Dicu_use_data_file_flag=0" |
385 |
+ |
386 |
+ # TODO: patch gyp so that this arm conditional is not needed. |
387 |
+ if ! use arm; then |
388 |
+ myconf+=" |
389 |
+ -Duse_system_yasm=1" |
390 |
+ fi |
391 |
+ |
392 |
+ # Optional dependencies. |
393 |
+ # TODO: linux_link_kerberos, bug #381289. |
394 |
+ myconf+=" |
395 |
+ $(gyp_use cups) |
396 |
+ $(gyp_use gnome use_gconf) |
397 |
+ $(gyp_use gnome-keyring use_gnome_keyring) |
398 |
+ $(gyp_use gnome-keyring linux_link_gnome_keyring) |
399 |
+ $(gyp_use gtk3) |
400 |
+ $(gyp_use hidpi enable_hidpi) |
401 |
+ $(gyp_use hotwording enable_hotwording) |
402 |
+ $(gyp_use kerberos) |
403 |
+ $(gyp_use pulseaudio) |
404 |
+ $(gyp_use tcmalloc use_allocator tcmalloc none) |
405 |
+ $(gyp_use widevine enable_widevine)" |
406 |
+ |
407 |
+ # Use explicit library dependencies instead of dlopen. |
408 |
+ # This makes breakages easier to detect by revdep-rebuild. |
409 |
+ myconf+=" |
410 |
+ -Dlinux_link_gsettings=1 |
411 |
+ -Dlinux_link_libpci=1 |
412 |
+ -Dlinux_link_libspeechd=1 |
413 |
+ -Dlibspeechd_h_prefix=speech-dispatcher/" |
414 |
+ |
415 |
+ # TODO: use the file at run time instead of effectively compiling it in. |
416 |
+ myconf+=" |
417 |
+ -Dusb_ids_path=/usr/share/misc/usb.ids" |
418 |
+ |
419 |
+ # Save space by removing DLOG and DCHECK messages (about 6% reduction). |
420 |
+ myconf+=" |
421 |
+ -Dlogging_like_official_build=1" |
422 |
+ |
423 |
+ if [[ $(tc-getCC) == *clang* ]]; then |
424 |
+ myconf+=" -Dclang=1" |
425 |
+ else |
426 |
+ myconf+=" -Dclang=0" |
427 |
+ fi |
428 |
+ |
429 |
+ # Never use bundled gold binary. Disable gold linker flags for now. |
430 |
+ # Do not use bundled clang. |
431 |
+ myconf+=" |
432 |
+ -Dclang_use_chrome_plugins=0 |
433 |
+ -Dhost_clang=0 |
434 |
+ -Dlinux_use_bundled_binutils=0 |
435 |
+ -Dlinux_use_bundled_gold=0 |
436 |
+ -Dlinux_use_gold_flags=0" |
437 |
+ |
438 |
+ myconf+=" -Dproprietary_codecs=1" |
439 |
+ |
440 |
+ # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . |
441 |
+ # Note: these are for Gentoo use ONLY. For your own distribution, |
442 |
+ # please get your own set of keys. Feel free to contact chromium@g.o |
443 |
+ # for more info. |
444 |
+ myconf+=" -Dgoogle_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc |
445 |
+ -Dgoogle_default_client_id=329227923882.apps.googleusercontent.com |
446 |
+ -Dgoogle_default_client_secret=vgKG0NNv7GoDpbtoFNLxCUXu" |
447 |
+ |
448 |
+ local myarch="$(tc-arch)" |
449 |
+ if [[ $myarch = amd64 ]] ; then |
450 |
+ target_arch=x64 |
451 |
+ elif [[ $myarch = x86 ]] ; then |
452 |
+ target_arch=ia32 |
453 |
+ elif [[ $myarch = arm ]] ; then |
454 |
+ target_arch=arm |
455 |
+ # TODO: re-enable NaCl (NativeClient). |
456 |
+ local CTARGET=${CTARGET:-${CHOST}} |
457 |
+ if [[ $(tc-is-softfloat) == "no" ]]; then |
458 |
+ |
459 |
+ myconf+=" -Darm_float_abi=hard" |
460 |
+ fi |
461 |
+ filter-flags "-mfpu=*" |
462 |
+ use neon || myconf+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}" |
463 |
+ |
464 |
+ if [[ ${CTARGET} == armv[78]* ]]; then |
465 |
+ myconf+=" -Darmv7=1" |
466 |
+ else |
467 |
+ myconf+=" -Darmv7=0" |
468 |
+ fi |
469 |
+ myconf+=" -Dsysroot= |
470 |
+ $(gyp_use neon arm_neon) |
471 |
+ -Ddisable_nacl=1" |
472 |
+ else |
473 |
+ die "Failed to determine target arch, got '$myarch'." |
474 |
+ fi |
475 |
+ |
476 |
+ myconf+=" -Dtarget_arch=${target_arch}" |
477 |
+ |
478 |
+ # Make sure that -Werror doesn't get added to CFLAGS by the build system. |
479 |
+ # Depending on GCC version the warnings are different and we don't want |
480 |
+ # the build to fail because of that. |
481 |
+ myconf+=" -Dwerror=" |
482 |
+ |
483 |
+ # Disable fatal linker warnings, bug 506268. |
484 |
+ myconf+=" -Ddisable_fatal_linker_warnings=1" |
485 |
+ |
486 |
+ # Avoid CFLAGS problems, bug #352457, bug #390147. |
487 |
+ if ! use custom-cflags; then |
488 |
+ replace-flags "-Os" "-O2" |
489 |
+ strip-flags |
490 |
+ |
491 |
+ # Prevent linker from running out of address space, bug #471810 . |
492 |
+ if use x86; then |
493 |
+ filter-flags "-g*" |
494 |
+ fi |
495 |
+ |
496 |
+ # Prevent libvpx build failures. Bug 530248, 544702, 546984. |
497 |
+ if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then |
498 |
+ filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 |
499 |
+ fi |
500 |
+ fi |
501 |
+ |
502 |
+ # Make sure the build system will use the right tools, bug #340795. |
503 |
+ tc-export AR CC CXX NM |
504 |
+ |
505 |
+ # Tools for building programs to be executed on the build system, bug #410883. |
506 |
+ if tc-is-cross-compiler; then |
507 |
+ export AR_host=$(tc-getBUILD_AR) |
508 |
+ export CC_host=$(tc-getBUILD_CC) |
509 |
+ export CXX_host=$(tc-getBUILD_CXX) |
510 |
+ export NM_host=$(tc-getBUILD_NM) |
511 |
+ fi |
512 |
+ |
513 |
+ # Bug 491582. |
514 |
+ export TMPDIR="${WORKDIR}/temp" |
515 |
+ mkdir -p -m 755 "${TMPDIR}" || die |
516 |
+ |
517 |
+ third_party/libaddressinput/chromium/tools/update-strings.py || die |
518 |
+ |
519 |
+ touch chrome/test/data/webui/i18n_process_css_test.html || die |
520 |
+ |
521 |
+ einfo "Configuring Chromium..." |
522 |
+ build/linux/unbundle/replace_gyp_files.py ${myconf} || die |
523 |
+ egyp_chromium ${myconf} || die |
524 |
+} |
525 |
+ |
526 |
+eninja() { |
527 |
+ if [[ -z ${NINJAOPTS+set} ]]; then |
528 |
+ local jobs=$(makeopts_jobs) |
529 |
+ local loadavg=$(makeopts_loadavg) |
530 |
+ |
531 |
+ if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then |
532 |
+ NINJAOPTS+=" -j ${jobs}" |
533 |
+ fi |
534 |
+ if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then |
535 |
+ NINJAOPTS+=" -l ${loadavg}" |
536 |
+ fi |
537 |
+ fi |
538 |
+ set -- ninja -v ${NINJAOPTS} "$@" |
539 |
+ echo "$@" |
540 |
+ "$@" |
541 |
+} |
542 |
+ |
543 |
+src_compile() { |
544 |
+ local ninja_targets="chrome chrome_sandbox chromedriver" |
545 |
+ |
546 |
+ # Build mksnapshot and pax-mark it. |
547 |
+ eninja -C out/Release mksnapshot || die |
548 |
+ pax-mark m out/Release/mksnapshot |
549 |
+ |
550 |
+ # Even though ninja autodetects number of CPUs, we respect |
551 |
+ # user's options, for debugging with -j 1 or any other reason. |
552 |
+ eninja -C out/Release ${ninja_targets} || die |
553 |
+ |
554 |
+ pax-mark m out/Release/chrome |
555 |
+} |
556 |
+ |
557 |
+src_install() { |
558 |
+ exeinto "${CHROMIUM_HOME}" |
559 |
+ doexe out/Release/chrome || die |
560 |
+ |
561 |
+ newexe out/Release/chrome_sandbox chrome-sandbox || die |
562 |
+ fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox" |
563 |
+ |
564 |
+ doexe out/Release/chromedriver || die |
565 |
+ use widevine && doexe out/Release/libwidevinecdmadapter.so |
566 |
+ |
567 |
+ # if ! use arm; then |
568 |
+ # doexe out/Release/nacl_helper{,_bootstrap} || die |
569 |
+ # insinto "${CHROMIUM_HOME}" |
570 |
+ # doins out/Release/nacl_irt_*.nexe || die |
571 |
+ # doins out/Release/libppGoogleNaClPluginChrome.so || die |
572 |
+ # fi |
573 |
+ |
574 |
+ local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" ) |
575 |
+ if [[ -n ${CHROMIUM_SUFFIX} ]]; then |
576 |
+ sedargs+=( |
577 |
+ -e "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" |
578 |
+ -e "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g" |
579 |
+ -e "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:" |
580 |
+ ) |
581 |
+ fi |
582 |
+ sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die |
583 |
+ doexe chromium-launcher.sh |
584 |
+ |
585 |
+ # It is important that we name the target "chromium-browser", |
586 |
+ # xdg-utils expect it; bug #355517. |
587 |
+ dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die |
588 |
+ # keep the old symlink around for consistency |
589 |
+ dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die |
590 |
+ |
591 |
+ dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${CHROMIUM_SUFFIX} || die |
592 |
+ |
593 |
+ # Allow users to override command-line options, bug #357629. |
594 |
+ dodir /etc/chromium || die |
595 |
+ insinto /etc/chromium |
596 |
+ newins "${FILESDIR}/chromium.default" "default" || die |
597 |
+ |
598 |
+ pushd out/Release/locales > /dev/null || die |
599 |
+ chromium_remove_language_paks |
600 |
+ popd |
601 |
+ |
602 |
+ insinto "${CHROMIUM_HOME}" |
603 |
+ doins out/Release/*.bin || die |
604 |
+ doins out/Release/*.pak || die |
605 |
+ |
606 |
+ doins -r out/Release/locales || die |
607 |
+ doins -r out/Release/resources || die |
608 |
+ |
609 |
+ newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die |
610 |
+ newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die |
611 |
+ |
612 |
+ # Install icons and desktop entry. |
613 |
+ local branding size |
614 |
+ for size in 16 22 24 32 48 64 128 256 ; do |
615 |
+ case ${size} in |
616 |
+ 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;; |
617 |
+ *) branding="chrome/app/theme/chromium" ;; |
618 |
+ esac |
619 |
+ newicon -s ${size} "${branding}/product_logo_${size}.png" \ |
620 |
+ chromium-browser${CHROMIUM_SUFFIX}.png |
621 |
+ done |
622 |
+ |
623 |
+ local mime_types="text/html;text/xml;application/xhtml+xml;" |
624 |
+ mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797 |
625 |
+ mime_types+="x-scheme-handler/ftp;" # bug #412185 |
626 |
+ mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393 |
627 |
+ make_desktop_entry \ |
628 |
+ chromium-browser${CHROMIUM_SUFFIX} \ |
629 |
+ "Chromium${CHROMIUM_SUFFIX}" \ |
630 |
+ chromium-browser${CHROMIUM_SUFFIX} \ |
631 |
+ "Network;WebBrowser" \ |
632 |
+ "MimeType=${mime_types}\nStartupWMClass=chromium-browser" |
633 |
+ sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die |
634 |
+ |
635 |
+ # Install GNOME default application entry (bug #303100). |
636 |
+ if use gnome; then |
637 |
+ dodir /usr/share/gnome-control-center/default-apps || die |
638 |
+ insinto /usr/share/gnome-control-center/default-apps |
639 |
+ newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die |
640 |
+ if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then |
641 |
+ sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \ |
642 |
+ "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml |
643 |
+ fi |
644 |
+ fi |
645 |
+ |
646 |
+ readme.gentoo_create_doc |
647 |
+} |
648 |
+ |
649 |
+pkg_postinst() { |
650 |
+ fdo-mime_desktop_database_update |
651 |
+ gnome2_icon_cache_update |
652 |
+ readme.gentoo_print_elog |
653 |
+} |
654 |
|
655 |
diff --git a/www-client/chromium/files/chromium-system-ffmpeg-r0.patch b/www-client/chromium/files/chromium-system-ffmpeg-r0.patch |
656 |
new file mode 100644 |
657 |
index 0000000..667e0ec |
658 |
--- /dev/null |
659 |
+++ b/www-client/chromium/files/chromium-system-ffmpeg-r0.patch |
660 |
@@ -0,0 +1,54 @@ |
661 |
+diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h |
662 |
+index 677bd76..23a21f8 100644 |
663 |
+--- a/media/ffmpeg/ffmpeg_common.h |
664 |
++++ b/media/ffmpeg/ffmpeg_common.h |
665 |
+@@ -19,20 +19,12 @@ |
666 |
+ |
667 |
+ // Include FFmpeg header files. |
668 |
+ extern "C" { |
669 |
+-// Disable deprecated features which result in spammy compile warnings. This |
670 |
+-// list of defines must mirror those in the 'defines' section of the ffmpeg.gyp |
671 |
+-// file or the headers below will generate different structures. |
672 |
+-#define FF_API_PIX_FMT_DESC 0 |
673 |
+-#define FF_API_OLD_DECODE_AUDIO 0 |
674 |
+-#define FF_API_DESTRUCT_PACKET 0 |
675 |
+-#define FF_API_GET_BUFFER 0 |
676 |
+ |
677 |
+ // Temporarily disable possible loss of data warning. |
678 |
+ // TODO(scherkus): fix and upstream the compiler warnings. |
679 |
+ MSVC_PUSH_DISABLE_WARNING(4244); |
680 |
+ #include <libavcodec/avcodec.h> |
681 |
+ #include <libavformat/avformat.h> |
682 |
+-#include <libavformat/internal.h> |
683 |
+ #include <libavformat/avio.h> |
684 |
+ #include <libavutil/avutil.h> |
685 |
+ #include <libavutil/imgutils.h> |
686 |
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc |
687 |
+index 155e980..7ba327a 100644 |
688 |
+--- a/media/filters/ffmpeg_demuxer.cc |
689 |
++++ b/media/filters/ffmpeg_demuxer.cc |
690 |
+@@ -966,24 +966,6 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb, |
691 |
+ // If no estimate is found, the stream entry will be kInfiniteDuration(). |
692 |
+ std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams, |
693 |
+ kInfiniteDuration()); |
694 |
+- const AVFormatInternal* internal = format_context->internal; |
695 |
+- if (internal && internal->packet_buffer && |
696 |
+- format_context->start_time != static_cast<int64>(AV_NOPTS_VALUE)) { |
697 |
+- struct AVPacketList* packet_buffer = internal->packet_buffer; |
698 |
+- while (packet_buffer != internal->packet_buffer_end) { |
699 |
+- DCHECK_LT(static_cast<size_t>(packet_buffer->pkt.stream_index), |
700 |
+- start_time_estimates.size()); |
701 |
+- const AVStream* stream = |
702 |
+- format_context->streams[packet_buffer->pkt.stream_index]; |
703 |
+- if (packet_buffer->pkt.pts != static_cast<int64>(AV_NOPTS_VALUE)) { |
704 |
+- const base::TimeDelta packet_pts = |
705 |
+- ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts); |
706 |
+- if (packet_pts < start_time_estimates[stream->index]) |
707 |
+- start_time_estimates[stream->index] = packet_pts; |
708 |
+- } |
709 |
+- packet_buffer = packet_buffer->next; |
710 |
+- } |
711 |
+- } |
712 |
+ |
713 |
+ AVStream* audio_stream = NULL; |
714 |
+ AudioDecoderConfig audio_config; |