mail-filter/dovecot-antispam: use system txt2man
[gentoo.git] / www-client / google-chrome-unstable / google-chrome-unstable-50.0.2633.3_p1.ebuild
1 # Copyright 1999-2016 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 fake_bidi"
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 "
29
30 LICENSE="google-chrome"
31 SLOT="0"
32 KEYWORDS="-* ~amd64"
33 IUSE="+plugins"
34 RESTRICT="bindist mirror strip"
35
36 DEPEND=""
37 RDEPEND="
38         app-arch/bzip2
39         app-misc/ca-certificates
40         dev-libs/expat
41         dev-libs/glib:2
42         dev-libs/nspr
43         dev-libs/nss
44         gnome-base/gconf:2
45         media-libs/alsa-lib
46         media-libs/fontconfig
47         media-libs/freetype:2
48         net-print/cups
49         sys-apps/dbus
50         sys-libs/libcap
51         x11-libs/cairo
52         x11-libs/gdk-pixbuf:2
53         x11-libs/gtk+:2
54         >=x11-libs/libX11-1.5.0
55         x11-libs/libXcomposite
56         x11-libs/libXcursor
57         x11-libs/libXdamage
58         x11-libs/libXext
59         x11-libs/libXfixes
60         x11-libs/libXi
61         x11-libs/libXrandr
62         x11-libs/libXrender
63         x11-libs/libXScrnSaver
64         x11-libs/libXtst
65         x11-libs/pango
66         x11-misc/xdg-utils
67 "
68
69 QA_PREBUILT="*"
70 S=${WORKDIR}
71 CHROME_HOME="opt/google/chrome${PN#google-chrome}"
72
73 DISABLE_AUTOFORMATTING="yes"
74 DOC_CONTENTS="
75 Some web pages may require additional fonts to display properly.
76 Try installing some of the following packages if some characters
77 are not displayed properly:
78 - media-fonts/arphicfonts
79 - media-fonts/bitstream-cyberbit
80 - media-fonts/droid
81 - media-fonts/ipamonafont
82 - media-fonts/ja-ipafonts
83 - media-fonts/takao-fonts
84 - media-fonts/wqy-microhei
85 - media-fonts/wqy-zenhei
86
87 Depending on your desktop environment, you may need
88 to install additional packages to get icons on the Downloads page.
89
90 For KDE, the required package is kde-frameworks/oxygen-icons.
91
92 For other desktop environments, try one of the following:
93 - x11-themes/gnome-icon-theme
94 - x11-themes/tango-icon-theme
95
96 Please notice the bundled flash player (PepperFlash).
97 You can (de)activate all flash plugins via chrome://plugins
98 "
99
100 pkg_nofetch() {
101         eerror "Please wait 24 hours and sync your tree before reporting a bug for google-chrome fetch failures."
102 }
103
104 pkg_setup() {
105         chromium_suid_sandbox_check_kernel_config
106 }
107
108 src_install() {
109         rm -r usr/share/menu || die
110         mv usr/share/doc/${MY_PN} usr/share/doc/${PF} || die
111
112         pushd "${CHROME_HOME}/locales" > /dev/null || die
113         chromium_remove_language_paks
114         popd > /dev/null || die
115
116         if use plugins ; then
117                 local plugins="--extra-plugin-dir=/usr/$(get_libdir)/nsbrowser/plugins"
118                 sed -e "/^exec/ i set -- \"${plugins}\" \"\$@\"" \
119                         -i "${CHROME_HOME}/${PN}" || die
120         fi
121
122         local size
123         for size in 16 22 24 32 48 64 128 256 ; do
124                 newicon -s ${size} "${CHROME_HOME}/product_logo_${size}.png" ${PN}.png
125         done
126
127         insinto /
128         doins -r opt usr
129
130         find "${ED}" -type d -empty -delete || die
131         chmod 755 "${ED}${CHROME_HOME}"/{chrome,${PN},nacl_helper{,_bootstrap},xdg-{mime,settings}} || die
132         chmod 4755 "${ED}${CHROME_HOME}/chrome-sandbox" || die
133         pax-mark m "${ED}${CHROME_HOME}/chrome"
134
135         readme.gentoo_create_doc
136 }
137
138 any_cpu_missing_flag() {
139         local value=$1
140         grep '^flags' /proc/cpuinfo | grep -qv "$value"
141 }
142
143 pkg_preinst() {
144         chromium_pkg_preinst
145         if any_cpu_missing_flag sse2; then
146                 ewarn "The bundled PepperFlash plugin requires a CPU that supports the"
147                 ewarn "SSE2 instruction set, and at least one of your CPUs does not"
148                 ewarn "support this feature. Disabling PepperFlash."
149                 sed -e "/^exec/ i set -- --disable-bundled-ppapi-flash \"\$@\"" \
150                         -i "${ED}${CHROME_HOME}/google-chrome" || die
151         fi
152 }
153
154 pkg_postinst() {
155         fdo-mime_desktop_database_update
156         gnome2_icon_cache_update
157         readme.gentoo_print_elog
158 }