www-plugins/chrome-binary-plugins: automated update
[gentoo.git] / www-client / google-chrome-unstable / google-chrome-unstable-47.0.2508.0_p1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
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"
10
11 inherit readme.gentoo chromium eutils multilib pax-utils unpacker
12
13 DESCRIPTION="The web browser from Google"
14 HOMEPAGE="https://www.google.com/chrome"
15
16 if [[ ${PN} == google-chrome ]]; then
17         MY_PN=${PN}-stable
18 else
19         MY_PN=${PN}
20 fi
21
22 MY_P="${MY_PN}_${PV/_p/-}"
23
24 SRC_URI="
25         amd64? (
26                 https://dl.google.com/linux/chrome/deb/pool/main/g/${MY_PN}/${MY_P}_amd64.deb
27         )
28         x86? (
29                 https://dl.google.com/linux/chrome/deb/pool/main/g/${MY_PN}/${MY_P}_i386.deb
30         )
31 "
32
33 LICENSE="google-chrome"
34 SLOT="0"
35 KEYWORDS="-* ~amd64 ~x86"
36 IUSE="+plugins"
37 RESTRICT="bindist mirror strip"
38
39 RDEPEND="
40         app-arch/bzip2
41         app-misc/ca-certificates
42         dev-libs/expat
43         dev-libs/glib:2
44         dev-libs/nspr
45         dev-libs/nss
46         gnome-base/gconf:2
47         media-libs/alsa-lib
48         media-libs/fontconfig
49         media-libs/freetype:2
50         net-print/cups
51         sys-apps/dbus
52         sys-libs/libcap
53         x11-libs/cairo
54         x11-libs/gdk-pixbuf:2
55         x11-libs/gtk+:2
56         >=x11-libs/libX11-1.5.0
57         x11-libs/libXcomposite
58         x11-libs/libXcursor
59         x11-libs/libXdamage
60         x11-libs/libXext
61         x11-libs/libXfixes
62         x11-libs/libXi
63         x11-libs/libXrandr
64         x11-libs/libXrender
65         x11-libs/libXScrnSaver
66         x11-libs/libXtst
67         x11-libs/pango
68         x11-misc/xdg-utils
69 "
70
71 QA_PREBUILT="*"
72 S=${WORKDIR}
73 CHROME_HOME="opt/google/chrome${PN#google-chrome}"
74
75 DISABLE_AUTOFORMATTING="yes"
76 DOC_CONTENTS="
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
82 - media-fonts/droid
83 - media-fonts/ipamonafont
84 - media-fonts/ja-ipafonts
85 - media-fonts/takao-fonts
86 - media-fonts/wqy-microhei
87 - media-fonts/wqy-zenhei
88
89 Depending on your desktop environment, you may need
90 to install additional packages to get icons on the Downloads page.
91
92 For KDE, the required package is kde-apps/oxygen-icons.
93
94 For other desktop environments, try one of the following:
95 - x11-themes/gnome-icon-theme
96 - x11-themes/tango-icon-theme
97
98 Please notice the bundled flash player (PepperFlash).
99 You can (de)activate all flash plugins via chrome://plugins
100 "
101
102 pkg_nofetch() {
103         eerror "Please wait 24 hours and sync your tree before reporting a bug for google-chrome fetch failures."
104 }
105
106 pkg_setup() {
107         chromium_suid_sandbox_check_kernel_config
108 }
109
110 src_install() {
111         rm -r usr/share/menu || die
112         mv usr/share/doc/${MY_PN} usr/share/doc/${PF} || die
113
114         pushd "${CHROME_HOME}/locales" > /dev/null || die
115         chromium_remove_language_paks
116         popd > /dev/null || die
117
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
122         fi
123
124         local size
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
127         done
128
129         insinto /
130         doins -r opt usr
131
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"
136
137         readme.gentoo_create_doc
138 }
139
140 any_cpu_missing_flag() {
141         local value=$1
142         grep '^flags' /proc/cpuinfo | grep -qv "$value"
143 }
144
145 pkg_preinst() {
146         chromium_pkg_preinst
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
153         fi
154 }
155
156 pkg_postinst() {
157         fdo-mime_desktop_database_update
158         gnome2_icon_cache_update
159         readme.gentoo_print_elog
160 }