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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Aug 17 19:52:25 2012 UTC (2 years, 3 months ago) by floppym
Branch: MAIN
Version bump for dev channel release.

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

1 floppym 1.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-22.0.1229.6.ebuild,v 1.2 2012/08/16 18:44:52 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-0.149
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/libwebp-0.2.0_rc1
45     media-libs/speex
46     pulseaudio? ( media-sound/pulseaudio )
47     sys-fs/udev
48     sys-libs/zlib
49     virtual/libusb:1
50     x11-libs/gtk+:2
51     x11-libs/libXinerama
52     x11-libs/libXScrnSaver
53     x11-libs/libXtst
54     kerberos? ( virtual/krb5 )
55     selinux? ( sys-libs/libselinux )"
56     DEPEND="${RDEPEND}
57     >=dev-lang/nacl-toolchain-newlib-0_p9093
58     dev-lang/perl
59     dev-lang/yasm
60     dev-python/ply
61     dev-python/simplejson
62     >=dev-util/gperf-3.0.3
63     >=sys-devel/bison-2.4.3
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/hyphen/*' \
130     \! -path 'third_party/iccjpeg/*' \
131     \! -path 'third_party/jsoncpp/*' \
132     \! -path 'third_party/khronos/*' \
133     \! -path 'third_party/launchpad_translations/*' \
134     \! -path 'third_party/leveldatabase/*' \
135     \! -path 'third_party/libjingle/*' \
136     \! -path 'third_party/libphonenumber/*' \
137     \! -path 'third_party/libsrtp/*' \
138     \! -path 'third_party/libusb/libusb.h' \
139     \! -path 'third_party/libva/*' \
140     \! -path 'third_party/libvpx/*' \
141     \! -path 'third_party/libxml/chromium/*' \
142     \! -path 'third_party/libXNVCtrl/*' \
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/qcms/*' \
153     \! -path 'third_party/re2/*' \
154     \! -path 'third_party/scons-2.0.1/*' \
155     \! -path 'third_party/sfntly/*' \
156     \! -path 'third_party/skia/*' \
157     \! -path 'third_party/smhasher/*' \
158     \! -path 'third_party/speex/speex.h' \
159     \! -path 'third_party/sqlite/*' \
160     \! -path 'third_party/tlslite/*' \
161     \! -path 'third_party/trace-viewer/*' \
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     # Disable glibc Native Client toolchain, we don't need it (bug #417019).
201     myconf+=" -Ddisable_glibc=1"
202    
203     # Make it possible to remove third_party/adobe.
204     echo > "${T}/flapper_version.h" || die
205     myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h"
206    
207     # Use system-provided libraries.
208     # TODO: use_system_ffmpeg
209     # TODO: use_system_hunspell (upstream changes needed).
210     # TODO: use_system_ssl (http://crbug.com/58087).
211     # TODO: use_system_sqlite (http://crbug.com/22208).
212     # TODO: use_system_vpx
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_libwebp=1
222     -Duse_system_libxml=1
223     -Duse_system_speex=1
224     -Duse_system_v8=1
225     -Duse_system_xdg_utils=1
226     -Duse_system_yasm=1
227     -Duse_system_zlib=1"
228    
229     # Optional dependencies.
230     # TODO: linux_link_kerberos, bug #381289.
231     myconf+="
232     $(gyp_use cups)
233     $(gyp_use gnome use_gconf)
234     $(gyp_use gnome-keyring use_gnome_keyring)
235     $(gyp_use gnome-keyring linux_link_gnome_keyring)
236     $(gyp_use kerberos)
237     $(gyp_use pulseaudio)
238     $(gyp_use selinux selinux)"
239    
240     # Use explicit library dependencies instead of dlopen.
241     # This makes breakages easier to detect by revdep-rebuild.
242     myconf+="
243     -Dlinux_link_gsettings=1"
244    
245     if ! use selinux; then
246     # Enable SUID sandbox.
247     myconf+="
248     -Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox
249     -Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome"
250     fi
251    
252     # Never use bundled gold binary. Disable gold linker flags for now.
253     myconf+="
254     -Dlinux_use_gold_binary=0
255     -Dlinux_use_gold_flags=0"
256    
257     if ! use bindist; then
258     # Enable H.624 support in bundled ffmpeg.
259     myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=Chrome"
260     fi
261    
262     local myarch="$(tc-arch)"
263     if [[ $myarch = amd64 ]] ; then
264     myconf+=" -Dtarget_arch=x64"
265     elif [[ $myarch = x86 ]] ; then
266     myconf+=" -Dtarget_arch=ia32"
267     else
268     die "Failed to determine target arch, got '$myarch'."
269     fi
270    
271     # Make sure that -Werror doesn't get added to CFLAGS by the build system.
272     # Depending on GCC version the warnings are different and we don't want
273     # the build to fail because of that.
274     myconf+=" -Dwerror="
275    
276     # Avoid CFLAGS problems, bug #352457, bug #390147.
277     if ! use custom-cflags; then
278     replace-flags "-Os" "-O2"
279     strip-flags
280     fi
281    
282     egyp_chromium ${myconf} || die
283     }
284    
285     src_compile() {
286     local test_targets
287     for x in base cacheinvalidation crypto \
288     googleurl gpu media net printing sql; do
289     test_targets+=" ${x}_unittests"
290     done
291    
292     local make_targets="chrome chromedriver"
293     if ! use selinux; then
294     make_targets+=" chrome_sandbox"
295     fi
296     if use test; then
297     make_targets+=$test_targets
298     fi
299    
300     # See bug #410883 for more info about the .host mess.
301     emake ${make_targets} BUILDTYPE=Release V=1 \
302     CC.host="$(tc-getCC)" CFLAGS.host="${CFLAGS}" \
303     CXX.host="$(tc-getCXX)" CXXFLAGS.host="${CXXFLAGS}" \
304     LINK.host="$(tc-getCXX)" LDFLAGS.host="${LDFLAGS}" \
305     AR.host="$(tc-getAR)" || die
306    
307     pax-mark m out/Release/chrome
308     if use test; then
309     for x in $test_targets; do
310     pax-mark m out/Release/${x}
311     done
312     fi
313     }
314    
315     src_test() {
316     # For more info see bug #350349.
317     local mylocale='en_US.utf8'
318     if ! locale -a | grep -q "$mylocale"; then
319     eerror "${PN} requires ${mylocale} locale for tests"
320     eerror "Please read the following guides for more information:"
321     eerror " http://www.gentoo.org/doc/en/guide-localization.xml"
322     eerror " http://www.gentoo.org/doc/en/utf-8.xml"
323     die "locale ${mylocale} is not supported"
324     fi
325    
326     # For more info see bug #370957.
327     if [[ $UID -eq 0 ]]; then
328     die "Tests must be run as non-root. Please use FEATURES=userpriv."
329     fi
330    
331     runtest() {
332     local cmd=$1
333     shift
334     local filter="--gtest_filter=$(IFS=:; echo "-${*}")"
335     einfo "${cmd}" "${filter}"
336     LC_ALL="${mylocale}" VIRTUALX_COMMAND="${cmd}" virtualmake "${filter}"
337     }
338    
339     local excluded_base_unittests=(
340     "ICUStringConversionsTest.*" # bug #350347
341     "MessagePumpLibeventTest.*" # bug #398591
342     )
343     runtest out/Release/base_unittests "${excluded_base_unittests[@]}"
344    
345     runtest out/Release/cacheinvalidation_unittests
346     runtest out/Release/crypto_unittests
347     runtest out/Release/googleurl_unittests
348     runtest out/Release/gpu_unittests
349     runtest out/Release/media_unittests
350    
351     local excluded_net_unittests=(
352     "NetUtilTest.IDNToUnicode*" # bug 361885
353     "NetUtilTest.FormatUrl*" # see above
354     "DnsConfigServiceTest.GetSystemConfig" # bug #394883
355     "CertDatabaseNSSTest.ImportServerCert_SelfSigned" # bug #399269
356     "URLFetcher*" # bug #425764
357     )
358     runtest out/Release/net_unittests "${excluded_net_unittests[@]}"
359    
360     runtest out/Release/printing_unittests
361     runtest out/Release/sql_unittests
362     }
363    
364     src_install() {
365     exeinto "${CHROMIUM_HOME}"
366     doexe out/Release/chrome || die
367    
368     if ! use selinux; then
369     doexe out/Release/chrome_sandbox || die
370     fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox"
371     fi
372    
373     doexe out/Release/chromedriver || die
374    
375     doexe out/Release/nacl_helper{,_bootstrap} || die
376     insinto "${CHROMIUM_HOME}"
377     doins out/Release/nacl_irt_*.nexe || die
378     doins out/Release/libppGoogleNaClPluginChrome.so || die
379    
380     newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die
381     if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
382     sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" \
383     -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
384     sed "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g" \
385     -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
386     sed "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:" \
387     -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
388     fi
389    
390     # It is important that we name the target "chromium-browser",
391     # xdg-utils expect it; bug #355517.
392     dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
393     # keep the old symlink around for consistency
394     dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
395    
396     # Allow users to override command-line options, bug #357629.
397     dodir /etc/chromium || die
398     insinto /etc/chromium
399     newins "${FILESDIR}/chromium.default" "default" || die
400    
401     pushd out/Release/locales > /dev/null || die
402     chromium_remove_language_paks
403     popd
404    
405     insinto "${CHROMIUM_HOME}"
406     doins out/Release/*.pak || die
407    
408     doins -r out/Release/locales || die
409     doins -r out/Release/resources || die
410    
411     newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
412     newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
413    
414     doexe out/Release/libffmpegsumo.so || die
415    
416     # Install icons and desktop entry.
417     local branding size
418     for size in 16 22 24 32 48 64 128 256 ; do
419     case ${size} in
420     16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
421     *) branding="chrome/app/theme/chromium" ;;
422     esac
423     newicon -s ${size} "${branding}/product_logo_${size}.png" \
424     chromium-browser${CHROMIUM_SUFFIX}.png
425     done
426    
427     local mime_types="text/html;text/xml;application/xhtml+xml;"
428     mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
429     mime_types+="x-scheme-handler/ftp;" # bug #412185
430     mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
431     make_desktop_entry \
432     chromium-browser${CHROMIUM_SUFFIX} \
433     "Chromium${CHROMIUM_SUFFIX}" \
434     chromium-browser${CHROMIUM_SUFFIX} \
435     "Network;WebBrowser" \
436     "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
437     sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
438    
439     # Install GNOME default application entry (bug #303100).
440     if use gnome; then
441     dodir /usr/share/gnome-control-center/default-apps || die
442     insinto /usr/share/gnome-control-center/default-apps
443     newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
444     if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
445     sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
446     "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
447     fi
448     fi
449     }

  ViewVC Help
Powered by ViewVC 1.1.20