/[gentoo-x86]/www-client/chromium/chromium-21.0.1180.55.ebuild
Gentoo

Contents of /www-client/chromium/chromium-21.0.1180.55.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jul 31 21:36:15 2012 UTC (2 years ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump for stable channel release.

(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20