Gentoo Archives: gentoo-commits

From: Donnie Berkholz <dberkholz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/dberkholz:master commit in: www-client/chromium/
Date: Mon, 30 May 2011 13:38:37
Message-Id: 2ea02609a33f57aacc20418505703f057f6181b1.dberkholz@gentoo
1 commit: 2ea02609a33f57aacc20418505703f057f6181b1
2 Author: Donnie Berkholz <dberkholz <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 30 13:38:11 2011 +0000
4 Commit: Donnie Berkholz <dberkholz <AT> gentoo <DOT> org>
5 CommitDate: Mon May 30 13:38:11 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dberkholz.git;a=commit;h=2ea02609
7
8 chromium: add my patch to the latest revision in the tree.
9
10 ---
11 www-client/chromium/Manifest | 1 +
12 www-client/chromium/chromium-13.0.772.0-r1.ebuild | 428 +++++++++++++++++++++
13 2 files changed, 429 insertions(+), 0 deletions(-)
14
15 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
16 index 6adb118..ecad739 100644
17 --- a/www-client/chromium/Manifest
18 +++ b/www-client/chromium/Manifest
19 @@ -9,6 +9,7 @@ AUX chromium-system-zlib-r0.patch 1318 RMD160 2debfc4f179a57119d5022305134307f4c
20 AUX chromium.xml 390 RMD160 6b2f901da76555a7112f71a6f9dae6e2e3307324 SHA1 81148a0b094bc697ff2c9d33efe976b1bffb72a3 SHA256 a81c6257346eaa4f6389fc9ea8834fd2dd3b006cf4e9e999028aca812d76fe9a
21 AUX dot-gclient 253 RMD160 a768770d8e6f5b73395451277beea1cc9240fc3a SHA1 3eaf2074da58cfe4f2af3d08f59b27a16fe13dad SHA256 8c5750251ff681044cc584ef3768fe39c56c7877ade5fb9107298734126e62cf
22 DIST chromium-13.0.772.0.tar.bz2 151228656 RMD160 e262ccac7adf9ecc43c5fef4c08a70c828c8ac43 SHA1 fb608e09454a06ded186e77a1a1cd50123535304 SHA256 b0e200badba8ffdf066c35a567f15baa1592946de1a62c1dcb708cdbdf30f2bf
23 +EBUILD chromium-13.0.772.0-r1.ebuild 13162 RMD160 67f4778277b81e39edf1a2d717e5d35884cfb9b5 SHA1 83ab2e1f80fa7a45b3b7d4a82c5c840d4a0ce7be SHA256 e37e3751fb5c29d3ddb80904c58866563d920dcaefc334004c66c720a1cc19a2
24 EBUILD chromium-13.0.772.0.ebuild 11510 RMD160 516043a2381bb924aa06aca643101e48891e1227 SHA1 3c70c7dec2239a812809602ce2876dcd0d359e7a SHA256 bf9b857437ad99c23a5a0976df4b7a4e8bd613de2d725e98e652231439c98766
25 MISC ChangeLog 81977 RMD160 4d005d33bd5e9afaa6333ec1639fdb8c919bc91e SHA1 24acefbbe5f87d2561fc39c936676c053343574a SHA256 6d34ce755b7da6b18b2c1fdfbb7383b92cc8e8bcdff9da6e62c396ddc454f26c
26 MISC metadata.xml 267 RMD160 3a166415fec415d539c1b7c32ed40b188488b9fb SHA1 5c3d71a9cea27175cbe8c98369b42b79c8643c6c SHA256 4e6afae33f60d6752cacf2785f7f9a396b8711cce605b73d0d752a4af7d01fc8
27
28 diff --git a/www-client/chromium/chromium-13.0.772.0-r1.ebuild b/www-client/chromium/chromium-13.0.772.0-r1.ebuild
29 new file mode 100644
30 index 0000000..e064521
31 --- /dev/null
32 +++ b/www-client/chromium/chromium-13.0.772.0-r1.ebuild
33 @@ -0,0 +1,428 @@
34 +# Copyright 1999-2011 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-13.0.772.0-r1.ebuild,v 1.2 2011/05/29 15:08:06 phajdan.jr Exp $
37 +
38 +EAPI="3"
39 +PYTHON_DEPEND="2:2.6"
40 +
41 +inherit eutils fdo-mime flag-o-matic gnome2-utils linux-info multilib \
42 + pax-utils portability python toolchain-funcs versionator virtualx
43 +
44 +DESCRIPTION="Open-source version of Google Chrome web browser"
45 +HOMEPAGE="http://chromium.org/"
46 +SRC_URI="http://build.chromium.org/official/${P}.tar.bz2"
47 +
48 +LICENSE="BSD"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm ~x86"
51 +IUSE="cups gnome gnome-keyring kerberos xinerama"
52 +
53 +# en_US is ommitted on purpose from the list below. It must always be available.
54 +LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he hi hr
55 +hu id it ja kn ko lt lv ml mr nb nl pl pt_BR pt_PT ro ru sk sl sr sv sw ta te th
56 +tr uk vi zh_CN zh_TW"
57 +for lang in ${LANGS}; do
58 + IUSE+=" linguas_${lang}"
59 +done
60 +
61 +RDEPEND="app-arch/bzip2
62 + dev-libs/dbus-glib
63 + >=dev-libs/icu-4.4.1
64 + >=dev-libs/libevent-1.4.13
65 + dev-libs/libxml2[icu]
66 + dev-libs/libxslt
67 + >=dev-libs/nss-3.12.3
68 + gnome? ( >=gnome-base/gconf-2.24.0 )
69 + gnome-keyring? ( >=gnome-base/gnome-keyring-2.28.2 )
70 + >=media-libs/alsa-lib-1.0.19
71 + media-libs/flac
72 + virtual/jpeg
73 + media-libs/libpng
74 + >=media-libs/libvpx-0.9.5
75 + >=media-libs/libwebp-0.1.2
76 + media-libs/speex
77 + cups? ( >=net-print/cups-1.3.11 )
78 + sys-libs/zlib
79 + >=virtual/ffmpeg-0.6.90[threads]
80 + x11-libs/gtk+:2
81 + x11-libs/libXScrnSaver
82 + x11-libs/libXtst"
83 +DEPEND="${RDEPEND}
84 + dev-lang/perl
85 + >=dev-util/gperf-3.0.3
86 + >=dev-util/pkgconfig-0.23
87 + sys-devel/flex
88 + >=sys-devel/make-3.81-r2
89 + x11-libs/libXinerama
90 + test? (
91 + dev-python/pyftpdlib
92 + dev-python/simplejson
93 + virtual/krb5
94 + )"
95 +RDEPEND+="
96 + kerberos? ( virtual/krb5 )
97 + xinerama? ( x11-libs/libXinerama )
98 + x11-misc/xdg-utils
99 + virtual/ttf-fonts"
100 +
101 +gyp_use() {
102 + if [[ $# -lt 2 ]]; then
103 + echo "!!! usage: gyp_use <USEFLAG> <GYPFLAG>" >&2
104 + return 1
105 + fi
106 + if use "$1"; then echo "-D$2=1"; else echo "-D$2=0"; fi
107 +}
108 +
109 +egyp() {
110 + set -- build/gyp_chromium --depth=. "${@}"
111 + echo "${@}" >&2
112 + "${@}"
113 +}
114 +
115 +# Chromium uses different names for some langs,
116 +# return Chromium name corresponding to a Gentoo lang.
117 +chromium_lang() {
118 + if [[ "$1" == "es_LA" ]]; then
119 + echo "es_419"
120 + else
121 + echo "$1"
122 + fi
123 +}
124 +
125 +pkg_setup() {
126 + CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
127 +
128 + # Make sure the build system will use the right tools, bug #340795.
129 + tc-export AR CC CXX RANLIB
130 +
131 + # Make sure the build system will use the right python, bug #344367.
132 + python_set_active_version 2
133 + python_pkg_setup
134 +
135 + # Prevent user problems like bug #299777.
136 + if ! grep -q /dev/shm <<< $(get_mounts); then
137 + ewarn "You don't have tmpfs mounted at /dev/shm."
138 + ewarn "${PN} may fail to start in that configuration."
139 + ewarn "Please uncomment the /dev/shm entry in /etc/fstab,"
140 + ewarn "and run 'mount /dev/shm'."
141 + fi
142 + if [ `stat -c %a /dev/shm` -ne 1777 ]; then
143 + ewarn "/dev/shm does not have correct permissions."
144 + ewarn "${PN} may fail to start in that configuration."
145 + ewarn "Please run 'chmod 1777 /dev/shm'."
146 + fi
147 +
148 + # Prevent user problems like bug #348235.
149 + eshopts_push -s extglob
150 + if is-flagq '-g?(gdb)?([1-9])'; then
151 + ewarn "You have enabled debug info (probably have -g or -ggdb in your \$C{,XX}FLAGS)."
152 + ewarn "You may experience really long compilation times and/or increased memory usage."
153 + ewarn "If compilation fails, please try removing -g{,gdb} before reporting a bug."
154 + fi
155 + eshopts_pop
156 +
157 + # Warn if the kernel doesn't support features useful for sandboxing,
158 + # bug #363907.
159 + CONFIG_CHECK="~PID_NS ~NET_NS"
160 + PID_NS_WARNING="PID (process id) namespaces are needed for sandboxing."
161 + NET_NS_WARNING="Network namespaces are needed for sandboxing."
162 + check_extra_config
163 +}
164 +
165 +src_prepare() {
166 + # Make sure we don't use bundled libvpx headers.
167 + epatch "${FILESDIR}/${PN}-system-vpx-r4.patch"
168 +
169 + # Fix for gcc 4.6
170 + epatch "${FILESDIR}/chromium-gcc4.6.patch"
171 +
172 + # Remove most bundled libraries. Some are still needed.
173 + find third_party -type f \! -iname '*.gyp*' \
174 + \! -path 'third_party/WebKit/*' \
175 + \! -path 'third_party/angle/*' \
176 + \! -path 'third_party/cacheinvalidation/*' \
177 + \! -path 'third_party/cld/*' \
178 + \! -path 'third_party/expat/*' \
179 + \! -path 'third_party/ffmpeg/*' \
180 + \! -path 'third_party/flac/flac.h' \
181 + \! -path 'third_party/gpsd/*' \
182 + \! -path 'third_party/harfbuzz/*' \
183 + \! -path 'third_party/hunspell/*' \
184 + \! -path 'third_party/iccjpeg/*' \
185 + \! -path 'third_party/launchpad_translations/*' \
186 + \! -path 'third_party/leveldb/*' \
187 + \! -path 'third_party/libjingle/*' \
188 + \! -path 'third_party/libphonenumber/*' \
189 + \! -path 'third_party/libsrtp/*' \
190 + \! -path 'third_party/libvpx/libvpx.h' \
191 + \! -path 'third_party/mesa/*' \
192 + \! -path 'third_party/modp_b64/*' \
193 + \! -path 'third_party/npapi/*' \
194 + \! -path 'third_party/openmax/*' \
195 + \! -path 'third_party/ots/*' \
196 + \! -path 'third_party/protobuf/*' \
197 + \! -path 'third_party/skia/*' \
198 + \! -path 'third_party/speex/speex.h' \
199 + \! -path 'third_party/sqlite/*' \
200 + \! -path 'third_party/tcmalloc/*' \
201 + \! -path 'third_party/tlslite/*' \
202 + \! -path 'third_party/undoview/*' \
203 + \! -path 'third_party/zlib/contrib/minizip/*' \
204 + -delete || die
205 +
206 + # Make sure the build system will use the right python, bug #344367.
207 + # Only convert directories that need it, to save time.
208 + python_convert_shebangs -q -r 2 build tools
209 +}
210 +
211 +src_configure() {
212 + local myconf=""
213 +
214 + # Never tell the build system to "enable" SSE2, it has a few unexpected
215 + # additions, bug #336871.
216 + myconf+=" -Ddisable_sse2=1"
217 +
218 + # Temporarily disable Native Client, bug #366413.
219 + myconf+=" -Ddisable_nacl=1"
220 +
221 + # Use system-provided libraries.
222 + # TODO: use_system_hunspell (upstream changes needed).
223 + # TODO: use_system_ssl (http://crbug.com/58087).
224 + # TODO: use_system_sqlite (http://crbug.com/22208).
225 + myconf+="
226 + -Duse_system_bzip2=1
227 + -Duse_system_flac=1
228 + -Duse_system_ffmpeg=1
229 + -Duse_system_icu=1
230 + -Duse_system_libevent=1
231 + -Duse_system_libjpeg=1
232 + -Duse_system_libpng=1
233 + -Duse_system_libwebp=1
234 + -Duse_system_libxml=1
235 + -Duse_system_speex=1
236 + -Duse_system_vpx=1
237 + -Duse_system_xdg_utils=1
238 + -Duse_system_zlib=1"
239 +
240 + # Optional dependencies.
241 + myconf+="
242 + $(gyp_use cups use_cups)
243 + $(gyp_use gnome use_gconf)
244 + $(gyp_use gnome-keyring use_gnome_keyring)
245 + $(gyp_use gnome-keyring linux_link_gnome_keyring)"
246 +
247 + # Enable sandbox.
248 + myconf+="
249 + -Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox
250 + -Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome"
251 +
252 + if host-is-pax; then
253 + # Prevent the build from failing (bug #301880). The performance
254 + # difference is very small.
255 + myconf+=" -Dv8_use_snapshot=0"
256 + fi
257 +
258 + # Our system ffmpeg should support more codecs than the bundled one
259 + # for Chromium.
260 + myconf+=" -Dproprietary_codecs=1"
261 +
262 + # Use target arch detection logic from bug #354601.
263 + case ${CHOST} in
264 + i?86-*) myarch=x86 ;;
265 + x86_64-*)
266 + if [[ $ABI = "" ]] ; then
267 + myarch=amd64
268 + else
269 + myarch="$ABI"
270 + fi ;;
271 + arm*-*) myarch=arm ;;
272 + *) die "Unrecognized CHOST: ${CHOST}"
273 + esac
274 +
275 + if [[ $myarch = amd64 ]] ; then
276 + myconf+=" -Dtarget_arch=x64"
277 + elif [[ $myarch = x86 ]] ; then
278 + myconf+=" -Dtarget_arch=ia32"
279 + elif [[ $myarch = arm ]] ; then
280 + # TODO: check this again after
281 + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39509 is fixed.
282 + append-flags -fno-tree-sink
283 +
284 + myconf+=" -Dtarget_arch=arm -Ddisable_nacl=1 -Dlinux_use_tcmalloc=0"
285 + else
286 + die "Failed to determine target arch, got '$myarch'."
287 + fi
288 +
289 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
290 + # Depending on GCC version the warnings are different and we don't want
291 + # the build to fail because of that.
292 + myconf+=" -Dwerror="
293 +
294 + # Avoid a build error with -Os, bug #352457.
295 + replace-flags "-Os" "-O2"
296 +
297 + egyp ${myconf} || die
298 +}
299 +
300 +src_compile() {
301 + emake chrome chrome_sandbox BUILDTYPE=Release V=1 || die
302 + pax-mark m out/Release/chrome
303 + if use test; then
304 + emake {base,crypto,googleurl,net}_unittests BUILDTYPE=Release V=1 || die
305 + pax-mark m out/Release/{base,crypto,googleurl,net}_unittests
306 + fi
307 +}
308 +
309 +src_test() {
310 + # For more info see bug #350349.
311 + local mylocale='en_US.utf8'
312 + if ! locale -a | grep -q "$mylocale"; then
313 + eerror "${PN} requires ${mylocale} locale for tests"
314 + eerror "Please read the following guides for more information:"
315 + eerror " http://www.gentoo.org/doc/en/guide-localization.xml"
316 + eerror " http://www.gentoo.org/doc/en/utf-8.xml"
317 + die "locale ${mylocale} is not supported"
318 + fi
319 +
320 + # For more info see bug #350347.
321 + LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/base_unittests virtualmake \
322 + '--gtest_filter=-ICUStringConversionsTest.*'
323 +
324 + LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/crypto_unittests virtualmake
325 + LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/googleurl_unittests virtualmake
326 +
327 + # NetUtilTest: bug #361885.
328 + # UDP: unstable, active development. We should revisit this later.
329 + LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/net_unittests virtualmake \
330 + '--gtest_filter=-NetUtilTest.IDNToUnicode*:NetUtilTest.FormatUrl*:*UDP*'
331 +}
332 +
333 +src_install() {
334 + exeinto "${CHROMIUM_HOME}"
335 + doexe out/Release/chrome
336 + doexe out/Release/chrome_sandbox || die
337 + fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox"
338 + newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die
339 +
340 + # It is important that we name the target "chromium-browser",
341 + # xdg-utils expect it; bug #355517.
342 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser || die
343 + # keep the old symlink around for consistency
344 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium || die
345 +
346 + # Allow users to override command-line options, bug #357629.
347 + dodir /etc/chromium || die
348 + insinto /etc/chromium
349 + newins "${FILESDIR}/chromium.default" "default" || die
350 +
351 + # Support LINGUAS, bug #332751.
352 + local pak
353 + for pak in out/Release/locales/*.pak; do
354 + local pakbasename="$(basename ${pak})"
355 + local pakname="${pakbasename%.pak}"
356 + local langname="${pakname//-/_}"
357 +
358 + # Do not issue warning for en_US locale. This is the fallback
359 + # locale so it should always be installed.
360 + if [[ "${langname}" == "en_US" ]]; then
361 + continue
362 + fi
363 +
364 + local found=false
365 + local lang
366 + for lang in ${LANGS}; do
367 + local crlang="$(chromium_lang ${lang})"
368 + if [[ "${langname}" == "${crlang}" ]]; then
369 + found=true
370 + break
371 + fi
372 + done
373 + if ! $found; then
374 + ewarn "LINGUAS warning: no ${langname} in LANGS"
375 + fi
376 + done
377 + local lang
378 + for lang in ${LANGS}; do
379 + local crlang="$(chromium_lang ${lang})"
380 + local pakfile="out/Release/locales/${crlang//_/-}.pak"
381 + if [ ! -f "${pakfile}" ]; then
382 + ewarn "LINGUAS warning: no .pak file for ${lang} (${pakfile} not found)"
383 + fi
384 + if ! use linguas_${lang}; then
385 + rm "${pakfile}" || die
386 + fi
387 + done
388 +
389 + insinto "${CHROMIUM_HOME}"
390 + doins out/Release/chrome.pak || die
391 + doins out/Release/resources.pak || die
392 +
393 + doins -r out/Release/locales || die
394 + doins -r out/Release/resources || die
395 +
396 + newman out/Release/chrome.1 chromium.1 || die
397 + newman out/Release/chrome.1 chromium-browser.1 || die
398 +
399 + # Chromium looks for these in its folder
400 + # See media_posix.cc and base_paths_linux.cc
401 + dosym /usr/$(get_libdir)/libavcodec.so.52 "${CHROMIUM_HOME}" || die
402 + dosym /usr/$(get_libdir)/libavformat.so.52 "${CHROMIUM_HOME}" || die
403 + dosym /usr/$(get_libdir)/libavutil.so.50 "${CHROMIUM_HOME}" || die
404 +
405 + # Install icons and desktop entry.
406 + for SIZE in 16 22 24 32 48 64 128 256 ; do
407 + insinto /usr/share/icons/hicolor/${SIZE}x${SIZE}/apps
408 + newins chrome/app/theme/chromium/product_logo_${SIZE}.png \
409 + chromium-browser.png || die
410 + done
411 + local mime_types="text/html;text/xml;application/xhtml+xml;"
412 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
413 + make_desktop_entry chromium-browser "Chromium" chromium-browser \
414 + "Network;WebBrowser" "MimeType=${mime_types}"
415 + sed -e "/^Exec/s/$/ %U/" -i "${D}"/usr/share/applications/*.desktop || die
416 +
417 + # Install GNOME default application entry (bug #303100).
418 + if use gnome; then
419 + dodir /usr/share/gnome-control-center/default-apps || die
420 + insinto /usr/share/gnome-control-center/default-apps
421 + doins "${FILESDIR}"/chromium-browser.xml || die
422 + fi
423 +}
424 +
425 +pkg_preinst() {
426 + gnome2_icon_savelist
427 +}
428 +
429 +pkg_postinst() {
430 + fdo-mime_desktop_database_update
431 + gnome2_icon_cache_update
432 +
433 + # For more info see bug #292201, bug #352263, bug #361859.
434 + elog
435 + elog "Depending on your desktop environment, you may need"
436 + elog "to install additional packages to get icons on the Downloads page."
437 + elog
438 + elog "For KDE, the required package is kde-base/oxygen-icons."
439 + elog
440 + elog "For other desktop environments, try one of the following:"
441 + elog " - x11-themes/gnome-icon-theme"
442 + elog " - x11-themes/tango-icon-theme"
443 +
444 + # For more info see bug #359153.
445 + elog
446 + elog "Some web pages may require additional fonts to display properly."
447 + elog "Try installing some of the following packages if some characters"
448 + elog "are not displayed properly:"
449 + elog " - media-fonts/arphicfonts"
450 + elog " - media-fonts/bitstream-cyberbit"
451 + elog " - media-fonts/droid"
452 + elog " - media-fonts/ipamonafont"
453 + elog " - media-fonts/ja-ipafonts"
454 + elog " - media-fonts/takao-fonts"
455 + elog " - media-fonts/wqy-microhei"
456 + elog " - media-fonts/wqy-zenhei"
457 +}
458 +
459 +pkg_postrm() {
460 + gnome2_icon_cache_update
461 +}