1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 Gentoo Foundation |
2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/chromium.eclass,v 1.1 2012/03/14 15:54:24 floppym Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/chromium.eclass,v 1.5 2012/05/30 06:15:24 phajdan.jr Exp $ |
4 | |
4 | |
5 | # @ECLASS: chromium.eclass |
5 | # @ECLASS: chromium.eclass |
6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
7 | # Chromium Herd <chromium@gentoo.org> |
7 | # Chromium Herd <chromium@gentoo.org> |
8 | # @AUTHOR: |
8 | # @AUTHOR: |
… | |
… | |
11 | |
11 | |
12 | inherit eutils fdo-mime gnome2-utils linux-info |
12 | inherit eutils fdo-mime gnome2-utils linux-info |
13 | |
13 | |
14 | EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm |
14 | EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm |
15 | |
15 | |
|
|
16 | if [[ ${PN} == chromium ]]; then |
|
|
17 | IUSE+=" custom-cflags" |
|
|
18 | fi |
|
|
19 | |
16 | # @FUNCTION: chromium_check_kernel_config |
20 | # @FUNCTION: chromium_suid_sandbox_check_kernel_config |
17 | # @USAGE: |
21 | # @USAGE: |
18 | # @DESCRIPTION: |
22 | # @DESCRIPTION: |
19 | # Ensures the system kernel is configured for full Chromium functionality. |
23 | # Ensures the system kernel supports features needed for SUID sandbox to work. |
20 | chromium_check_kernel_config() { |
24 | chromium_suid_sandbox_check_kernel_config() { |
21 | has "${EAPI:-0}" 0 1 2 3 && die "EAPI=${EAPI} is not supported" |
25 | has "${EAPI:-0}" 0 1 2 3 && die "EAPI=${EAPI} is not supported" |
22 | |
26 | |
23 | if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then |
27 | if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then |
24 | # Warn if the kernel does not support features needed for sandboxing. |
28 | # Warn if the kernel does not support features needed for sandboxing. |
25 | # Bug #363987. |
29 | # Bug #363987. |
26 | ERROR_PID_NS="PID_NS is required for sandbox to work" |
30 | ERROR_PID_NS="PID_NS is required for sandbox to work" |
27 | ERROR_NET_NS="NET_NS is required for sandbox to work" |
31 | ERROR_NET_NS="NET_NS is required for sandbox to work" |
28 | CONFIG_CHECK="~PID_NS ~NET_NS" |
32 | CONFIG_CHECK="~PID_NS ~NET_NS" |
29 | check_extra_config |
33 | check_extra_config |
30 | fi |
34 | fi |
|
|
35 | } |
|
|
36 | |
|
|
37 | # @FUNCTION: chromium_check_kernel_config |
|
|
38 | # @USAGE: |
|
|
39 | # @DESCRIPTION: |
|
|
40 | # Ensures the system kernel is configured for full Chromium functionality. |
|
|
41 | chromium_check_kernel_config() { |
|
|
42 | eqawarn "chromium_check_kernel_config is deprecated." |
|
|
43 | eqawarn "Please use chromium_suid_sandbox_check_kernel_config if applicable." |
|
|
44 | chromium_suid_sandbox_check_kernel_config |
31 | } |
45 | } |
32 | |
46 | |
33 | # @ECLASS-VARIABLE: CHROMIUM_LANGS |
47 | # @ECLASS-VARIABLE: CHROMIUM_LANGS |
34 | # @DEFAULT_UNSET |
48 | # @DEFAULT_UNSET |
35 | # @DESCRIPTION: |
49 | # @DESCRIPTION: |
… | |
… | |
120 | chromium_pkg_postinst() { |
134 | chromium_pkg_postinst() { |
121 | fdo-mime_desktop_database_update |
135 | fdo-mime_desktop_database_update |
122 | gnome2_icon_cache_update |
136 | gnome2_icon_cache_update |
123 | |
137 | |
124 | # For more info see bug #292201, bug #352263, bug #361859. |
138 | # For more info see bug #292201, bug #352263, bug #361859. |
|
|
139 | if ! has_version x11-themes/gnome-icon-theme && |
|
|
140 | ! has_version x11-themes/oxygen-icons ; then |
125 | elog |
141 | elog |
126 | elog "Depending on your desktop environment, you may need" |
142 | elog "Depending on your desktop environment, you may need" |
127 | elog "to install additional packages to get icons on the Downloads page." |
143 | elog "to install additional packages to get icons on the Downloads page." |
128 | elog |
144 | elog |
129 | elog "For KDE, the required package is kde-base/oxygen-icons." |
145 | elog "For KDE, the required package is kde-base/oxygen-icons." |
130 | elog |
146 | elog |
131 | elog "For other desktop environments, try one of the following:" |
147 | elog "For other desktop environments, try one of the following:" |
132 | elog " - x11-themes/gnome-icon-theme" |
148 | elog " - x11-themes/gnome-icon-theme" |
133 | elog " - x11-themes/tango-icon-theme" |
149 | elog " - x11-themes/tango-icon-theme" |
|
|
150 | fi |
134 | |
151 | |
135 | # For more info see bug #359153. |
152 | # For more info see bug #359153. |
136 | elog |
153 | elog |
137 | elog "Some web pages may require additional fonts to display properly." |
154 | elog "Some web pages may require additional fonts to display properly." |
138 | elog "Try installing some of the following packages if some characters" |
155 | elog "Try installing some of the following packages if some characters" |
… | |
… | |
159 | # Prevent user problems like bug #348235. |
176 | # Prevent user problems like bug #348235. |
160 | eshopts_push -s extglob |
177 | eshopts_push -s extglob |
161 | if is-flagq '-g?(gdb)?([1-9])'; then |
178 | if is-flagq '-g?(gdb)?([1-9])'; then |
162 | ewarn |
179 | ewarn |
163 | ewarn "You have enabled debug info (i.e. -g or -ggdb in your CFLAGS/CXXFLAGS)." |
180 | ewarn "You have enabled debug info (i.e. -g or -ggdb in your CFLAGS/CXXFLAGS)." |
|
|
181 | ewarn "This produces very large build files causes the linker to consume large" |
|
|
182 | ewarn "amounts of memory." |
|
|
183 | ewarn |
164 | ewarn "Please try removing -g{,gdb} before reporting a bug." |
184 | ewarn "Please try removing -g{,gdb} before reporting a bug." |
165 | ewarn |
185 | ewarn |
166 | fi |
186 | fi |
167 | eshopts_pop |
187 | eshopts_pop |
168 | |
188 | |