1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 CHROMIUM_LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he
8 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
9 sv sw ta te th tr uk vi zh_CN zh_TW"
11 inherit readme.gentoo chromium eutils multilib pax-utils unpacker
13 DESCRIPTION="The web browser from Google"
14 HOMEPAGE="https://www.google.com/chrome"
16 if [[ ${PN} == google-chrome ]]; then
22 MY_P="${MY_PN}_${PV/_p/-}"
26 https://dl.google.com/linux/chrome/deb/pool/main/g/${MY_PN}/${MY_P}_amd64.deb
29 https://dl.google.com/linux/chrome/deb/pool/main/g/${MY_PN}/${MY_P}_i386.deb
33 LICENSE="google-chrome"
35 KEYWORDS="-* ~amd64 ~x86"
37 RESTRICT="bindist mirror strip"
41 app-misc/ca-certificates
56 >=x11-libs/libX11-1.5.0
57 x11-libs/libXcomposite
65 x11-libs/libXScrnSaver
73 CHROME_HOME="opt/google/chrome${PN#google-chrome}"
75 DISABLE_AUTOFORMATTING="yes"
77 Some web pages may require additional fonts to display properly.
78 Try installing some of the following packages if some characters
79 are not displayed properly:
80 - media-fonts/arphicfonts
81 - media-fonts/bitstream-cyberbit
83 - media-fonts/ipamonafont
84 - media-fonts/ja-ipafonts
85 - media-fonts/takao-fonts
86 - media-fonts/wqy-microhei
87 - media-fonts/wqy-zenhei
89 Depending on your desktop environment, you may need
90 to install additional packages to get icons on the Downloads page.
92 For KDE, the required package is kde-apps/oxygen-icons.
94 For other desktop environments, try one of the following:
95 - x11-themes/gnome-icon-theme
96 - x11-themes/tango-icon-theme
98 Please notice the bundled flash player (PepperFlash).
99 You can (de)activate all flash plugins via chrome://plugins
103 eerror "Please wait 24 hours and sync your tree before reporting a bug for google-chrome fetch failures."
107 chromium_suid_sandbox_check_kernel_config
111 rm -r usr/share/menu || die
112 mv usr/share/doc/${MY_PN} usr/share/doc/${PF} || die
114 pushd "${CHROME_HOME}/locales" > /dev/null || die
115 chromium_remove_language_paks
116 popd > /dev/null || die
118 if use plugins ; then
119 local plugins="--extra-plugin-dir=/usr/$(get_libdir)/nsbrowser/plugins"
120 sed -e "/^exec/ i set -- \"${plugins}\" \"\$@\"" \
121 -i "${CHROME_HOME}/${PN}" || die
125 for size in 16 22 24 32 48 64 128 256 ; do
126 newicon -s ${size} "${CHROME_HOME}/product_logo_${size}.png" ${PN}.png
132 find "${ED}" -type d -empty -delete || die
133 chmod 755 "${ED}${CHROME_HOME}"/{chrome,${PN},nacl_helper{,_bootstrap},xdg-{mime,settings}} || die
134 chmod 4755 "${ED}${CHROME_HOME}/chrome-sandbox" || die
135 pax-mark m "${ED}${CHROME_HOME}/chrome"
137 readme.gentoo_create_doc
140 any_cpu_missing_flag() {
142 grep '^flags' /proc/cpuinfo | grep -qv "$value"
147 if any_cpu_missing_flag sse2; then
148 ewarn "The bundled PepperFlash plugin requires a CPU that supports the"
149 ewarn "SSE2 instruction set, and at least one of your CPUs does not"
150 ewarn "support this feature. Disabling PepperFlash."
151 sed -e "/^exec/ i set -- --disable-bundled-ppapi-flash \"\$@\"" \
152 -i "${ED}${CHROME_HOME}/google-chrome" || die
157 fdo-mime_desktop_database_update
158 gnome2_icon_cache_update
159 readme.gentoo_print_elog