diff options
author | Paweł Hajdan <phajdan.jr@gentoo.org> | 2010-11-13 15:19:19 +0000 |
---|---|---|
committer | Paweł Hajdan <phajdan.jr@gentoo.org> | 2010-11-13 15:19:19 +0000 |
commit | 3edc854fee8fd2b253b17802ef3000b25c18904b (patch) | |
tree | ab313099e665689901a1dcc80273ee7ab13d6a8f | |
parent | alpha/ia64/s390/sh/sparc stable wrt #340949 (diff) | |
download | gentoo-2-3edc854fee8fd2b253b17802ef3000b25c18904b.tar.gz gentoo-2-3edc854fee8fd2b253b17802ef3000b25c18904b.tar.bz2 gentoo-2-3edc854fee8fd2b253b17802ef3000b25c18904b.zip |
Extract bundled and installed V8 version. Will be useful for an unconditional switch to system-provided V8.
(Portage version: 2.1.8.3/cvs/Linux i686)
-rw-r--r-- | www-client/chromium/ChangeLog | 8 | ||||
-rw-r--r-- | www-client/chromium/chromium-9.0.576.0.ebuild | 23 | ||||
-rw-r--r-- | www-client/chromium/chromium-9999.ebuild | 25 | ||||
-rw-r--r-- | www-client/chromium/files/extract_v8_version.py | 24 |
4 files changed, 72 insertions, 8 deletions
diff --git a/www-client/chromium/ChangeLog b/www-client/chromium/ChangeLog index 5b7f0a7cc2e1..9e4f01338296 100644 --- a/www-client/chromium/ChangeLog +++ b/www-client/chromium/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for www-client/chromium # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.225 2010/11/12 11:43:20 phajdan.jr Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.226 2010/11/13 15:19:19 phajdan.jr Exp $ + + 13 Nov 2010; Pawel Hajdan jr <phajdan.jr@gentoo.org> + +files/extract_v8_version.py, chromium-9.0.576.0.ebuild, + chromium-9999.ebuild: + Extract bundled and installed V8 version. Will be useful for an + unconditional switch to system-provided V8. *chromium-8.0.552.200 (12 Nov 2010) diff --git a/www-client/chromium/chromium-9.0.576.0.ebuild b/www-client/chromium/chromium-9.0.576.0.ebuild index 1a8b336e1d97..2f0ae839ea65 100644 --- a/www-client/chromium/chromium-9.0.576.0.ebuild +++ b/www-client/chromium/chromium-9.0.576.0.ebuild @@ -1,11 +1,12 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9.0.576.0.ebuild,v 1.1 2010/11/10 15:33:23 phajdan.jr Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9.0.576.0.ebuild,v 1.2 2010/11/13 15:19:19 phajdan.jr Exp $ EAPI="3" PYTHON_DEPEND="2:2.6" -inherit eutils flag-o-matic multilib pax-utils portability python toolchain-funcs +inherit eutils flag-o-matic multilib pax-utils portability python \ + toolchain-funcs versionator DESCRIPTION="Open-source version of Google Chrome web browser" HOMEPAGE="http://chromium.org/" @@ -60,8 +61,15 @@ egyp() { "${@}" } +get_bundled_v8_version() { + "$(PYTHON -2)" "${FILESDIR}"/extract_v8_version.py v8/src/version.cc +} + +get_installed_v8_version() { + best_version dev-lang/v8 | sed -e 's@dev-lang/v8-@@g' +} + remove_bundled_lib() { - einfo "Removing bundled library $1 ..." local out out="$(find $1 -type f \! -iname '*.gyp' -print -delete)" \ || die "failed to remove bundled library $1" @@ -125,6 +133,15 @@ src_prepare() { # TODO: also remove third_party/zlib. For now the compilation fails if we # remove it (minizip-related). + local v8_bundled="$(get_bundled_v8_version)" + if use system-v8; then + local v8_installed="$(get_installed_v8_version)" + einfo "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}" + version_is_at_least "${v8_bundled}" "${v8_installed}" || die + else + einfo "Bundled V8 version: ${v8_bundled}" + fi + if use system-sqlite; then remove_bundled_lib "third_party/sqlite/src" remove_bundled_lib "third_party/sqlite/preprocessed" diff --git a/www-client/chromium/chromium-9999.ebuild b/www-client/chromium/chromium-9999.ebuild index 53ce8beb68fd..dafa23393e9e 100644 --- a/www-client/chromium/chromium-9999.ebuild +++ b/www-client/chromium/chromium-9999.ebuild @@ -1,11 +1,12 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9999.ebuild,v 1.109 2010/11/10 15:33:23 phajdan.jr Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9999.ebuild,v 1.110 2010/11/13 15:19:19 phajdan.jr Exp $ EAPI="3" PYTHON_DEPEND="2:2.6" -inherit eutils flag-o-matic multilib pax-utils portability python subversion toolchain-funcs +inherit eutils flag-o-matic multilib pax-utils portability python subversion \ + toolchain-funcs versionator DESCRIPTION="Open-source version of Google Chrome web browser" HOMEPAGE="http://chromium.org/" @@ -22,7 +23,7 @@ RDEPEND="app-arch/bzip2 system-sqlite? ( >=dev-db/sqlite-3.6.23.1[fts3,icu,secure-delete,threadsafe] ) - system-v8? ( ~dev-lang/v8-2.5.4 ) + system-v8? ( dev-lang/v8 ) dev-libs/dbus-glib >=dev-libs/icu-4.4.1 >=dev-libs/libevent-1.4.13 @@ -105,8 +106,15 @@ egyp() { "${@}" } +get_bundled_v8_version() { + "$(PYTHON -2)" "${FILESDIR}"/extract_v8_version.py v8/src/version.cc +} + +get_installed_v8_version() { + best_version dev-lang/v8 | sed -e 's@dev-lang/v8-@@g' +} + remove_bundled_lib() { - einfo "Removing bundled library $1 ..." local out out="$(find $1 -type f \! -iname '*.gyp' -print -delete)" \ || ewarn "failed to remove bundled library $1" @@ -167,6 +175,15 @@ src_prepare() { # TODO: also remove third_party/zlib. For now the compilation fails if we # remove it (minizip-related). + local v8_bundled="$(get_bundled_v8_version)" + if use system-v8; then + local v8_installed="$(get_installed_v8_version)" + einfo "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}" + version_is_at_least "${v8_bundled}" "${v8_installed}" || die + else + einfo "Bundled V8 version: ${v8_bundled}" + fi + if use system-sqlite; then remove_bundled_lib "third_party/sqlite/src" remove_bundled_lib "third_party/sqlite/preprocessed" diff --git a/www-client/chromium/files/extract_v8_version.py b/www-client/chromium/files/extract_v8_version.py new file mode 100644 index 000000000000..55615138b863 --- /dev/null +++ b/www-client/chromium/files/extract_v8_version.py @@ -0,0 +1,24 @@ +#!/usr/bin/python2 + +import re +import sys + +MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)") +MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)") +BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)") +PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)") + +patterns = [MAJOR_VERSION_PATTERN, + MINOR_VERSION_PATTERN, + BUILD_NUMBER_PATTERN, + PATCH_LEVEL_PATTERN] + +source = open(sys.argv[1]).read() +version_components = [] +for pattern in patterns: + version_components.append(pattern.search(source).group(1).strip()) + +if version_components[len(version_components) - 1] == '0': + version_components.pop() + +print '.'.join(version_components) |