| 1 |
floppym |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
floppym |
1.2 |
# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-21.0.1180.75.ebuild,v 1.1 2012/08/08 00:05:22 floppym Exp $ |
| 4 |
floppym |
1.1 |
|
| 5 |
|
|
EAPI="4" |
| 6 |
|
|
PYTHON_DEPEND="2:2.6" |
| 7 |
|
|
|
| 8 |
|
|
CHROMIUM_LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he |
| 9 |
|
|
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 |
| 10 |
|
|
sv sw ta te th tr uk vi zh_CN zh_TW" |
| 11 |
|
|
|
| 12 |
|
|
inherit chromium eutils flag-o-matic multilib \ |
| 13 |
|
|
pax-utils portability python toolchain-funcs versionator virtualx |
| 14 |
|
|
|
| 15 |
|
|
DESCRIPTION="Open-source version of Google Chrome web browser" |
| 16 |
|
|
HOMEPAGE="http://chromium.org/" |
| 17 |
|
|
SRC_URI="http://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.bz2" |
| 18 |
|
|
|
| 19 |
|
|
LICENSE="BSD" |
| 20 |
|
|
SLOT="0" |
| 21 |
|
|
KEYWORDS="~amd64 ~x86" |
| 22 |
|
|
IUSE="bindist cups gnome gnome-keyring kerberos pulseaudio selinux" |
| 23 |
|
|
|
| 24 |
|
|
RDEPEND="app-arch/bzip2 |
| 25 |
|
|
cups? ( |
| 26 |
|
|
dev-libs/libgcrypt |
| 27 |
|
|
>=net-print/cups-1.3.11 |
| 28 |
|
|
) |
| 29 |
|
|
>=dev-lang/v8-3.11.10.6 |
| 30 |
|
|
dev-libs/dbus-glib |
| 31 |
|
|
dev-libs/elfutils |
| 32 |
|
|
dev-libs/expat |
| 33 |
|
|
>=dev-libs/icu-49.1.1-r1 |
| 34 |
|
|
>=dev-libs/libevent-1.4.13 |
| 35 |
|
|
dev-libs/libxml2[icu] |
| 36 |
|
|
dev-libs/libxslt |
| 37 |
|
|
>=dev-libs/nss-3.12.3 |
| 38 |
|
|
gnome? ( >=gnome-base/gconf-2.24.0 ) |
| 39 |
|
|
gnome-keyring? ( >=gnome-base/gnome-keyring-2.28.2 ) |
| 40 |
|
|
>=media-libs/alsa-lib-1.0.19 |
| 41 |
|
|
media-libs/flac |
| 42 |
|
|
>=media-libs/libjpeg-turbo-1.2.0-r1 |
| 43 |
|
|
media-libs/libpng |
| 44 |
|
|
media-libs/speex |
| 45 |
|
|
pulseaudio? ( media-sound/pulseaudio ) |
| 46 |
|
|
sys-fs/udev |
| 47 |
|
|
sys-libs/zlib |
| 48 |
|
|
virtual/libusb:1 |
| 49 |
|
|
x11-libs/gtk+:2 |
| 50 |
|
|
x11-libs/libXinerama |
| 51 |
|
|
x11-libs/libXScrnSaver |
| 52 |
|
|
x11-libs/libXtst |
| 53 |
|
|
kerberos? ( virtual/krb5 ) |
| 54 |
|
|
selinux? ( sys-libs/libselinux )" |
| 55 |
|
|
DEPEND="${RDEPEND} |
| 56 |
|
|
>=dev-lang/nacl-toolchain-newlib-0_p7311 |
| 57 |
|
|
dev-lang/perl |
| 58 |
|
|
dev-lang/yasm |
| 59 |
|
|
dev-python/ply |
| 60 |
|
|
dev-python/simplejson |
| 61 |
|
|
>=dev-util/gperf-3.0.3 |
| 62 |
|
|
>=sys-devel/bison-2.4.3 |
| 63 |
|
|
sys-devel/flex |
| 64 |
|
|
>=sys-devel/make-3.81-r2 |
| 65 |
|
|
virtual/pkgconfig |
| 66 |
|
|
test? ( |
| 67 |
|
|
dev-python/pyftpdlib |
| 68 |
|
|
)" |
| 69 |
|
|
RDEPEND+=" |
| 70 |
|
|
!=www-client/chromium-9999 |
| 71 |
|
|
x11-misc/xdg-utils |
| 72 |
|
|
virtual/ttf-fonts" |
| 73 |
|
|
|
| 74 |
|
|
if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then |
| 75 |
|
|
EBUILD_DEATH_HOOKS+=" chromium_pkg_die"; |
| 76 |
|
|
fi |
| 77 |
|
|
|
| 78 |
|
|
pkg_setup() { |
| 79 |
|
|
if [[ "${SLOT}" == "0" ]]; then |
| 80 |
|
|
CHROMIUM_SUFFIX="" |
| 81 |
|
|
else |
| 82 |
|
|
CHROMIUM_SUFFIX="-${SLOT}" |
| 83 |
|
|
fi |
| 84 |
|
|
CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}" |
| 85 |
|
|
|
| 86 |
|
|
# Make sure the build system will use the right tools, bug #340795. |
| 87 |
|
|
tc-export AR CC CXX RANLIB |
| 88 |
|
|
|
| 89 |
|
|
# Make sure the build system will use the right python, bug #344367. |
| 90 |
|
|
python_set_active_version 2 |
| 91 |
|
|
python_pkg_setup |
| 92 |
|
|
|
| 93 |
|
|
if ! use selinux; then |
| 94 |
|
|
chromium_suid_sandbox_check_kernel_config |
| 95 |
|
|
fi |
| 96 |
|
|
|
| 97 |
|
|
if use bindist; then |
| 98 |
|
|
elog "bindist enabled: H.264 video support will be disabled." |
| 99 |
|
|
else |
| 100 |
|
|
elog "bindist disabled: Resulting binaries may not be legal to re-distribute." |
| 101 |
|
|
fi |
| 102 |
|
|
} |
| 103 |
|
|
|
| 104 |
|
|
src_prepare() { |
| 105 |
|
|
ln -s /usr/$(get_libdir)/nacl-toolchain-newlib \ |
| 106 |
|
|
native_client/toolchain/linux_x86_newlib || die |
| 107 |
|
|
|
| 108 |
|
|
# zlib-1.2.5.1-r1 renames the OF macro in zconf.h, bug 383371. |
| 109 |
|
|
sed -i '1i#define OF(x) x' \ |
| 110 |
|
|
third_party/zlib/contrib/minizip/{ioapi,{,un}zip}.h || die |
| 111 |
|
|
|
| 112 |
|
|
# Fix build without NaCl glibc toolchain. |
| 113 |
|
|
epatch "${FILESDIR}/${PN}-ppapi-r0.patch" |
| 114 |
|
|
|
| 115 |
|
|
# Bug 427438. |
| 116 |
|
|
epatch "${FILESDIR}/${PN}-bison-2.6-r0.patch" |
| 117 |
|
|
|
| 118 |
|
|
epatch_user |
| 119 |
|
|
|
| 120 |
|
|
# Remove most bundled libraries. Some are still needed. |
| 121 |
|
|
find third_party -type f \! -iname '*.gyp*' \ |
| 122 |
|
|
\! -path 'third_party/WebKit/*' \ |
| 123 |
|
|
\! -path 'third_party/angle/*' \ |
| 124 |
|
|
\! -path 'third_party/cacheinvalidation/*' \ |
| 125 |
|
|
\! -path 'third_party/cld/*' \ |
| 126 |
|
|
\! -path 'third_party/ffmpeg/*' \ |
| 127 |
|
|
\! -path 'third_party/flac/flac.h' \ |
| 128 |
|
|
\! -path 'third_party/gpsd/*' \ |
| 129 |
|
|
\! -path 'third_party/harfbuzz/*' \ |
| 130 |
|
|
\! -path 'third_party/hunspell/*' \ |
| 131 |
|
|
\! -path 'third_party/iccjpeg/*' \ |
| 132 |
|
|
\! -path 'third_party/jsoncpp/*' \ |
| 133 |
|
|
\! -path 'third_party/khronos/*' \ |
| 134 |
|
|
\! -path 'third_party/launchpad_translations/*' \ |
| 135 |
|
|
\! -path 'third_party/leveldatabase/*' \ |
| 136 |
|
|
\! -path 'third_party/libjingle/*' \ |
| 137 |
|
|
\! -path 'third_party/libphonenumber/*' \ |
| 138 |
|
|
\! -path 'third_party/libsrtp/*' \ |
| 139 |
|
|
\! -path 'third_party/libusb/libusb.h' \ |
| 140 |
|
|
\! -path 'third_party/libvpx/*' \ |
| 141 |
|
|
\! -path 'third_party/libwebp/*' \ |
| 142 |
|
|
\! -path 'third_party/libxml/chromium/*' \ |
| 143 |
|
|
\! -path 'third_party/libyuv/*' \ |
| 144 |
|
|
\! -path 'third_party/lss/*' \ |
| 145 |
|
|
\! -path 'third_party/mesa/*' \ |
| 146 |
|
|
\! -path 'third_party/modp_b64/*' \ |
| 147 |
|
|
\! -path 'third_party/mongoose/*' \ |
| 148 |
|
|
\! -path 'third_party/npapi/*' \ |
| 149 |
|
|
\! -path 'third_party/openmax/*' \ |
| 150 |
|
|
\! -path 'third_party/ots/*' \ |
| 151 |
|
|
\! -path 'third_party/protobuf/*' \ |
| 152 |
|
|
\! -path 'third_party/scons-2.0.1/*' \ |
| 153 |
|
|
\! -path 'third_party/sfntly/*' \ |
| 154 |
|
|
\! -path 'third_party/skia/*' \ |
| 155 |
|
|
\! -path 'third_party/smhasher/*' \ |
| 156 |
|
|
\! -path 'third_party/speex/speex.h' \ |
| 157 |
|
|
\! -path 'third_party/sqlite/*' \ |
| 158 |
|
|
\! -path 'third_party/tlslite/*' \ |
| 159 |
|
|
\! -path 'third_party/trace-viewer/*' \ |
| 160 |
|
|
\! -path 'third_party/undoview/*' \ |
| 161 |
|
|
\! -path 'third_party/v8-i18n/*' \ |
| 162 |
|
|
\! -path 'third_party/webdriver/*' \ |
| 163 |
|
|
\! -path 'third_party/webgl_conformance/*' \ |
| 164 |
|
|
\! -path 'third_party/webrtc/*' \ |
| 165 |
|
|
\! -path 'third_party/zlib/contrib/minizip/*' \ |
| 166 |
|
|
-delete || die |
| 167 |
|
|
|
| 168 |
|
|
local v8_bundled="$(chromium_bundled_v8_version)" |
| 169 |
|
|
local v8_installed="$(chromium_installed_v8_version)" |
| 170 |
|
|
einfo "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}" |
| 171 |
|
|
|
| 172 |
|
|
# Remove bundled v8. |
| 173 |
|
|
find v8 -type f \! -iname '*.gyp*' -delete || die |
| 174 |
|
|
|
| 175 |
|
|
# The implementation files include v8 headers with full path, |
| 176 |
|
|
# like #include "v8/include/v8.h". Make sure the system headers |
| 177 |
|
|
# will be used. |
| 178 |
|
|
# TODO: find a solution that can be upstreamed. |
| 179 |
|
|
rmdir v8/include || die |
| 180 |
|
|
ln -s /usr/include v8/include || die |
| 181 |
|
|
|
| 182 |
|
|
# Make sure the build system will use the right python, bug #344367. |
| 183 |
|
|
# Only convert directories that need it, to save time. |
| 184 |
|
|
python_convert_shebangs -q -r 2 build tools |
| 185 |
|
|
} |
| 186 |
|
|
|
| 187 |
|
|
src_configure() { |
| 188 |
|
|
local myconf="" |
| 189 |
|
|
|
| 190 |
|
|
# Never tell the build system to "enable" SSE2, it has a few unexpected |
| 191 |
|
|
# additions, bug #336871. |
| 192 |
|
|
myconf+=" -Ddisable_sse2=1" |
| 193 |
|
|
|
| 194 |
|
|
# Disable tcmalloc, it causes problems with e.g. NVIDIA |
| 195 |
|
|
# drivers, bug #413637. |
| 196 |
|
|
myconf+=" -Dlinux_use_tcmalloc=0" |
| 197 |
|
|
|
| 198 |
|
|
# Disable glibc Native Client toolchain, we don't need it (bug #417019). |
| 199 |
|
|
myconf+=" -Ddisable_glibc=1" |
| 200 |
|
|
|
| 201 |
|
|
# Make it possible to remove third_party/adobe. |
| 202 |
|
|
echo > "${T}/flapper_version.h" || die |
| 203 |
|
|
myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h" |
| 204 |
|
|
|
| 205 |
|
|
# Use system-provided libraries. |
| 206 |
|
|
# TODO: use_system_ffmpeg |
| 207 |
|
|
# TODO: use_system_hunspell (upstream changes needed). |
| 208 |
|
|
# TODO: use_system_ssl (http://crbug.com/58087). |
| 209 |
|
|
# TODO: use_system_sqlite (http://crbug.com/22208). |
| 210 |
|
|
# TODO: use_system_vpx |
| 211 |
|
|
# TODO: use_system_webp (https://chromiumcodereview.appspot.com/10496016 |
| 212 |
|
|
# needs to become part of webp release) |
| 213 |
|
|
myconf+=" |
| 214 |
|
|
-Duse_system_bzip2=1 |
| 215 |
|
|
-Duse_system_flac=1 |
| 216 |
|
|
-Duse_system_icu=1 |
| 217 |
|
|
-Duse_system_libevent=1 |
| 218 |
|
|
-Duse_system_libjpeg=1 |
| 219 |
|
|
-Duse_system_libpng=1 |
| 220 |
|
|
-Duse_system_libusb=1 |
| 221 |
|
|
-Duse_system_libxml=1 |
| 222 |
|
|
-Duse_system_speex=1 |
| 223 |
|
|
-Duse_system_v8=1 |
| 224 |
|
|
-Duse_system_xdg_utils=1 |
| 225 |
|
|
-Duse_system_yasm=1 |
| 226 |
|
|
-Duse_system_zlib=1" |
| 227 |
|
|
|
| 228 |
|
|
# Optional dependencies. |
| 229 |
|
|
# TODO: linux_link_kerberos, bug #381289. |
| 230 |
|
|
myconf+=" |
| 231 |
|
|
$(gyp_use cups) |
| 232 |
|
|
$(gyp_use gnome use_gconf) |
| 233 |
|
|
$(gyp_use gnome-keyring use_gnome_keyring) |
| 234 |
|
|
$(gyp_use gnome-keyring linux_link_gnome_keyring) |
| 235 |
|
|
$(gyp_use kerberos) |
| 236 |
|
|
$(gyp_use pulseaudio) |
| 237 |
|
|
$(gyp_use selinux selinux)" |
| 238 |
|
|
|
| 239 |
|
|
if ! use selinux; then |
| 240 |
|
|
# Enable SUID sandbox. |
| 241 |
|
|
myconf+=" |
| 242 |
|
|
-Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox |
| 243 |
|
|
-Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome" |
| 244 |
|
|
fi |
| 245 |
|
|
|
| 246 |
|
|
# Never use bundled gold binary. Disable gold linker flags for now. |
| 247 |
|
|
myconf+=" |
| 248 |
|
|
-Dlinux_use_gold_binary=0 |
| 249 |
|
|
-Dlinux_use_gold_flags=0" |
| 250 |
|
|
|
| 251 |
|
|
if ! use bindist; then |
| 252 |
|
|
# Enable H.624 support in bundled ffmpeg. |
| 253 |
|
|
myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=Chrome" |
| 254 |
|
|
fi |
| 255 |
|
|
|
| 256 |
|
|
local myarch="$(tc-arch)" |
| 257 |
|
|
if [[ $myarch = amd64 ]] ; then |
| 258 |
|
|
myconf+=" -Dtarget_arch=x64" |
| 259 |
|
|
elif [[ $myarch = x86 ]] ; then |
| 260 |
|
|
myconf+=" -Dtarget_arch=ia32" |
| 261 |
|
|
else |
| 262 |
|
|
die "Failed to determine target arch, got '$myarch'." |
| 263 |
|
|
fi |
| 264 |
|
|
|
| 265 |
|
|
# Make sure that -Werror doesn't get added to CFLAGS by the build system. |
| 266 |
|
|
# Depending on GCC version the warnings are different and we don't want |
| 267 |
|
|
# the build to fail because of that. |
| 268 |
|
|
myconf+=" -Dwerror=" |
| 269 |
|
|
|
| 270 |
|
|
# Avoid CFLAGS problems, bug #352457, bug #390147. |
| 271 |
|
|
if ! use custom-cflags; then |
| 272 |
|
|
replace-flags "-Os" "-O2" |
| 273 |
|
|
strip-flags |
| 274 |
|
|
fi |
| 275 |
|
|
|
| 276 |
|
|
egyp_chromium ${myconf} || die |
| 277 |
|
|
} |
| 278 |
|
|
|
| 279 |
|
|
src_compile() { |
| 280 |
|
|
local test_targets |
| 281 |
|
|
for x in base cacheinvalidation crypto \ |
| 282 |
|
|
googleurl gpu media net printing sql; do |
| 283 |
|
|
test_targets+=" ${x}_unittests" |
| 284 |
|
|
done |
| 285 |
|
|
|
| 286 |
|
|
local make_targets="chrome chromedriver" |
| 287 |
|
|
if ! use selinux; then |
| 288 |
|
|
make_targets+=" chrome_sandbox" |
| 289 |
|
|
fi |
| 290 |
|
|
if use test; then |
| 291 |
|
|
make_targets+=$test_targets |
| 292 |
|
|
fi |
| 293 |
|
|
|
| 294 |
|
|
# See bug #410883 for more info about the .host mess. |
| 295 |
|
|
emake ${make_targets} BUILDTYPE=Release V=1 \ |
| 296 |
|
|
CC.host="$(tc-getCC)" CFLAGS.host="${CFLAGS}" \ |
| 297 |
|
|
CXX.host="$(tc-getCXX)" CXXFLAGS.host="${CXXFLAGS}" \ |
| 298 |
|
|
LINK.host="$(tc-getCXX)" LDFLAGS.host="${LDFLAGS}" \ |
| 299 |
|
|
AR.host="$(tc-getAR)" || die |
| 300 |
|
|
|
| 301 |
|
|
pax-mark m out/Release/chrome |
| 302 |
|
|
if use test; then |
| 303 |
|
|
for x in $test_targets; do |
| 304 |
|
|
pax-mark m out/Release/${x} |
| 305 |
|
|
done |
| 306 |
|
|
fi |
| 307 |
|
|
} |
| 308 |
|
|
|
| 309 |
|
|
src_test() { |
| 310 |
|
|
# For more info see bug #350349. |
| 311 |
|
|
local mylocale='en_US.utf8' |
| 312 |
|
|
if ! locale -a | grep -q "$mylocale"; then |
| 313 |
|
|
eerror "${PN} requires ${mylocale} locale for tests" |
| 314 |
|
|
eerror "Please read the following guides for more information:" |
| 315 |
|
|
eerror " http://www.gentoo.org/doc/en/guide-localization.xml" |
| 316 |
|
|
eerror " http://www.gentoo.org/doc/en/utf-8.xml" |
| 317 |
|
|
die "locale ${mylocale} is not supported" |
| 318 |
|
|
fi |
| 319 |
|
|
|
| 320 |
|
|
# For more info see bug #370957. |
| 321 |
|
|
if [[ $UID -eq 0 ]]; then |
| 322 |
|
|
die "Tests must be run as non-root. Please use FEATURES=userpriv." |
| 323 |
|
|
fi |
| 324 |
|
|
|
| 325 |
|
|
# ICUStringConversionsTest: bug #350347. |
| 326 |
|
|
# MessagePumpLibeventTest: bug #398501. |
| 327 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/base_unittests virtualmake \ |
| 328 |
|
|
'--gtest_filter=-ICUStringConversionsTest.*:MessagePumpLibeventTest.*' |
| 329 |
|
|
|
| 330 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/cacheinvalidation_unittests virtualmake |
| 331 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/crypto_unittests virtualmake |
| 332 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/googleurl_unittests virtualmake |
| 333 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/gpu_unittests virtualmake |
| 334 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/media_unittests virtualmake |
| 335 |
|
|
|
| 336 |
|
|
# NetUtilTest: bug #361885. |
| 337 |
|
|
# DnsConfigServiceTest.GetSystemConfig: bug #394883. |
| 338 |
|
|
# CertDatabaseNSSTest.ImportServerCert_SelfSigned: bug #399269. |
| 339 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/net_unittests virtualmake \ |
| 340 |
|
|
'--gtest_filter=-NetUtilTest.IDNToUnicode*:NetUtilTest.FormatUrl*:DnsConfigServiceTest.GetSystemConfig:CertDatabaseNSSTest.ImportServerCert_SelfSigned:URLFetcher*' |
| 341 |
|
|
|
| 342 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/printing_unittests virtualmake |
| 343 |
|
|
LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/sql_unittests virtualmake |
| 344 |
|
|
} |
| 345 |
|
|
|
| 346 |
|
|
src_install() { |
| 347 |
|
|
exeinto "${CHROMIUM_HOME}" |
| 348 |
|
|
doexe out/Release/chrome || die |
| 349 |
|
|
|
| 350 |
|
|
if ! use selinux; then |
| 351 |
|
|
doexe out/Release/chrome_sandbox || die |
| 352 |
|
|
fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox" |
| 353 |
|
|
fi |
| 354 |
|
|
|
| 355 |
|
|
doexe out/Release/chromedriver || die |
| 356 |
|
|
|
| 357 |
|
|
doexe out/Release/nacl_helper{,_bootstrap} || die |
| 358 |
|
|
insinto "${CHROMIUM_HOME}" |
| 359 |
|
|
doins out/Release/nacl_irt_*.nexe || die |
| 360 |
|
|
doins out/Release/libppGoogleNaClPluginChrome.so || die |
| 361 |
|
|
|
| 362 |
|
|
newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die |
| 363 |
|
|
if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then |
| 364 |
|
|
sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" \ |
| 365 |
|
|
-i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die |
| 366 |
|
|
sed "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g" \ |
| 367 |
|
|
-i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die |
| 368 |
|
|
sed "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:" \ |
| 369 |
|
|
-i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die |
| 370 |
|
|
fi |
| 371 |
|
|
|
| 372 |
|
|
# It is important that we name the target "chromium-browser", |
| 373 |
|
|
# xdg-utils expect it; bug #355517. |
| 374 |
|
|
dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die |
| 375 |
|
|
# keep the old symlink around for consistency |
| 376 |
|
|
dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die |
| 377 |
|
|
|
| 378 |
|
|
# Allow users to override command-line options, bug #357629. |
| 379 |
|
|
dodir /etc/chromium || die |
| 380 |
|
|
insinto /etc/chromium |
| 381 |
|
|
newins "${FILESDIR}/chromium.default" "default" || die |
| 382 |
|
|
|
| 383 |
|
|
pushd out/Release/locales > /dev/null || die |
| 384 |
|
|
chromium_remove_language_paks |
| 385 |
|
|
popd |
| 386 |
|
|
|
| 387 |
|
|
insinto "${CHROMIUM_HOME}" |
| 388 |
|
|
doins out/Release/*.pak || die |
| 389 |
|
|
|
| 390 |
|
|
doins -r out/Release/locales || die |
| 391 |
|
|
doins -r out/Release/resources || die |
| 392 |
|
|
|
| 393 |
|
|
newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die |
| 394 |
|
|
newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die |
| 395 |
|
|
|
| 396 |
|
|
doexe out/Release/libffmpegsumo.so || die |
| 397 |
|
|
|
| 398 |
|
|
# Install icons and desktop entry. |
| 399 |
|
|
local branding size |
| 400 |
|
|
for size in 16 22 24 32 48 64 128 256 ; do |
| 401 |
|
|
case ${size} in |
| 402 |
|
|
16|32) branding="chrome/app/theme/default_100_percent/chromium" ;; |
| 403 |
|
|
*) branding="chrome/app/theme/chromium" ;; |
| 404 |
|
|
esac |
| 405 |
|
|
newicon -s ${size} "${branding}/product_logo_${size}.png" \ |
| 406 |
|
|
chromium-browser${CHROMIUM_SUFFIX}.png |
| 407 |
|
|
done |
| 408 |
|
|
|
| 409 |
|
|
local mime_types="text/html;text/xml;application/xhtml+xml;" |
| 410 |
|
|
mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797 |
| 411 |
|
|
mime_types+="x-scheme-handler/ftp;" # bug #412185 |
| 412 |
|
|
mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393 |
| 413 |
|
|
make_desktop_entry \ |
| 414 |
|
|
chromium-browser${CHROMIUM_SUFFIX} \ |
| 415 |
|
|
"Chromium${CHROMIUM_SUFFIX}" \ |
| 416 |
|
|
chromium-browser${CHROMIUM_SUFFIX} \ |
| 417 |
|
|
"Network;WebBrowser" \ |
| 418 |
|
|
"MimeType=${mime_types}\nStartupWMClass=chromium-browser" |
| 419 |
|
|
sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die |
| 420 |
|
|
|
| 421 |
|
|
# Install GNOME default application entry (bug #303100). |
| 422 |
|
|
if use gnome; then |
| 423 |
|
|
dodir /usr/share/gnome-control-center/default-apps || die |
| 424 |
|
|
insinto /usr/share/gnome-control-center/default-apps |
| 425 |
|
|
newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die |
| 426 |
|
|
if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then |
| 427 |
|
|
sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \ |
| 428 |
|
|
"${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml |
| 429 |
|
|
fi |
| 430 |
|
|
fi |
| 431 |
|
|
} |