Commits

Providence SALUMU committed 6e9713f

adds chromium-17.0.942.0

  • Participants
  • Parent commits 48b30b3

Comments (0)

Files changed (31)

www-client/chromium/Manifest

+AUX chromium-OF-r0.patch 824 RMD160 a9f2f0c1fc19ed7d95937289b80f2ac37dae26c6 SHA1 6c1716dfa85f5c3dc159fa81fb2236af91591b49 SHA256 2558023bba189862bdc9a0c6d5f6c117f16c7c6243d0455a75e2df5f9114dc5e
+AUX chromium-browser.xml 407 RMD160 457374ff72561648d9777ffb3270ad10d864a6be SHA1 65543bfff7d0350d40ba258e61061b0c5579e1f2 SHA256 bc039012f8677468e9ce5df825f9d8096be6deb5813031c86a087c88105096ff
+AUX chromium-cups-r0.patch 1237 RMD160 601fc9a46027580a1817a77abfb47b2b59e212ca SHA1 9826e90746229c7c12d767bb3b6cbdbc5c300041 SHA256 594af80456d977a19949909a7c79cae706964f7ced47634c9c9b19478dc089a2
+AUX chromium-ffmpeg-build-r0.patch 774 RMD160 a11ebd15927195fb047a366b1f9ab412a35d1262 SHA1 1972826179eed503f70a1499521072eb99c1fd16 SHA256 205a136035d09fb88549dfe4dbb97508e43a46f35ca791efa79d6c401aea5d84
+AUX chromium-glibc-2.14-r0.patch 1508 RMD160 6f8e88858cb02b825e512d1f030e681dbe1699b3 SHA1 c70e6dc5379f934ce726aa9ee46cd9db1ffefbbb SHA256 c434606b1599a47d8905d33c22dd65dd950d322108860572c55532189434a8ee
+AUX chromium-icu-compatibility-r0.patch 1659 RMD160 5d1fcc18d27b96f0c1b4f14b24dd8ab40ce917ca SHA1 517155769d0f421a4a81bffbcac39d17fa099956 SHA256 f70d99472d56e0aa7398b5638412d440d22943eb2c5962957f973e90992fdc99
+AUX chromium-kerberos-r0.patch 944 RMD160 25fccaa4406b1f964d72c94fd414a9955fc69ddd SHA1 b8b8f2cf6df1bade7af45d8f24b65acc602e781f SHA256 75b75f241675178dff914e0ddacc910a2583b2e2077e805f3ea1b2eed8513e21
+AUX chromium-launcher-r1.sh 680 RMD160 17fdc3576819c41d9320fab4b2dde3b8dc3c251b SHA1 5be5d25be14906458eb93cd7275c47f73c55fce4 SHA256 fa9cd53ee929ac77a52abc09eb65bb605b72b384533ba52fb90a905c72c3c208
+AUX chromium-launcher-r2.sh 940 RMD160 7a64e597998a8f95a7e3d1c26377842ff8106f89 SHA1 9630a36af707a810cbd646f3bac5deba984439f6 SHA256 842e121bbfa33513ca964744f0ba8401401946e672cd6a0a95bc80a28212e87e
+AUX chromium-libgcrypt-r0.patch 436 RMD160 855ecc89bd61f95378dc5aa5726b48cac7ede92c SHA1 3346e667a6581f7f62020ebc16fbf608c3a47cb6 SHA256 a81c598f544278a5638f3707db8a2fab85173e93b9a3ff097648babe58b665b0
+AUX chromium-perl-5.14-r0.patch 1062 RMD160 3e3205f298ae15bfc886160611508da975764edc SHA1 c23076b04b1a1f12c31cd203077c3c93e407840f SHA256 3e4f19cfd21a6f5526bb7fd2e7ecf6f78f55d2b9f5536ec926b78d44f7765975
+AUX chromium-system-libevent-r0.patch 404 RMD160 0dc32cfbd0770e4be1b6f9d3cf8ac08987a5992d SHA1 f6127a903eeb4ce13a4f8fc75dda0102e68d759a SHA256 127945ad45ede0e2aefbc28d8d5eb241675abb83f3aedc2569133e437f98a841
+AUX chromium-system-libevent-r1.patch 446 RMD160 65fb00d6e784d44f070e5826d5b10a860bb123ff SHA1 5d6d35c4b94b498aa8189c952145b683aa033791 SHA256 b8044b934f2de2469d2a9b9a2f0c69a48544e13af0354e91e70a4cece777f0b9
+AUX chromium-system-libevent-r2.patch 400 RMD160 6685c2cf563abc14558e277bf1e96ee1cd85b1f7 SHA1 f2a452f7a3b45008ffcb50d7cc65b30bfd8aca98 SHA256 dd8aa91d1d95c20b7716667445f064b5469be79a31e0bf7df39b997192e0eba3
+AUX chromium-system-vpx-r3.patch 1168 RMD160 3f59b6dfff335be21b55de70ccd9a77b008f5cd0 SHA1 09d1d4a6b0b031839d002abc62ec4efef6faef71 SHA256 c46f61559bdbd7e29bb47607f0b152647f73e2cc3e836f53c67bb2925e8957d7
+AUX chromium-system-vpx-r4.patch 476 RMD160 ff7feff7dff9de28bdc4c80b43c9574d7769a288 SHA1 b87516b0dac8f65431fdce86f26a3c92cfc313af SHA256 6bf0801a8d4ff208f558fa5740adfbed6178d391314297c80e0c3a058910a10e
+AUX chromium-system-zlib-r0.patch 1318 RMD160 2debfc4f179a57119d5022305134307f4cbbe04d SHA1 036e7573b04046ee0275abcb99a7e7a8b490e47b SHA256 79668fbf6206cd958db328798298a0514d3a95683b41affd3a607a0ac95453e3
+AUX chromium-v8-func-no-scriptcolumnnumber-r0.patch 1257 RMD160 1f9081ec9c4d8589618f05cd736d317dc1509887 SHA1 cda7cbb023f7d7e4360185c22b110bd347a1e1b4 SHA256 e078b07884f377ccd0c4117679877fe409769a859578634f1bcf042491c0d8c4
+AUX chromium.default 147 RMD160 4c0669585499b94c225e34e985e615d0299b66fb SHA1 1cdcbcd4a3517f70ba67c749da95c2a307971846 SHA256 de16d72d77ac9fe04f781df4f50dfb714ba33574755932df950c1d9472b589d9
+AUX chromium.xml 407 RMD160 457374ff72561648d9777ffb3270ad10d864a6be SHA1 65543bfff7d0350d40ba258e61061b0c5579e1f2 SHA256 bc039012f8677468e9ce5df825f9d8096be6deb5813031c86a087c88105096ff
+AUX chromium_dialogs_12.patch 12485 RMD160 d378b92d08a4c091826e079fc11d85e46af1ac9b SHA1 d213353481e03a174a52849a054e543d257fdf56 SHA256 72ace3e451ac30b2d60e79ed9437331d30394488b10768893dbbe4b10f0a3e0f
+AUX chromium_dialogs_16.patch 19690 RMD160 dfd07e7d36d8c1aa7bb22a841904c14f8a67f22e SHA1 4911104b68dcb20086938c32cb5ca349e1206999 SHA256 02c3bd019e7f4ebaa04ac2aa908359ccef1bf0f418aeeadc8eec352fe110553b
+AUX dbus.patch 549 RMD160 9bc4a715a593887e2baad61c901bcca0d1118687 SHA1 c88df2d884cd3eac6a5de24d0e8770600a6a89b3 SHA256 3da374b61cca695e2ba95eb0c3145749b4fd53df49b6a25d28ebc98cbabf8d91
+AUX dot-gclient 253 RMD160 a768770d8e6f5b73395451277beea1cc9240fc3a SHA1 3eaf2074da58cfe4f2af3d08f59b27a16fe13dad SHA256 8c5750251ff681044cc584ef3768fe39c56c7877ade5fb9107298734126e62cf
+AUX extract_v8_version.py 731 RMD160 71b134c9b88902259cb20ec232b8da6c3d8a15de SHA1 3dc5d6f9437f4b0ffb584395e19663450384b53a SHA256 4011f1e2f44bd18ad1266dffc1d3fbc13a6430afade2b19240b31ee9437dcbda
+AUX nacl.gypi 98 RMD160 fa4806fbc8c2e19763c1905a3bc431022b247825 SHA1 df4cee39e1d49e10f9c075f5e6e9db28e8260926 SHA256 25bddd2eee7821e18ddda06f6e69552c359e1c04a10971ac3985556c3d8ef059
+AUX printing_fix.patch 1419 RMD160 64d4dde81ba2f97c83cf3231d9cee8c1a67da923 SHA1 580f50c8592d8e3279e305e5e2eee22a97d4dad9 SHA256 8ba89d614a2a4977c3ca0f10640045df853939f58005f50c11242284b2dc6bbe
+DIST chromium-17.0.940.0.tar.bz2 159886659 RMD160 a6dcdfdadde5b47ec38c7347663b0a3c91c342e7 SHA1 25ba87765a9b358372bbee6beaa858bafff4969e SHA256 94eb14ac530f228a1c011c517a10ad032302b94dd033316e0f43bb64e7b147ea
+DIST chromium-17.0.942.0.tar.bz2 164163186 RMD160 ba38ae739790fa1e1a17a4d16c566a641ae617a8 SHA1 7cebf8a5ea938ae2e5d6aca756697e424434dc7a SHA256 66a79daf6fa4785658445892a5be5c35099b4b631427f29ec1e58adb73633241
+EBUILD chromium-17.0.940.0.ebuild 14780 RMD160 abf3de2b080605c0987eec62fb2adda102569d38 SHA1 19dcaf438e1b0ca0fd72484fc221f93adf2bf215 SHA256 dc4f6bf96d4b378e76860f6c99653ee3dae2cf4ea1a88f00635de76f6c809a04
+EBUILD chromium-17.0.942.0.ebuild 14887 RMD160 b084b9a99544e7348056bec36c286b62975437ed SHA1 4db1ee45186f0a0846a142057b9d713b5c6a9588 SHA256 aad9d04a86c2af7694d3479e4baa7fcdbdcbb710639e7e66c02aadac0d4da96a
+MISC metadata.xml 439 RMD160 761f397b2f14b9cdebf22731f49ec451a65198cc SHA1 e61056ecc5f8a4f0ff2c753b9694f7797867cf56 SHA256 a57ae80b431b982f91876406117548c3e96225bc1b4991744fea2ac956a8efcf

www-client/chromium/chromium-17.0.940.0.ebuild

+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-16.0.904.0-r2.ebuild,v 1.3 2011/10/15 03:12:32 phajdan.jr Exp $
+
+EAPI="3"
+PYTHON_DEPEND="2:2.6"
+
+inherit eutils fdo-mime flag-o-matic gnome2-utils linux-info multilib \
+	pax-utils portability python toolchain-funcs versionator virtualx
+
+DESCRIPTION="Open-source version of Google Chrome web browser"
+HOMEPAGE="http://chromium.org/"
+SRC_URI="http://gsdview.appspot.com/chromium-browser-official/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="bindist chromedriver cups gnome gnome-keyring kerberos pulseaudio"
+
+# en_US is ommitted on purpose from the list below. It must always be available.
+LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he hi hr
+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
+tr uk vi zh_CN zh_TW"
+for lang in ${LANGS}; do
+	IUSE+=" linguas_${lang}"
+done
+
+RDEPEND="app-arch/bzip2
+	>=dev-lang/v8-3.7.7
+	dev-libs/dbus-glib
+	dev-libs/elfutils
+	>=dev-libs/icu-4.4.1
+	>=dev-libs/libevent-1.4.13
+	dev-libs/libxml2[icu]
+	dev-libs/libxslt
+	>=dev-libs/nss-3.12.3
+	gnome? ( >=gnome-base/gconf-2.24.0 )
+	gnome-keyring? ( >=gnome-base/gnome-keyring-2.28.2 )
+	>=media-libs/alsa-lib-1.0.19
+	media-libs/flac
+	virtual/jpeg
+	media-libs/libpng
+	>=media-libs/libwebp-0.1.2
+	media-libs/speex
+	pulseaudio? ( media-sound/pulseaudio )
+	cups? (
+		dev-libs/libgcrypt
+		>=net-print/cups-1.3.11
+	)
+	sys-libs/zlib
+	x11-libs/gtk+:2
+	x11-libs/libXinerama
+	x11-libs/libXScrnSaver
+	x11-libs/libXtst
+	kerberos? ( virtual/krb5 )"
+DEPEND="${RDEPEND}
+	dev-lang/nacl-toolchain-newlib
+	dev-lang/perl
+	>=dev-util/gperf-3.0.3
+	>=dev-util/pkgconfig-0.23
+	dev-python/simplejson
+	>=sys-devel/bison-2.4.3
+	sys-devel/flex
+	>=sys-devel/make-3.81-r2
+	test? ( dev-python/pyftpdlib )"
+RDEPEND+="
+	x11-misc/xdg-utils
+	virtual/ttf-fonts"
+
+gyp_use() {
+	if [[ $# -lt 2 ]]; then
+		echo "!!! usage: gyp_use <USEFLAG> <GYPFLAG>" >&2
+		return 1
+	fi
+	if use "$1"; then echo "-D$2=1"; else echo "-D$2=0"; fi
+}
+
+egyp() {
+	set -- build/gyp_chromium --depth=. "${@}"
+	echo "${@}" >&2
+	"${@}"
+}
+
+# Chromium uses different names for some langs,
+# return Chromium name corresponding to a Gentoo lang.
+chromium_lang() {
+	if [[ "$1" == "es_LA" ]]; then
+		echo "es_419"
+	else
+		echo "$1"
+	fi
+}
+
+get_bundled_v8_version() {
+	"$(PYTHON -2)" "${FILESDIR}"/extract_v8_version.py v8/src/version.cc
+}
+
+get_installed_v8_version() {
+	best_version dev-lang/v8 | sed -e 's@dev-lang/v8-@@g'
+}
+
+pkg_setup() {
+	CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
+
+	# Make sure the build system will use the right tools, bug #340795.
+	tc-export AR CC CXX RANLIB
+
+	# Make sure the build system will use the right python, bug #344367.
+	python_set_active_version 2
+	python_pkg_setup
+
+	# Prevent user problems like bug #348235.
+	eshopts_push -s extglob
+	if is-flagq '-g?(gdb)?([1-9])'; then
+		ewarn "You have enabled debug info (probably have -g or -ggdb in your \$C{,XX}FLAGS)."
+		ewarn "You may experience really long compilation times and/or increased memory usage."
+		ewarn "If compilation fails, please try removing -g{,gdb} before reporting a bug."
+	fi
+	eshopts_pop
+
+	# Warn if the kernel doesn't support features useful for sandboxing,
+	# bug #363907.
+	CONFIG_CHECK="~PID_NS ~NET_NS"
+	check_extra_config
+
+	if use bindist; then
+		elog "bindist enabled: H.264 video support will be disabled."
+	else
+		elog "bindist disabled: Resulting binaries may not be legal to re-distribute."
+	fi
+}
+
+src_prepare() {
+	ln -s /usr/$(get_libdir)/nacl-toolchain-newlib \
+		native_client/toolchain/linux_x86_newlib || die
+		
+	# zlib-1.2.5.1-r1 renames the OF macro in zconf.h, bug 383371.
+	sed -i '1i#define OF(x) x' \
+		third_party/zlib/contrib/minizip/{ioapi,{,un}zip}.c \
+		chrome/common/zip.cc || die
+
+	epatch_user
+
+	# Remove most bundled libraries. Some are still needed.
+	find third_party -type f \! -iname '*.gyp*' \
+		\! -path 'third_party/WebKit/*' \
+		\! -path 'third_party/angle/*' \
+		\! -path 'third_party/cacheinvalidation/*' \
+		\! -path 'third_party/cld/*' \
+		\! -path 'third_party/expat/*' \
+		\! -path 'third_party/ffmpeg/*' \
+		\! -path 'third_party/flac/flac.h' \
+		\! -path 'third_party/gpsd/*' \
+		\! -path 'third_party/harfbuzz/*' \
+		\! -path 'third_party/hunspell/*' \
+		\! -path 'third_party/iccjpeg/*' \
+		\! -path 'third_party/launchpad_translations/*' \
+		\! -path 'third_party/leveldb/*' \
+		\! -path 'third_party/leveldatabase/*' \
+		\! -path 'third_party/libjingle/*' \
+		\! -path 'third_party/libphonenumber/*' \
+		\! -path 'third_party/libvpx/*' \
+		\! -path 'third_party/lss/*' \
+		\! -path 'third_party/mesa/*' \
+		\! -path 'third_party/modp_b64/*' \
+		\! -path 'third_party/mongoose/*' \
+		\! -path 'third_party/npapi/*' \
+		\! -path 'third_party/openmax/*' \
+		\! -path 'third_party/ots/*' \
+		\! -path 'third_party/protobuf/*' \
+		\! -path 'third_party/scons-2.0.1/*' \
+		\! -path 'third_party/sfntly/*' \
+		\! -path 'third_party/skia/*' \
+		\! -path 'third_party/smhasher/*' \
+		\! -path 'third_party/speex/speex.h' \
+		\! -path 'third_party/sqlite/*' \
+		\! -path 'third_party/tcmalloc/*' \
+		\! -path 'third_party/tlslite/*' \
+		\! -path 'third_party/undoview/*' \
+		\! -path 'third_party/v8-i18n/*' \
+		\! -path 'third_party/webdriver/*' \
+		\! -path 'third_party/webgl_conformance/*' \
+		\! -path 'third_party/webrtc/*' \
+		\! -path 'third_party/yasm/*' \
+		\! -path 'third_party/zlib/contrib/minizip/*' \
+		\! -path 'third_party/jsoncpp/*' \
+		-delete || die
+
+	local v8_bundled="$(get_bundled_v8_version)"
+	local v8_installed="$(get_installed_v8_version)"
+	elog "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}"
+
+	# Remove bundled v8.
+	find v8 -type f \! -iname '*.gyp*' -delete || die
+
+	# The implementation files include v8 headers with full path,
+	# like #include "v8/include/v8.h". Make sure the system headers
+	# will be used.
+	# TODO: find a solution that can be upstreamed.
+	rmdir v8/include || die
+	ln -s /usr/include v8/include || die
+
+	# Make sure the build system will use the right python, bug #344367.
+	# Only convert directories that need it, to save time.
+	python_convert_shebangs -q -r 2 build tools
+}
+
+src_configure() {
+	local myconf=""
+
+	# Never tell the build system to "enable" SSE2, it has a few unexpected
+	# additions, bug #336871.
+	myconf+=" -Ddisable_sse2=1"
+
+	# Use system-provided libraries.
+	# TODO: use_system_ffmpeg
+	# TODO: use_system_hunspell (upstream changes needed).
+	# TODO: use_system_ssl (http://crbug.com/58087).
+	# TODO: use_system_sqlite (http://crbug.com/22208).
+	# TODO: use_system_vpx
+	myconf+="
+		-Duse_system_bzip2=1
+		-Duse_system_flac=1
+		-Duse_system_icu=1
+		-Duse_system_libevent=1
+		-Duse_system_libjpeg=1
+		-Duse_system_libpng=1
+		-Duse_system_libwebp=1
+		-Duse_system_libxml=1
+		-Duse_system_speex=1
+		-Duse_system_v8=1
+		-Duse_system_xdg_utils=1
+		-Duse_system_zlib=1"
+
+	# Optional dependencies.
+	# TODO: linux_link_kerberos, bug #381289.
+	myconf+="
+		$(gyp_use cups use_cups)
+		$(gyp_use gnome use_gconf)
+		$(gyp_use gnome-keyring use_gnome_keyring)
+		$(gyp_use gnome-keyring linux_link_gnome_keyring)
+		$(gyp_use kerberos use_kerberos)
+		$(gyp_use pulseaudio use_pulseaudio)"
+
+	# Enable sandbox.
+	myconf+="
+		-Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox
+		-Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome"
+
+	# if host-is-pax; then
+	#	# Prevent the build from failing (bug #301880). The performance
+	#	# difference is very small.
+	#	myconf+=" -Dv8_use_snapshot=0"
+	# fi
+
+	# Our system ffmpeg should support more codecs than the bundled one
+	# for Chromium.
+	# myconf+=" -Dproprietary_codecs=1"
+
+	if ! use bindist; then
+		# Enable H.624 support in bundled ffmpeg.
+		myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=Chrome"
+	fi
+
+	local myarch="$(tc-arch)"
+	if [[ $myarch = amd64 ]] ; then
+		myconf+=" -Dtarget_arch=x64"
+	elif [[ $myarch = x86 ]] ; then
+		myconf+=" -Dtarget_arch=ia32"
+	elif [[ $myarch = arm ]] ; then
+		# TODO: check this again after
+		# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39509 is fixed.
+		append-flags -fno-tree-sink
+
+		myconf+=" -Dtarget_arch=arm -Ddisable_nacl=1 -Dlinux_use_tcmalloc=0"
+	else
+		die "Failed to determine target arch, got '$myarch'."
+	fi
+
+	# Make sure that -Werror doesn't get added to CFLAGS by the build system.
+	# Depending on GCC version the warnings are different and we don't want
+	# the build to fail because of that.
+	myconf+=" -Dwerror="
+
+	# Avoid a build error with -Os, bug #352457.
+	replace-flags "-Os" "-O2"
+
+	egyp ${myconf} || die
+}
+
+src_compile() {
+	emake chrome chrome_sandbox chromedriver BUILDTYPE=Release V=1 || die
+	pax-mark m out/Release/chrome
+	if use test; then
+		emake {base,crypto,googleurl,net}_unittests BUILDTYPE=Release V=1 || die
+		pax-mark m out/Release/{base,crypto,googleurl,net}_unittests
+	fi
+}
+
+src_test() {
+	# For more info see bug #350349.
+	local mylocale='en_US.utf8'
+	if ! locale -a | grep -q "$mylocale"; then
+		eerror "${PN} requires ${mylocale} locale for tests"
+		eerror "Please read the following guides for more information:"
+		eerror "  http://www.gentoo.org/doc/en/guide-localization.xml"
+		eerror "  http://www.gentoo.org/doc/en/utf-8.xml"
+		die "locale ${mylocale} is not supported"
+	fi
+
+	# For more info see bug #370957.
+	if [[ $UID -eq 0 ]]; then
+		die "Tests must be run as non-root. Please use FEATURES=userpriv."
+	fi
+
+	# For more info see bug #350347.
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/base_unittests virtualmake \
+		'--gtest_filter=-ICUStringConversionsTest.*'
+
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/crypto_unittests virtualmake
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/googleurl_unittests virtualmake
+
+	# NetUtilTest: bug #361885.
+	# NetUtilTest.GenerateFileName: some locale-related mismatch.
+	# UDP: unstable, active development. We should revisit this later.
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/net_unittests virtualmake \
+		'--gtest_filter=-NetUtilTest.IDNToUnicode*:NetUtilTest.FormatUrl*:NetUtilTest.GenerateFileName:*UDP*'
+}
+
+src_install() {
+	exeinto "${CHROMIUM_HOME}"
+	doexe out/Release/chrome || die
+	doexe out/Release/chrome_sandbox || die
+	fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox"
+
+	if use chromedriver; then
+		doexe out/Release/chromedriver || die
+	fi
+
+	# Install Native Client files on platforms that support it.
+	# insinto "${CHROMIUM_HOME}"
+	# case "$(tc-arch)" in
+	# 	amd64)
+	# 		doins out/Release/nacl_irt_x86_64.nexe || die
+	# 		doins out/Release/libppGoogleNaClPluginChrome.so || die
+	# 	;;
+	# 	x86)
+	# 		doins out/Release/nacl_irt_x86_32.nexe || die
+	# 		doins out/Release/libppGoogleNaClPluginChrome.so || die
+	# 	;;
+	# esac
+
+	newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die
+
+	# It is important that we name the target "chromium-browser",
+	# xdg-utils expect it; bug #355517.
+	dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser || die
+	# keep the old symlink around for consistency
+	dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium || die
+
+	# Allow users to override command-line options, bug #357629.
+	dodir /etc/chromium || die
+	insinto /etc/chromium
+	newins "${FILESDIR}/chromium.default" "default" || die
+
+	# Support LINGUAS, bug #332751.
+	local pak
+	for pak in out/Release/locales/*.pak; do
+		local pakbasename="$(basename ${pak})"
+		local pakname="${pakbasename%.pak}"
+		local langname="${pakname//-/_}"
+
+		# Do not issue warning for en_US locale. This is the fallback
+		# locale so it should always be installed.
+		if [[ "${langname}" == "en_US" ]]; then
+			continue
+		fi
+
+		local found=false
+		local lang
+		for lang in ${LANGS}; do
+			local crlang="$(chromium_lang ${lang})"
+			if [[ "${langname}" == "${crlang}" ]]; then
+				found=true
+				break
+			fi
+		done
+		if ! $found; then
+			ewarn "LINGUAS warning: no ${langname} in LANGS"
+		fi
+	done
+	local lang
+	for lang in ${LANGS}; do
+		local crlang="$(chromium_lang ${lang})"
+		local pakfile="out/Release/locales/${crlang//_/-}.pak"
+		if [ ! -f "${pakfile}" ]; then
+			ewarn "LINGUAS warning: no .pak file for ${lang} (${pakfile} not found)"
+		fi
+		if ! use linguas_${lang}; then
+			rm "${pakfile}" || die
+		fi
+	done
+
+	insinto "${CHROMIUM_HOME}"
+	doins out/Release/chrome.pak || die
+	doins out/Release/resources.pak || die
+
+	doins -r out/Release/locales || die
+	doins -r out/Release/resources || die
+
+	newman out/Release/chrome.1 chromium.1 || die
+	newman out/Release/chrome.1 chromium-browser.1 || die
+
+	# Chromium looks for these in its folder
+	# See media_posix.cc and base_paths_linux.cc
+	# dosym /usr/$(get_libdir)/libavcodec.so.52 "${CHROMIUM_HOME}" || die
+	# dosym /usr/$(get_libdir)/libavformat.so.52 "${CHROMIUM_HOME}" || die
+	# dosym /usr/$(get_libdir)/libavutil.so.50 "${CHROMIUM_HOME}" || die
+	doexe out/Release/libffmpegsumo.so || die
+
+	# Install icons and desktop entry.
+	for SIZE in 16 22 24 32 48 64 128 256 ; do
+		insinto /usr/share/icons/hicolor/${SIZE}x${SIZE}/apps
+		newins chrome/app/theme/chromium/product_logo_${SIZE}.png \
+			chromium-browser.png || die
+	done
+	local mime_types="text/html;text/xml;application/xhtml+xml;"
+	mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
+	make_desktop_entry chromium-browser "Chromium" chromium-browser \
+		"Network;WebBrowser" \
+		"MimeType=${mime_types}\nStartupWMClass=chromium-browser"
+	sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
+
+	# Install GNOME default application entry (bug #303100).
+	if use gnome; then
+		dodir /usr/share/gnome-control-center/default-apps || die
+		insinto /usr/share/gnome-control-center/default-apps
+		doins "${FILESDIR}"/chromium-browser.xml || die
+	fi
+}
+
+pkg_preinst() {
+	gnome2_icon_savelist
+}
+
+pkg_postinst() {
+	fdo-mime_desktop_database_update
+	gnome2_icon_cache_update
+
+	# For more info see bug #292201, bug #352263, bug #361859.
+	elog
+	elog "Depending on your desktop environment, you may need"
+	elog "to install additional packages to get icons on the Downloads page."
+	elog
+	elog "For KDE, the required package is kde-base/oxygen-icons."
+	elog
+	elog "For other desktop environments, try one of the following:"
+	elog " - x11-themes/gnome-icon-theme"
+	elog " - x11-themes/tango-icon-theme"
+
+	# For more info see bug #359153.
+	elog
+	elog "Some web pages may require additional fonts to display properly."
+	elog "Try installing some of the following packages if some characters"
+	elog "are not displayed properly:"
+	elog " - media-fonts/arphicfonts"
+	elog " - media-fonts/bitstream-cyberbit"
+	elog " - media-fonts/droid"
+	elog " - media-fonts/ipamonafont"
+	elog " - media-fonts/ja-ipafonts"
+	elog " - media-fonts/takao-fonts"
+	elog " - media-fonts/wqy-microhei"
+	elog " - media-fonts/wqy-zenhei"
+}
+
+pkg_postrm() {
+	gnome2_icon_cache_update
+}

www-client/chromium/chromium-17.0.942.0.ebuild

+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-16.0.904.0-r2.ebuild,v 1.3 2011/10/15 03:12:32 phajdan.jr Exp $
+
+EAPI="3"
+PYTHON_DEPEND="2:2.6"
+
+inherit eutils fdo-mime flag-o-matic gnome2-utils linux-info multilib \
+	pax-utils portability python toolchain-funcs versionator virtualx
+
+DESCRIPTION="Open-source version of Google Chrome web browser"
+HOMEPAGE="http://chromium.org/"
+SRC_URI="http://gsdview.appspot.com/chromium-browser-official/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="bindist chromedriver cups gnome gnome-keyring kerberos pulseaudio"
+
+# en_US is ommitted on purpose from the list below. It must always be available.
+LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he hi hr
+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
+tr uk vi zh_CN zh_TW"
+for lang in ${LANGS}; do
+	IUSE+=" linguas_${lang}"
+done
+
+RDEPEND="app-arch/bzip2
+	>=dev-lang/v8-3.7.7
+	dev-libs/dbus-glib
+	dev-libs/elfutils
+	>=dev-libs/icu-4.4.1
+	>=dev-libs/libevent-1.4.13
+	dev-libs/libxml2[icu]
+	dev-libs/libxslt
+	>=dev-libs/nss-3.12.3
+	gnome? ( >=gnome-base/gconf-2.24.0 )
+	gnome-keyring? ( >=gnome-base/gnome-keyring-2.28.2 )
+	>=media-libs/alsa-lib-1.0.19
+	media-libs/flac
+	virtual/jpeg
+	media-libs/libpng
+	>=media-libs/libwebp-0.1.2
+	media-libs/speex
+	pulseaudio? ( media-sound/pulseaudio )
+	cups? (
+		dev-libs/libgcrypt
+		>=net-print/cups-1.3.11
+	)
+	sys-libs/zlib
+	x11-libs/gtk+:2
+	x11-libs/libXinerama
+	x11-libs/libXScrnSaver
+	x11-libs/libXtst
+	kerberos? ( virtual/krb5 )"
+DEPEND="${RDEPEND}
+	dev-lang/nacl-toolchain-newlib
+	dev-lang/perl
+	>=dev-util/gperf-3.0.3
+	>=dev-util/pkgconfig-0.23
+	dev-python/simplejson
+	>=sys-devel/bison-2.4.3
+	sys-devel/flex
+	>=sys-devel/make-3.81-r2
+	test? ( dev-python/pyftpdlib )"
+RDEPEND+="
+	x11-misc/xdg-utils
+	virtual/ttf-fonts"
+
+gyp_use() {
+	if [[ $# -lt 2 ]]; then
+		echo "!!! usage: gyp_use <USEFLAG> <GYPFLAG>" >&2
+		return 1
+	fi
+	if use "$1"; then echo "-D$2=1"; else echo "-D$2=0"; fi
+}
+
+egyp() {
+	set -- build/gyp_chromium --depth=. "${@}"
+	echo "${@}" >&2
+	"${@}"
+}
+
+# Chromium uses different names for some langs,
+# return Chromium name corresponding to a Gentoo lang.
+chromium_lang() {
+	if [[ "$1" == "es_LA" ]]; then
+		echo "es_419"
+	else
+		echo "$1"
+	fi
+}
+
+get_bundled_v8_version() {
+	"$(PYTHON -2)" "${FILESDIR}"/extract_v8_version.py v8/src/version.cc
+}
+
+get_installed_v8_version() {
+	best_version dev-lang/v8 | sed -e 's@dev-lang/v8-@@g'
+}
+
+pkg_setup() {
+	CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
+
+	# Make sure the build system will use the right tools, bug #340795.
+	tc-export AR CC CXX RANLIB
+
+	# Make sure the build system will use the right python, bug #344367.
+	python_set_active_version 2
+	python_pkg_setup
+
+	# Prevent user problems like bug #348235.
+	eshopts_push -s extglob
+	if is-flagq '-g?(gdb)?([1-9])'; then
+		ewarn "You have enabled debug info (probably have -g or -ggdb in your \$C{,XX}FLAGS)."
+		ewarn "You may experience really long compilation times and/or increased memory usage."
+		ewarn "If compilation fails, please try removing -g{,gdb} before reporting a bug."
+	fi
+	eshopts_pop
+
+	# Warn if the kernel doesn't support features useful for sandboxing,
+	# bug #363907.
+	CONFIG_CHECK="~PID_NS ~NET_NS"
+	check_extra_config
+
+	if use bindist; then
+		elog "bindist enabled: H.264 video support will be disabled."
+	else
+		elog "bindist disabled: Resulting binaries may not be legal to re-distribute."
+	fi
+}
+
+src_prepare() {
+	ln -s /usr/$(get_libdir)/nacl-toolchain-newlib \
+		native_client/toolchain/linux_x86_newlib || die
+		
+	# zlib-1.2.5.1-r1 renames the OF macro in zconf.h, bug 383371.
+	sed -i '1i#define OF(x) x' \
+		third_party/zlib/contrib/minizip/{ioapi,{,un}zip}.c \
+		chrome/common/zip.cc chrome/common/zip_{reader,internal}.cc || die
+
+	epatch_user
+
+	# Remove most bundled libraries. Some are still needed.
+	find third_party -type f \! -iname '*.gyp*' \
+		\! -path 'third_party/WebKit/*' \
+		\! -path 'third_party/angle/*' \
+		\! -path 'third_party/cacheinvalidation/*' \
+		\! -path 'third_party/cld/*' \
+		\! -path 'third_party/expat/*' \
+		\! -path 'third_party/ffmpeg/*' \
+		\! -path 'third_party/flac/flac.h' \
+		\! -path 'third_party/gpsd/*' \
+		\! -path 'third_party/harfbuzz/*' \
+		\! -path 'third_party/hunspell/*' \
+		\! -path 'third_party/iccjpeg/*' \
+		\! -path 'third_party/launchpad_translations/*' \
+		\! -path 'third_party/leveldb/*' \
+		\! -path 'third_party/leveldatabase/*' \
+		\! -path 'third_party/libjingle/*' \
+		\! -path 'third_party/libphonenumber/*' \
+		\! -path 'third_party/libvpx/*' \
+		\! -path 'third_party/lss/*' \
+		\! -path 'third_party/mesa/*' \
+		\! -path 'third_party/modp_b64/*' \
+		\! -path 'third_party/mongoose/*' \
+		\! -path 'third_party/npapi/*' \
+		\! -path 'third_party/openmax/*' \
+		\! -path 'third_party/ots/*' \
+		\! -path 'third_party/protobuf/*' \
+		\! -path 'third_party/scons-2.0.1/*' \
+		\! -path 'third_party/sfntly/*' \
+		\! -path 'third_party/skia/*' \
+		\! -path 'third_party/smhasher/*' \
+		\! -path 'third_party/speex/speex.h' \
+		\! -path 'third_party/sqlite/*' \
+		\! -path 'third_party/tcmalloc/*' \
+		\! -path 'third_party/tlslite/*' \
+		\! -path 'third_party/undoview/*' \
+		\! -path 'third_party/v8-i18n/*' \
+		\! -path 'third_party/webdriver/*' \
+		\! -path 'third_party/webgl_conformance/*' \
+		\! -path 'third_party/webrtc/*' \
+		\! -path 'third_party/yasm/*' \
+		\! -path 'third_party/zlib/contrib/minizip/*' \
+		\! -path 'third_party/jsoncpp/*' \
+		-delete || die
+
+	local v8_bundled="$(get_bundled_v8_version)"
+	local v8_installed="$(get_installed_v8_version)"
+	elog "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}"
+
+	# Remove bundled v8.
+	find v8 -type f \! -iname '*.gyp*' -delete || die
+
+	# The implementation files include v8 headers with full path,
+	# like #include "v8/include/v8.h". Make sure the system headers
+	# will be used.
+	# TODO: find a solution that can be upstreamed.
+	rmdir v8/include || die
+	ln -s /usr/include v8/include || die
+
+	# Make sure the build system will use the right python, bug #344367.
+	# Only convert directories that need it, to save time.
+	python_convert_shebangs -q -r 2 build tools
+
+	epatch "${FILESDIR}"/${PN}-v8-func-no-scriptcolumnnumber-r0.patch
+}
+
+src_configure() {
+	local myconf=""
+
+	# Never tell the build system to "enable" SSE2, it has a few unexpected
+	# additions, bug #336871.
+	myconf+=" -Ddisable_sse2=1"
+
+	# Use system-provided libraries.
+	# TODO: use_system_ffmpeg
+	# TODO: use_system_hunspell (upstream changes needed).
+	# TODO: use_system_ssl (http://crbug.com/58087).
+	# TODO: use_system_sqlite (http://crbug.com/22208).
+	# TODO: use_system_vpx
+	myconf+="
+		-Duse_system_bzip2=1
+		-Duse_system_flac=1
+		-Duse_system_icu=1
+		-Duse_system_libevent=1
+		-Duse_system_libjpeg=1
+		-Duse_system_libpng=1
+		-Duse_system_libwebp=1
+		-Duse_system_libxml=1
+		-Duse_system_speex=1
+		-Duse_system_v8=1
+		-Duse_system_xdg_utils=1
+		-Duse_system_zlib=1"
+
+	# Optional dependencies.
+	# TODO: linux_link_kerberos, bug #381289.
+	myconf+="
+		$(gyp_use cups use_cups)
+		$(gyp_use gnome use_gconf)
+		$(gyp_use gnome-keyring use_gnome_keyring)
+		$(gyp_use gnome-keyring linux_link_gnome_keyring)
+		$(gyp_use kerberos use_kerberos)
+		$(gyp_use pulseaudio use_pulseaudio)"
+
+	# Enable sandbox.
+	myconf+="
+		-Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox
+		-Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome"
+
+	# if host-is-pax; then
+	#	# Prevent the build from failing (bug #301880). The performance
+	#	# difference is very small.
+	#	myconf+=" -Dv8_use_snapshot=0"
+	# fi
+
+	# Our system ffmpeg should support more codecs than the bundled one
+	# for Chromium.
+	# myconf+=" -Dproprietary_codecs=1"
+
+	if ! use bindist; then
+		# Enable H.624 support in bundled ffmpeg.
+		myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=Chrome"
+	fi
+
+	local myarch="$(tc-arch)"
+	if [[ $myarch = amd64 ]] ; then
+		myconf+=" -Dtarget_arch=x64"
+	elif [[ $myarch = x86 ]] ; then
+		myconf+=" -Dtarget_arch=ia32"
+	elif [[ $myarch = arm ]] ; then
+		# TODO: check this again after
+		# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39509 is fixed.
+		append-flags -fno-tree-sink
+
+		myconf+=" -Dtarget_arch=arm -Ddisable_nacl=1 -Dlinux_use_tcmalloc=0"
+	else
+		die "Failed to determine target arch, got '$myarch'."
+	fi
+
+	# Make sure that -Werror doesn't get added to CFLAGS by the build system.
+	# Depending on GCC version the warnings are different and we don't want
+	# the build to fail because of that.
+	myconf+=" -Dwerror="
+
+	# Avoid a build error with -Os, bug #352457.
+	replace-flags "-Os" "-O2"
+
+	egyp ${myconf} || die
+}
+
+src_compile() {
+	emake chrome chrome_sandbox chromedriver BUILDTYPE=Release V=1 || die
+	pax-mark m out/Release/chrome
+	if use test; then
+		emake {base,crypto,googleurl,net}_unittests BUILDTYPE=Release V=1 || die
+		pax-mark m out/Release/{base,crypto,googleurl,net}_unittests
+	fi
+}
+
+src_test() {
+	# For more info see bug #350349.
+	local mylocale='en_US.utf8'
+	if ! locale -a | grep -q "$mylocale"; then
+		eerror "${PN} requires ${mylocale} locale for tests"
+		eerror "Please read the following guides for more information:"
+		eerror "  http://www.gentoo.org/doc/en/guide-localization.xml"
+		eerror "  http://www.gentoo.org/doc/en/utf-8.xml"
+		die "locale ${mylocale} is not supported"
+	fi
+
+	# For more info see bug #370957.
+	if [[ $UID -eq 0 ]]; then
+		die "Tests must be run as non-root. Please use FEATURES=userpriv."
+	fi
+
+	# For more info see bug #350347.
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/base_unittests virtualmake \
+		'--gtest_filter=-ICUStringConversionsTest.*'
+
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/crypto_unittests virtualmake
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/googleurl_unittests virtualmake
+
+	# NetUtilTest: bug #361885.
+	# NetUtilTest.GenerateFileName: some locale-related mismatch.
+	# UDP: unstable, active development. We should revisit this later.
+	LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/net_unittests virtualmake \
+		'--gtest_filter=-NetUtilTest.IDNToUnicode*:NetUtilTest.FormatUrl*:NetUtilTest.GenerateFileName:*UDP*'
+}
+
+src_install() {
+	exeinto "${CHROMIUM_HOME}"
+	doexe out/Release/chrome || die
+	doexe out/Release/chrome_sandbox || die
+	fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox"
+
+	if use chromedriver; then
+		doexe out/Release/chromedriver || die
+	fi
+
+	# Install Native Client files on platforms that support it.
+	# insinto "${CHROMIUM_HOME}"
+	# case "$(tc-arch)" in
+	# 	amd64)
+	# 		doins out/Release/nacl_irt_x86_64.nexe || die
+	# 		doins out/Release/libppGoogleNaClPluginChrome.so || die
+	# 	;;
+	# 	x86)
+	# 		doins out/Release/nacl_irt_x86_32.nexe || die
+	# 		doins out/Release/libppGoogleNaClPluginChrome.so || die
+	# 	;;
+	# esac
+
+	newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die
+
+	# It is important that we name the target "chromium-browser",
+	# xdg-utils expect it; bug #355517.
+	dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser || die
+	# keep the old symlink around for consistency
+	dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium || die
+
+	# Allow users to override command-line options, bug #357629.
+	dodir /etc/chromium || die
+	insinto /etc/chromium
+	newins "${FILESDIR}/chromium.default" "default" || die
+
+	# Support LINGUAS, bug #332751.
+	local pak
+	for pak in out/Release/locales/*.pak; do
+		local pakbasename="$(basename ${pak})"
+		local pakname="${pakbasename%.pak}"
+		local langname="${pakname//-/_}"
+
+		# Do not issue warning for en_US locale. This is the fallback
+		# locale so it should always be installed.
+		if [[ "${langname}" == "en_US" ]]; then
+			continue
+		fi
+
+		local found=false
+		local lang
+		for lang in ${LANGS}; do
+			local crlang="$(chromium_lang ${lang})"
+			if [[ "${langname}" == "${crlang}" ]]; then
+				found=true
+				break
+			fi
+		done
+		if ! $found; then
+			ewarn "LINGUAS warning: no ${langname} in LANGS"
+		fi
+	done
+	local lang
+	for lang in ${LANGS}; do
+		local crlang="$(chromium_lang ${lang})"
+		local pakfile="out/Release/locales/${crlang//_/-}.pak"
+		if [ ! -f "${pakfile}" ]; then
+			ewarn "LINGUAS warning: no .pak file for ${lang} (${pakfile} not found)"
+		fi
+		if ! use linguas_${lang}; then
+			rm "${pakfile}" || die
+		fi
+	done
+
+	insinto "${CHROMIUM_HOME}"
+	doins out/Release/chrome.pak || die
+	doins out/Release/resources.pak || die
+
+	doins -r out/Release/locales || die
+	doins -r out/Release/resources || die
+
+	newman out/Release/chrome.1 chromium.1 || die
+	newman out/Release/chrome.1 chromium-browser.1 || die
+
+	# Chromium looks for these in its folder
+	# See media_posix.cc and base_paths_linux.cc
+	# dosym /usr/$(get_libdir)/libavcodec.so.52 "${CHROMIUM_HOME}" || die
+	# dosym /usr/$(get_libdir)/libavformat.so.52 "${CHROMIUM_HOME}" || die
+	# dosym /usr/$(get_libdir)/libavutil.so.50 "${CHROMIUM_HOME}" || die
+	doexe out/Release/libffmpegsumo.so || die
+
+	# Install icons and desktop entry.
+	for SIZE in 16 22 24 32 48 64 128 256 ; do
+		insinto /usr/share/icons/hicolor/${SIZE}x${SIZE}/apps
+		newins chrome/app/theme/chromium/product_logo_${SIZE}.png \
+			chromium-browser.png || die
+	done
+	local mime_types="text/html;text/xml;application/xhtml+xml;"
+	mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
+	make_desktop_entry chromium-browser "Chromium" chromium-browser \
+		"Network;WebBrowser" \
+		"MimeType=${mime_types}\nStartupWMClass=chromium-browser"
+	sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
+
+	# Install GNOME default application entry (bug #303100).
+	if use gnome; then
+		dodir /usr/share/gnome-control-center/default-apps || die
+		insinto /usr/share/gnome-control-center/default-apps
+		doins "${FILESDIR}"/chromium-browser.xml || die
+	fi
+}
+
+pkg_preinst() {
+	gnome2_icon_savelist
+}
+
+pkg_postinst() {
+	fdo-mime_desktop_database_update
+	gnome2_icon_cache_update
+
+	# For more info see bug #292201, bug #352263, bug #361859.
+	elog
+	elog "Depending on your desktop environment, you may need"
+	elog "to install additional packages to get icons on the Downloads page."
+	elog
+	elog "For KDE, the required package is kde-base/oxygen-icons."
+	elog
+	elog "For other desktop environments, try one of the following:"
+	elog " - x11-themes/gnome-icon-theme"
+	elog " - x11-themes/tango-icon-theme"
+
+	# For more info see bug #359153.
+	elog
+	elog "Some web pages may require additional fonts to display properly."
+	elog "Try installing some of the following packages if some characters"
+	elog "are not displayed properly:"
+	elog " - media-fonts/arphicfonts"
+	elog " - media-fonts/bitstream-cyberbit"
+	elog " - media-fonts/droid"
+	elog " - media-fonts/ipamonafont"
+	elog " - media-fonts/ja-ipafonts"
+	elog " - media-fonts/takao-fonts"
+	elog " - media-fonts/wqy-microhei"
+	elog " - media-fonts/wqy-zenhei"
+}
+
+pkg_postrm() {
+	gnome2_icon_cache_update
+}

www-client/chromium/files/chromium-OF-r0.patch

+diff --git a/chrome/common/zip_internal.cc b/chrome/common/zip_internal.cc
+index ddcfd00..6c85548 100644
+--- a/chrome/common/zip_internal.cc
++++ b/chrome/common/zip_internal.cc
+@@ -2,6 +2,10 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ 
++#ifndef OF
++#  define OF(x) x
++#endif
++
+ #include "chrome/common/zip.h"
+ 
+ #include "base/utf_string_conversions.h"
+diff --git a/chrome/common/zip_reader.cc b/chrome/common/zip_reader.cc
+index 88d3f8f..be37f81 100644
+--- a/chrome/common/zip_reader.cc
++++ b/chrome/common/zip_reader.cc
+@@ -2,6 +2,10 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ 
++#ifndef OF
++#  define OF(x) x
++#endif
++
+ #include "chrome/common/zip_reader.h"
+ 
+ #include "base/file_util.h"

www-client/chromium/files/chromium-browser.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE default-apps SYSTEM "gnome-da-list.dtd">
+<default-apps>
+  <web-browsers>
+    <web-browser>
+      <name>Chromium</name>
+      <executable>chromium-browser</executable>
+      <command>chromium-browser %s</command>
+      <icon-name>chromium-browser</icon-name>
+      <run-in-terminal>false</run-in-terminal>
+    </web-browser>
+  </web-browsers>
+</default-apps>

www-client/chromium/files/chromium-cups-r0.patch

+--- chrome/browser/ui/webui/print_preview_handler.cc.orig	2011-04-23 09:05:25.000000000 +0200
++++ chrome/browser/ui/webui/print_preview_handler.cc	2011-04-23 09:13:07.000000000 +0200
+@@ -28,7 +28,7 @@
+ #include "printing/metafile_impl.h"
+ #include "printing/print_job_constants.h"
+ 
+-#if defined(OS_POSIX) && !defined(OS_CHROMEOS)
++#if defined(CP_PRINT_SYSTEM_AVAILABLE)
+ #include <cups/cups.h>
+ 
+ #include "base/file_util.h"
+@@ -42,7 +42,7 @@
+ const char kDisableColorOption[] = "disableColorOption";
+ const char kSetColorAsDefault[] = "setColorAsDefault";
+ 
+-#if defined(OS_POSIX) && !defined(OS_CHROMEOS)
++#if defined(CP_PRINT_SYSTEM_AVAILABLE)
+ const char kColorDevice[] = "ColorDevice";
+ #endif
+ 
+@@ -131,7 +131,7 @@
+       return;
+     }
+ 
+-  #if defined(OS_POSIX) && !defined(OS_CHROMEOS)
++#if defined(CP_PRINT_SYSTEM_AVAILABLE)
+     FilePath ppd_file_path;
+     if (!file_util::CreateTemporaryFile(&ppd_file_path))
+       return;
+@@ -153,9 +153,9 @@
+       ppdClose(ppd);
+     }
+     file_util::Delete(ppd_file_path, false);
+-  #elif defined(OS_WIN) || defined(OS_CHROMEOS)
++#else
+     NOTIMPLEMENTED();
+-  #endif
++#endif
+ 
+     DictionaryValue settings_info;
+     settings_info.SetBoolean(kDisableColorOption, !supports_color);

www-client/chromium/files/chromium-ffmpeg-build-r0.patch

+Index: media/ffmpeg/ffmpeg_common.h
+diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
+index ac1774a5b1dc7a80aee96e7e35fa2f5366e8f589..46dbe07bf5dad14e897b21b7f479776127ff7ef7 100644
+--- a/media/ffmpeg/ffmpeg_common.h
++++ b/media/ffmpeg/ffmpeg_common.h
+@@ -19,11 +19,15 @@ extern "C" {
+ // TODO(scherkus): fix and upstream the compiler warnings.
+ MSVC_PUSH_DISABLE_WARNING(4244);
+ #include <libavcodec/avcodec.h>
+-#include <libavcore/samplefmt.h>
+ #include <libavformat/avformat.h>
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
+ #include <libavutil/log.h>
++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50, 38, 0)
++#include <libavutil/samplefmt.h>
++#else
++#include <libavcore/samplefmt.h>
++#endif
+ MSVC_POP_WARNING();
+ }  // extern "C"
+ 

www-client/chromium/files/chromium-glibc-2.14-r0.patch

+--- third_party/tcmalloc/chromium/src/tcmalloc.cc.orig	2011-06-23 13:45:05.000000000 +0200
++++ third_party/tcmalloc/chromium/src/tcmalloc.cc	2011-06-23 13:47:51.000000000 +0200
+@@ -135,6 +135,10 @@
+ # define WIN32_DO_PATCHING 1
+ #endif
+ 
++#if !defined(__MALLOC_HOOK_VOLATILE)
++#define __MALLOC_HOOK_VOLATILE
++#endif
++
+ using std::max;
+ using tcmalloc::PageHeap;
+ using tcmalloc::SizeMap;
+@@ -375,7 +379,7 @@
+   return tc_malloc(size);
+ }
+ 
+-void* (*__malloc_hook)(
++void* (*__MALLOC_HOOK_VOLATILE __malloc_hook)(
+     size_t size, const void* caller) = tc_ptmalloc_malloc_hook;
+ 
+ static void* tc_ptmalloc_realloc_hook(
+@@ -383,14 +387,14 @@
+   return tc_realloc(ptr, size);
+ }
+ 
+-void* (*__realloc_hook)(
++void* (*__MALLOC_HOOK_VOLATILE __realloc_hook)(
+     void* ptr, size_t size, const void* caller) = tc_ptmalloc_realloc_hook;
+ 
+ static void tc_ptmalloc_free_hook(void* ptr, const void* caller) {
+   tc_free(ptr);
+ }
+ 
+-void (*__free_hook)(void* ptr, const void* caller) = tc_ptmalloc_free_hook;
++void (*__MALLOC_HOOK_VOLATILE __free_hook)(void* ptr, const void* caller) = tc_ptmalloc_free_hook;
+ 
+ #endif
+ 
+@@ -1584,7 +1588,7 @@
+   MallocHook::InvokeNewHook(result, size);
+   return result;
+ }
+-void *(*__memalign_hook)(size_t, size_t, const void *) = MemalignOverride;
++void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t, size_t, const void *) = MemalignOverride;
+ #endif  // #ifndef TCMALLOC_FOR_DEBUGALLOCATION
+ 
+ // ---Double free() debugging implementation -----------------------------------

www-client/chromium/files/chromium-icu-compatibility-r0.patch

+this patch fixes build failures with ICU 4.8
+
+http://codereview.chromium.org/7421003/
+https://bugs.gentoo.org/show_bug.cgi?id=374903
+
+--- v8/src/extensions/experimental/number-format.cc
++++ v8/src/extensions/experimental/number-format.cc
+@@ -36,6 +36,8 @@
+ #include "unicode/numfmt.h"
+ #include "unicode/uchar.h"
+ #include "unicode/ucurr.h"
++#include "unicode/unum.h"
++#include "unicode/uversion.h"
+ 
+ namespace v8 {
+ namespace internal {
+@@ -231,6 +233,8 @@
+ }
+ 
+ // Generates ICU number format pattern from given skeleton.
++// TODO(cira): Remove once ICU includes equivalent method
++// (see http://bugs.icu-project.org/trac/ticket/8610).
+ static icu::DecimalFormat* CreateFormatterFromSkeleton(
+     const icu::Locale& icu_locale,
+     const icu::UnicodeString& skeleton,
+@@ -251,6 +255,7 @@
+     // Case of non-consecutive U+00A4 is taken care of in i18n.js.
+     int32_t end_index = skeleton.lastIndexOf(currency_symbol, index);
+ 
++#if (U_ICU_VERSION_MAJOR_NUM == 4) && (U_ICU_VERSION_MINOR_NUM <= 6)
+     icu::NumberFormat::EStyles style;
+     switch (end_index - index) {
+       case 0:
+@@ -262,6 +267,19 @@
+       default:
+         style = icu::NumberFormat::kPluralCurrencyStyle;
+     }
++#else  // ICU version is 4.8 or above (we ignore versions below 4.0).
++    UNumberFormatStyle style;
++    switch (end_index - index) {
++      case 0:
++        style = UNUM_CURRENCY;
++        break;
++      case 1:
++        style = UNUM_CURRENCY_ISO;
++        break;
++      default:
++        style = UNUM_CURRENCY_PLURAL;
++    }
++#endif
+ 
+     base_format = static_cast<icu::DecimalFormat*>(
+         icu::NumberFormat::createInstance(icu_locale, style, *status));

www-client/chromium/files/chromium-kerberos-r0.patch

+Index: net/http/http_auth_gssapi_posix.cc
+diff --git a/net/http/http_auth_gssapi_posix.cc b/net/http/http_auth_gssapi_posix.cc
+index 431cfc4f2b54730fa6b46a6801c25cf691b7c878..aff2ac1114e09ec202b1ce4bd8d63ebd41483632 100644
+--- a/net/http/http_auth_gssapi_posix.cc
++++ b/net/http/http_auth_gssapi_posix.cc
+@@ -55,6 +55,16 @@ static gss_OID_desc GSS_C_NT_EXPORT_NAME_VAL = {
+ 
+ }  // namespace
+ 
++// Heimdal >= 1.4 will define the following as preprocessor macros.
++// To avoid conflicting declarations, we have to undefine these.
++#undef GSS_C_NT_USER_NAME
++#undef GSS_C_NT_MACHINE_UID_NAME
++#undef GSS_C_NT_STRING_UID_NAME
++#undef GSS_C_NT_HOSTBASED_SERVICE_X
++#undef GSS_C_NT_HOSTBASED_SERVICE
++#undef GSS_C_NT_ANONYMOUS
++#undef GSS_C_NT_EXPORT_NAME
++
+ gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_VAL;
+ gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_VAL;
+ gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_VAL;

www-client/chromium/files/chromium-launcher-r1.sh

+#!/bin/bash
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Let the wrapped binary know that it has been run through the wrapper
+export CHROME_WRAPPER="`readlink -f "$0"`"
+
+PROGDIR="`dirname "$CHROME_WRAPPER"`"
+
+case ":$PATH:" in
+  *:$PROGDIR:*)
+    # $PATH already contains $PROGDIR
+    ;;
+  *)
+    # Append $PROGDIR to $PATH
+    export PATH="$PATH:$PROGDIR"
+    ;;
+esac
+
+# Set the .desktop file name
+export CHROME_DESKTOP="chromium-browser-chromium.desktop"
+
+exec -a "chromium-browser" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins "$@"

www-client/chromium/files/chromium-launcher-r2.sh

+#!/bin/bash
+
+# Allow the user to override command-line flags, bug #357629.
+# This is based on Debian's chromium-browser package, and is intended
+# to be consistent with Debian.
+if [ -f /etc/chromium/default ] ; then
+	. /etc/chromium/default
+fi
+
+# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system
+# default CHROMIUM_FLAGS (from /etc/chromium/default).
+CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
+
+# Let the wrapped binary know that it has been run through the wrapper
+export CHROME_WRAPPER="`readlink -f "$0"`"
+
+PROGDIR="`dirname "$CHROME_WRAPPER"`"
+
+case ":$PATH:" in
+  *:$PROGDIR:*)
+    # $PATH already contains $PROGDIR
+    ;;
+  *)
+    # Append $PROGDIR to $PATH
+    export PATH="$PATH:$PROGDIR"
+    ;;
+esac
+
+# Set the .desktop file name
+export CHROME_DESKTOP="chromium-browser-chromium.desktop"
+
+exec -a "chromium-browser" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@"

www-client/chromium/files/chromium-libgcrypt-r0.patch

+--- build/linux/system.gyp.orig	2011-06-28 07:58:51.000000000 +0000
++++ build/linux/system.gyp	2011-06-28 08:00:05.000000000 +0000
+@@ -314,7 +314,7 @@
+       'target_name': 'libgcrypt',
+       'type': 'settings',
+       'conditions': [
+-        ['_toolset=="target"', {
++        ['_toolset=="target" and use_cups==1', {
+           'direct_dependent_settings': {
+             'cflags': [
+               '<!@(libgcrypt-config --cflags)',

www-client/chromium/files/chromium-perl-5.14-r0.patch

+Index: third_party/WebKit/Source/WebCore/make-hash-tools.pl
+===================================================================
+--- third_party/WebKit/Source/WebCore/make-hash-tools.pl	(revision 72664)
++++ third_party/WebKit/Source/WebCore/make-hash-tools.pl	(revision 89265)
+@@ -21,5 +21,4 @@
+ 
+ use strict;
+-use Switch;
+ use File::Basename;
+ 
+@@ -29,7 +28,5 @@
+ 
+ 
+-switch ($option) {
+-
+-case "DocTypeStrings" {
++if ($option eq "DocTypeStrings") {
+ 
+     my $docTypeStringsGenerated    = "$outdir/DocTypeStrings.cpp";
+@@ -39,7 +36,5 @@
+     system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
+ 
+-} # case "DocTypeStrings"
+-
+-case "ColorData" {
++} elsif ($option eq "ColorData") {
+ 
+     my $colorDataGenerated         = "$outdir/ColorData.cpp";
+@@ -49,5 +44,5 @@
+     system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
+ 
+-} # case "ColorData"
+-
+-} # switch ($option)
++} else {
++    die "Unknown option.";
++}

www-client/chromium/files/chromium-system-libevent-r0.patch

+--- base/base.gyp.orig	2011-08-04 18:25:17.000000000 +0200
++++ base/base.gyp	2011-08-04 18:25:24.000000000 +0200
+@@ -283,6 +283,9 @@
+             'message_pump_libevent_unittest.cc',
+           ],
+         }, {  # OS != "win"
++          'dependencies': [
++            '../third_party/libevent/libevent.gyp:libevent'
++          ],
+           'sources/': [
+             ['exclude', '^win/'],
+           ],

www-client/chromium/files/chromium-system-libevent-r1.patch

+--- chromium-14.0.836.0//base/base.gyp	2011-08-06 21:13:42.000000000 +0000
++++ fixed/chromium-14.0.836.0//base/base.gyp	2011-08-06 21:17:03.222084055 +0000
+@@ -283,6 +283,9 @@
+             'message_pump_libevent_unittest.cc',
+           ],
+         }, {  # OS != "win"
++          'dependencies': [
++            '../third_party/libevent/libevent.gyp:libevent'
++          ],
+           'sources/': [
+             ['exclude', '^win/'],
+           ],

www-client/chromium/files/chromium-system-libevent-r2.patch

+--- third_party/libevent/libevent.gyp.orig	2011-08-12 19:02:14.000000000 +0200
++++ third_party/libevent/libevent.gyp	2011-08-12 19:02:50.000000000 +0200
+@@ -67,6 +67,7 @@
+         {
+           'target_name': 'libevent',
+           'type': 'settings',
++          'toolsets': ['host', 'target'],
+           'direct_dependent_settings': {
+             'defines': [
+               'USE_SYSTEM_LIBEVENT',

www-client/chromium/files/chromium-system-vpx-r3.patch

+--- remoting/remoting.gyp.orig	2011-03-10 14:43:29.000000000 +0000
++++ remoting/remoting.gyp	2011-03-10 14:44:50.000000000 +0000
+@@ -127,6 +127,7 @@
+         '../ui/gfx/gfx.gyp:gfx',
+         '../media/media.gyp:media',
+         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
++        '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
+         '../third_party/libvpx/libvpx.gyp:libvpx_include',
+         '../third_party/zlib/zlib.gyp:zlib',
+         'chromoting_jingle_glue',
+--- third_party/ffmpeg/ffmpeg.gyp.orig	2011-03-10 15:39:13.000000000 +0000
++++ third_party/ffmpeg/ffmpeg.gyp	2011-03-10 15:39:41.000000000 +0000
+@@ -728,11 +728,14 @@
+                 '../libvpx/include',
+               ],
+             }, { # use_system_vpx != 0
++              'defines': [
++                'USE_SYSTEM_VPX',
++              ],
+               'direct_dependent_settings': {
++                'defines': [
++                  'USE_SYSTEM_VPX',
++                ],
+                 'link_settings': {
+-                  'defines': [
+-                    'USE_SYSTEM_VPX',
+-                  ],
+                   'libraries': [
+                     '-lvpx',
+                   ],

www-client/chromium/files/chromium-system-vpx-r4.patch

+--- remoting/remoting.gyp.orig	2011-03-10 14:43:29.000000000 +0000
++++ remoting/remoting.gyp	2011-03-10 14:44:50.000000000 +0000
+@@ -127,6 +127,7 @@
+         '../ui/gfx/gfx.gyp:gfx',
+         '../media/media.gyp:media',
+         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
++        '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
+         '../third_party/libvpx/libvpx.gyp:libvpx_include',
+         '../third_party/zlib/zlib.gyp:zlib',
+         'chromoting_jingle_glue',

www-client/chromium/files/chromium-system-zlib-r0.patch

+--- content/browser/renderer_host/clipboard_message_filter.cc.orig	2011-04-21 12:29:49.000000000 +0200
++++ content/browser/renderer_host/clipboard_message_filter.cc	2011-04-21 12:31:14.000000000 +0200
+@@ -4,6 +4,12 @@
+ 
+ #include "content/browser/renderer_host/clipboard_message_filter.h"
+ 
++#if defined(USE_SYSTEM_ZLIB)
++#include <zlib.h>
++#else
++#include "third_party/zlib/zlib.h"
++#endif
++
+ #include "base/stl_util-inl.h"
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/clipboard_dispatcher.h"
+@@ -11,7 +17,6 @@
+ #include "googleurl/src/gurl.h"
+ #include "ipc/ipc_message_macros.h"
+ #include "third_party/skia/include/core/SkBitmap.h"
+-#include "third_party/zlib/zlib.h"
+ #include "ui/gfx/codec/png_codec.h"
+ #include "ui/gfx/size.h"
+ 
+--- content/content_browser.gypi.orig	2011-04-21 12:32:18.000000000 +0200
++++ content/content_browser.gypi	2011-04-21 12:32:56.000000000 +0200
+@@ -13,7 +13,8 @@
+         '../ppapi/ppapi.gyp:ppapi_proxy',
+         '../skia/skia.gyp:skia',
+         '../third_party/flac/flac.gyp:libflac',
+-        '../third_party/speex/speex.gyp:libspeex',
++        '../third_party/speex/speex.gyp:libspeex',	
++        '../third_party/zlib/zlib.gyp:zlib',
+         '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
+         '../ui/ui.gyp:ui_base',
+       ],

www-client/chromium/files/chromium-v8-func-no-scriptcolumnnumber-r0.patch

+diff --git a/third_party/WebKit/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/third_party/WebKit/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+index cfb0f05..4f4ecdb 100644
+--- a/third_party/WebKit/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
++++ b/third_party/WebKit/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+@@ -163,11 +163,11 @@ v8::Handle<v8::Value> V8InjectedScriptHost::functionLocationCallback(const v8::A
+         return v8::Undefined();
+     v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(value);
+     int lineNumber = function->GetScriptLineNumber();
+-    int columnNumber = function->GetScriptColumnNumber();
++//    int columnNumber = function->GetScriptColumnNumber();
+     v8::Local<v8::Object> result = v8::Object::New();
+     result->Set(v8::String::New("lineNumber"), v8::Integer::New(lineNumber));
+-    result->Set(v8::String::New("columnNumber"), v8::Integer::New(columnNumber));
+-    result->Set(v8::String::New("scriptId"), function->GetScriptId());
++//    result->Set(v8::String::New("columnNumber"), v8::Integer::New(columnNumber));
++//    result->Set(v8::String::New("scriptId"), function->GetScriptId());
+     return result;
+ }
+ 

www-client/chromium/files/chromium.default

+# Default settings for chromium. This file is sourced by /bin/bash from
+# the chromium launcher.
+
+# Options to pass to chromium.
+CHROMIUM_FLAGS=""

www-client/chromium/files/chromium.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE default-apps SYSTEM "gnome-da-list.dtd">
+<default-apps>
+  <web-browsers>
+    <web-browser>
+      <name>Chromium</name>
+      <executable>chromium-browser</executable>
+      <command>chromium-browser %s</command>
+      <icon-name>chromium-browser</icon-name>
+      <run-in-terminal>false</run-in-terminal>
+    </web-browser>
+  </web-browsers>
+</default-apps>

www-client/chromium/files/chromium_dialogs_12.patch

+--- chrome/browser/ui/gtk/dialogs_gtk.cc        (HEAD)
++++ chrome/browser/ui/gtk/dialogs_gtk.cc        (working copy)
+@@ -71,13 +71,13 @@
+       const FilePath& default_path, gfx::NativeWindow parent);
+ 
+   GtkWidget* CreateFileOpenDialog(const std::string& title,
+-      const FilePath& default_path, gfx::NativeWindow parent);
++      const FilePath& default_path, gfx::NativeWindow parent, gint* response_id, char** filename);
+ 
+   GtkWidget* CreateMultiFileOpenDialog(const std::string& title,
+       const FilePath& default_path, gfx::NativeWindow parent);
+ 
+   GtkWidget* CreateSaveAsDialog(const std::string& title,
+-      const FilePath& default_path, gfx::NativeWindow parent);
++      const FilePath& default_path, gfx::NativeWindow parent, gint* response_id, char** filename);
+ 
+   // Removes and returns the |params| associated with |dialog| from
+   // |params_map_|.
+@@ -94,6 +94,7 @@
+   // OnSelectSingleFolderDialogResponse.
+   void SelectSingleFileHelper(GtkWidget* dialog,
+                               gint response_id,
++                              char* filename,
+                               bool allow_folder);
+ 
+   // Common function for CreateFileOpenDialog and CreateMultiFileOpenDialog.
+@@ -108,16 +109,16 @@
+   bool CallDirectoryExistsOnUIThread(const FilePath& path);
+ 
+   // Callback for when the user responds to a Save As or Open File dialog.
+-  CHROMEGTK_CALLBACK_1(SelectFileDialogImpl, void,
+-                       OnSelectSingleFileDialogResponse, int);
++  CHROMEGTK_CALLBACK_2(SelectFileDialogImpl, void,
++                       OnSelectSingleFileDialogResponse, gint, char*);
+ 
+   // Callback for when the user responds to a Select Folder dialog.
+-  CHROMEGTK_CALLBACK_1(SelectFileDialogImpl, void,
+-                       OnSelectSingleFolderDialogResponse, int);
++  CHROMEGTK_CALLBACK_2(SelectFileDialogImpl, void,
++                       OnSelectSingleFolderDialogResponse, gint, char*);
+ 
+   // Callback for when the user responds to a Open Multiple Files dialog.
+-  CHROMEGTK_CALLBACK_1(SelectFileDialogImpl, void,
+-                       OnSelectMultiFileDialogResponse, int);
++  CHROMEGTK_CALLBACK_2(SelectFileDialogImpl, void,
++                       OnSelectMultiFileDialogResponse, gint, char*);
+ 
+   // Callback for when the file chooser gets destroyed.
+   CHROMEGTK_CALLBACK_0(SelectFileDialogImpl, void, OnFileChooserDestroy);
+@@ -215,20 +216,25 @@
+     file_types_.include_all_files = true;
+ 
+   GtkWidget* dialog = NULL;
++	gint response_id = GTK_RESPONSE_CANCEL;
++	char* filename = NULL;
++	bool kde = false;
+   switch (type) {
+     case SELECT_FOLDER:
+       dialog = CreateSelectFolderDialog(title_string, default_path,
+                                         owning_window);
+       break;
+     case SELECT_OPEN_FILE:
+-      dialog = CreateFileOpenDialog(title_string, default_path, owning_window);
++		dialog = CreateFileOpenDialog(title_string, default_path, owning_window, &response_id, &filename);
++		kde = true;
+       break;
+     case SELECT_OPEN_MULTI_FILE:
+       dialog = CreateMultiFileOpenDialog(title_string, default_path,
+                                          owning_window);
+       break;
+     case SELECT_SAVEAS_FILE:
+-      dialog = CreateSaveAsDialog(title_string, default_path, owning_window);
++		dialog = CreateSaveAsDialog(title_string, default_path, owning_window, &response_id, &filename);
++		kde = true;
+       break;
+     default:
+       NOTREACHED();
+@@ -236,22 +242,25 @@
+   }
+   dialogs_.insert(dialog);
+ 
++	if (kde) {
++		g_signal_connect(dialog, "destroy", G_CALLBACK(OnFileChooserDestroyThunk), this);
++		params_map_[dialog] = params;
++		OnSelectSingleFileDialogResponse(dialog, response_id, filename);
++	} else {
+   preview_ = gtk_image_new();
+   g_signal_connect(dialog, "destroy",
+                    G_CALLBACK(OnFileChooserDestroyThunk), this);
+   g_signal_connect(dialog, "update-preview",
+                    G_CALLBACK(OnUpdatePreviewThunk), this);
+   gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(dialog), preview_);
+-
+-  params_map_[dialog] = params;
+-
+-  // Set window-to-parent modality by adding the dialog to the same window
+-  // group as the parent.
+-  gtk_window_group_add_window(gtk_window_get_group(owning_window),
+-                              GTK_WINDOW(dialog));
+-  gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
+-
+-  gtk_widget_show_all(dialog);
++		params_map_[dialog] = params;
++		//   Set window-to-parent modality by adding the dialog to the same window
++		//   group as the parent.
++		gtk_window_group_add_window(gtk_window_get_group(owning_window),
++									GTK_WINDOW(dialog));
++		gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
++		gtk_widget_show_all(dialog);
++	}
+ }
+ 
+ void SelectFileDialogImpl::AddFilters(GtkFileChooser* chooser) {
+@@ -404,13 +413,48 @@
+ GtkWidget* SelectFileDialogImpl::CreateFileOpenDialog(
+     const std::string& title,
+     const FilePath& default_path,
+-    gfx::NativeWindow parent) {
++    gfx::NativeWindow parent,
++    gint* response_id, char** filename) {
+   std::string title_string = !title.empty() ? title :
+         l10n_util::GetStringUTF8(IDS_OPEN_FILE_DIALOG_TITLE);
+-  GtkWidget* dialog = CreateFileOpenHelper(title_string, default_path, parent);
+-  gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+-  g_signal_connect(dialog, "response",
+-                   G_CALLBACK(OnSelectSingleFileDialogResponseThunk), this);
++
++  GtkWidget* dialog =
++      gtk_file_chooser_dialog_new(title_string.c_str(), parent,
++                                  GTK_FILE_CHOOSER_ACTION_OPEN,
++                                  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
++                                  GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
++                                  NULL);
++
++  AddFilters(GTK_FILE_CHOOSER(dialog));
++
++	const char* start_path = "/";
++	if (!default_path.empty())
++		start_path = default_path.value().c_str();
++	else if (!last_saved_path_->empty())
++		start_path = last_opened_path_->value().c_str();
++
++	gchar* cmd[] = {
++		(gchar*)"kdialog",
++		(gchar*)"--getopenfilename",
++		(gchar*)start_path,
++		(gchar*)"*",
++		(gchar*)"--title",
++		(gchar*)title_string.c_str(),
++		NULL
++	};
++	gchar* output;
++	gint retval;
++	g_spawn_sync(NULL, cmd, NULL, (GSpawnFlags)(G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL), NULL, NULL, &output, NULL, &retval, NULL);
++	int outlen = strlen(output);
++	if (outlen > 1) {
++		output[outlen-1] = 0;  // \n at the end
++		*response_id = !retval ? GTK_RESPONSE_ACCEPT : GTK_RESPONSE_CANCEL;
++		*filename = output;
++	} else {  // no path -> error
++		*response_id = GTK_RESPONSE_CANCEL;
++		*filename = NULL;
++	}
++
+   return dialog;
+ }
+ 
+@@ -420,7 +464,24 @@
+     gfx::NativeWindow parent) {
+   std::string title_string = !title.empty() ? title :
+         l10n_util::GetStringUTF8(IDS_OPEN_FILES_DIALOG_TITLE);
+-  GtkWidget* dialog = CreateFileOpenHelper(title_string, default_path, parent);
++
++  GtkWidget* dialog =
++      gtk_file_chooser_dialog_new(title_string.c_str(), parent,
++                                  GTK_FILE_CHOOSER_ACTION_OPEN,
++                                  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
++                                  GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
++                                  NULL);
++
++  AddFilters(GTK_FILE_CHOOSER(dialog));
++  if (!default_path.empty()) {
++    // If the file doesn't exist, this will just switch to the correct
++    // directory. That's good enough.
++    gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog),
++                                  default_path.value().c_str());
++  } else if (!last_opened_path_->empty()) {
++    gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
++                                        last_opened_path_->value().c_str());
++  }
+   gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE);
+   g_signal_connect(dialog, "response",
+                    G_CALLBACK(OnSelectMultiFileDialogResponseThunk), this);
+@@ -428,7 +489,7 @@
+ }
+ 
+ GtkWidget* SelectFileDialogImpl::CreateSaveAsDialog(const std::string& title,
+-    const FilePath& default_path, gfx::NativeWindow parent) {
++    const FilePath& default_path, gfx::NativeWindow parent, gint* response_id, char** filename) {
+   std::string title_string = !title.empty() ? title :
+         l10n_util::GetStringUTF8(IDS_SAVE_AS_DIALOG_TITLE);
+ 
+@@ -440,23 +501,46 @@
+                                   NULL);
+ 
+   AddFilters(GTK_FILE_CHOOSER(dialog));
+-  if (!default_path.empty()) {
+-    // Since the file may not already exist, we use
+-    // set_current_folder() followed by set_current_name(), as per the
+-    // recommendation of the GTK docs.
+-    gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
+-        default_path.DirName().value().c_str());
+-    gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog),
+-        default_path.BaseName().value().c_str());
+-  } else if (!last_saved_path_->empty()) {
+-    gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
+-                                        last_saved_path_->value().c_str());
+-  }
+-  gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+-  gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog),
+-                                                 TRUE);
+-  g_signal_connect(dialog, "response",
+-                   G_CALLBACK(OnSelectSingleFileDialogResponseThunk), this);
++
++	const char* start_path = "/";
++	if (!default_path.empty())
++		start_path = default_path.value().c_str();
++	else if (!last_saved_path_->empty())
++		start_path = last_saved_path_->value().c_str();
++
++	gchar* cmd[] = {
++		(gchar*)"kdialog",
++		(gchar*)"--getsavefilename",
++		(gchar*)start_path,
++		(gchar*)"*",
++		(gchar*)"--title",
++		(gchar*)title_string.c_str(),
++		NULL
++	};
++	gchar* output;
++	gint retval;
++	g_spawn_sync(NULL, cmd, NULL, (GSpawnFlags)(G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL), NULL, NULL, &output, NULL, &retval, NULL);
++	int outlen = strlen(output);
++	if (outlen > 1) {
++		output[outlen-1] = 0;  // \n at the end
++		// confirm overwrite
++		FilePath path(output);
++		if (CallDirectoryExistsOnUIThread(path)) {
++			gchar* cmd[] = {
++				(gchar*)"kdialog",
++				(gchar*)"--yesno",
++				(gchar*)"This file already exists. Do you want to replace it?",
++				NULL
++			};
++			g_spawn_sync(NULL, cmd, NULL, (GSpawnFlags)(G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL | G_SPAWN_STDOUT_TO_DEV_NULL), NULL, NULL, NULL, NULL, &retval, NULL);
++		}
++		*response_id = !retval ? GTK_RESPONSE_ACCEPT : GTK_RESPONSE_CANCEL;
++		*filename = output;
++	} else {  // no path -> error
++		*response_id = GTK_RESPONSE_CANCEL;
++		*filename = NULL;
++	}
++
+   return dialog;
+ }
+ 
+@@ -497,15 +581,15 @@
+ }
+ 
+ void SelectFileDialogImpl::SelectSingleFileHelper(GtkWidget* dialog,
+-    gint response_id,
++    gint response_id, char* filename,
+     bool allow_folder) {
+-  if (IsCancelResponse(response_id)) {
++
++  if (!filename || !*filename) {
+     FileNotSelected(dialog);
+     return;
+   }
+ 
+-  gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+-  if (!filename) {
++  if (IsCancelResponse(response_id)) {
+     FileNotSelected(dialog);
+     return;
+   }
+@@ -525,17 +609,20 @@
+ }
+ 
+ void SelectFileDialogImpl::OnSelectSingleFileDialogResponse(GtkWidget* dialog,
+-                                                            int response_id) {
+-  SelectSingleFileHelper(dialog, response_id, false);
++                                                            int response_id,
++                                                            char* filename) {
++  SelectSingleFileHelper(dialog, response_id, filename, false);
+ }
+ 
+ void SelectFileDialogImpl::OnSelectSingleFolderDialogResponse(GtkWidget* dialog,
+-                                                              int response_id) {
+-  SelectSingleFileHelper(dialog, response_id, true);
++                                                              int response_id,
++                                                              char* filename) {
++  SelectSingleFileHelper(dialog, response_id, filename, true);
+ }
+ 
+ void SelectFileDialogImpl::OnSelectMultiFileDialogResponse(GtkWidget* dialog,
+-                                                           int response_id) {
++                                                           int response_id,
++                                                           char* filename) {
+   if (IsCancelResponse(response_id)) {
+     FileNotSelected(dialog);
+     return;

www-client/chromium/files/chromium_dialogs_16.patch