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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jun 28 09:05:53 2012 UTC (11 months, 3 weeks ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove old

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

  ViewVC Help
Powered by ViewVC 1.1.20