From bb3ed9215557e9be9b26c8748a42057bb27d6dd6 Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Sun, 14 Aug 2016 17:45:26 +0300 Subject: [PATCH 1/2] Add packaging for ubuntu and update for homebrew [skip ci] --- scripts/.gitignore | 1 + scripts/build_v8.sh | 13 -- scripts/{load_deps.py => deps.py} | 148 +++++++-------- scripts/homebrew/README.md | 21 +++ scripts/homebrew/load_deps.py | 25 +++ scripts/homebrew/v8.rb | 76 +++++--- scripts/homebrew/v8.rb.in | 70 +++++++ scripts/ppa-packaging/.gitignore | 3 + scripts/ppa-packaging/README.md | 43 +++++ .../ppa-packaging/libv8/debian/README.source | 59 ++++++ scripts/ppa-packaging/libv8/debian/changelog | 12 ++ scripts/ppa-packaging/libv8/debian/compat | 1 + scripts/ppa-packaging/libv8/debian/control | 72 +++++++ scripts/ppa-packaging/libv8/debian/control.in | 68 +++++++ .../ppa-packaging/libv8/debian/control.in.in | 50 +++++ .../libv8/debian/libv8-d8.install | 2 + .../libv8/debian/libv8-dev.examples | 1 + .../libv8/debian/libv8-dev.install | 4 + scripts/ppa-packaging/libv8/debian/rules | 178 ++++++++++++++++++ .../ppa-packaging/libv8/debian/source/format | 1 + scripts/ppa-packaging/libv8/load_deps.py | 15 ++ scripts/ppa-packaging/packaging.mk | 102 ++++++++++ 22 files changed, 851 insertions(+), 114 deletions(-) create mode 100644 scripts/.gitignore delete mode 100755 scripts/build_v8.sh rename scripts/{load_deps.py => deps.py} (63%) create mode 100644 scripts/homebrew/README.md create mode 100755 scripts/homebrew/load_deps.py create mode 100644 scripts/homebrew/v8.rb.in create mode 100644 scripts/ppa-packaging/.gitignore create mode 100644 scripts/ppa-packaging/README.md create mode 100644 scripts/ppa-packaging/libv8/debian/README.source create mode 100644 scripts/ppa-packaging/libv8/debian/changelog create mode 100644 scripts/ppa-packaging/libv8/debian/compat create mode 100644 scripts/ppa-packaging/libv8/debian/control create mode 100644 scripts/ppa-packaging/libv8/debian/control.in create mode 100644 scripts/ppa-packaging/libv8/debian/control.in.in create mode 100644 scripts/ppa-packaging/libv8/debian/libv8-d8.install create mode 100644 scripts/ppa-packaging/libv8/debian/libv8-dev.examples create mode 100644 scripts/ppa-packaging/libv8/debian/libv8-dev.install create mode 100755 scripts/ppa-packaging/libv8/debian/rules create mode 100644 scripts/ppa-packaging/libv8/debian/source/format create mode 100755 scripts/ppa-packaging/libv8/load_deps.py create mode 100644 scripts/ppa-packaging/packaging.mk diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/scripts/build_v8.sh b/scripts/build_v8.sh deleted file mode 100755 index ccb9942..0000000 --- a/scripts/build_v8.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -if [[ -z $1 ]]; then - echo "Download and pack v8 and it deps for further debian/ubuntu packaging" - echo "Usage: $1 " - exit 1 -fi - -DIR=`dirname $0` -V8_VERSION=$1 - -$DIR/load_deps.py $V8_VERSION | xargs -L 1 sh -c 'echo "$0 => $1"; mkdir -p $1; curl -s $0 | tar zxf - -C $1' -tar -czf v8-$V8_VERSION.orig.tar.gz v8 diff --git a/scripts/load_deps.py b/scripts/deps.py similarity index 63% rename from scripts/load_deps.py rename to scripts/deps.py index 405f4d8..c3f7911 100755 --- a/scripts/load_deps.py +++ b/scripts/deps.py @@ -1,9 +1,10 @@ #!/usr/bin/env python import sys +import os import urllib import base64 - +import hashlib class VarImpl(object): """ @@ -54,24 +55,10 @@ def Lookup(self, var_name): raise gclient_utils.Error("Var is not defined: %s" % var_name) -def FileRead(filename, mode='rU'): - with open(filename, mode=mode) as f: - return f.read() - - -if len(sys.argv) < 2 or len(sys.argv) > 3: - # print("Usage: %s " % sys.argv[0]) - print("Usage: %s " % sys.argv[0]) - print("Options:") - print(" --homebrew Generate hombrew output") - exit(1) - - # https://chromium.googlesource.com/v8/v8.git/+archive/5.0.71.11.tar.gz # https://chromium.googlesource.com/v8/v8.git/+/5.0.71.11/DEPS?format=TEXT - -class V8DepsFileLoader(object): +class V8DepsRemoteFileLoader(object): def __init__(self, version): self.version = version @@ -83,22 +70,16 @@ def load(self): return base64.b64decode(s) +class V8DepsLocalFileLoader(object): + def __init__(self, path): + self.path = path -class V8DepsResolver(object): - def __init__(self, version): - self.version = version - - def get_deps(self): - url = 'https://chromium.googlesource.com/v8/v8.git/+archive/%s.tar.gz' % self.version - - return {url: 'v8'} - - def output_deps(self): - for k, v in self.get_deps().items(): - print ("%s %s" % (k, v)) + def load(self): + with open(self.path) as f: + return f.read() -class DepsResolver(object): +class AbstractDepsResolver(object): def __init__(self, deps_content): self.deps_content = deps_content @@ -124,9 +105,17 @@ def convert_parsed_deps(self, deps): deps_converted = {} for k, v in deps.items(): - v = v.replace('@', '/+archive/') + '.tar.gz' + url, revision = v.split('@', 2) + + resource = url.rsplit('/', 1)[1].split('.', 1)[0] + target = k.replace('v8/', '') - deps_converted[v] = k + deps_converted[resource] = { + 'url': url, + 'revision': revision, + 'resource': resource, + 'target': target + } return deps_converted @@ -135,70 +124,73 @@ def get_deps(self): return self.convert_parsed_deps(parsed) - def output_deps(self): - for k, v in self.get_deps().items(): - print ("%s %s" % (k, v)) +class HomebrewDepsResolver(AbstractDepsResolver): + def __init__(self, deps_content, version, tpl_path, out_path): + self.deps_content = deps_content + self.version = version + self.tpl_path = tpl_path + self.out_path = out_path -class HomebrewDepsResolver(DepsResolver): - def convert_parsed_deps(self, deps): - deps_converted = {} + def import_deps_fast(self): + vars = {} - for k, v in deps.items(): - url, revision = v.split('@', 2) + url = "https://chromium.googlesource.com/v8/v8.git/+archive/%s.tar.gz" % self.version - resource = url.rsplit('/', 1)[1].split('.', 1)[0] - target = k.replace('v8/', '') + f = urllib.urlopen(url) + s = f.read() + f.close() - deps_converted[resource] = { - 'url': url, - 'revision': revision, - 'resource': resource, - 'target': target - } + sha256 = hashlib.sha256(s).hexdigest() - return deps_converted + vars['{{ URL }}'] = 'url "%s"' % url + vars['{{ SHA256 }}'] = 'sha256 "%s"' % sha256 - def output_deps(self): - print (" # resources definition, do not edit, autogenerated") - print ("") + resources_def = [] + resources_def.append(" # resources definition, do not edit, autogenerated") + resources_def.append("") for k, v in self.get_deps().items(): - print (" resource \"%s\" do " % (v['resource'])) - print (" url \"%s\"," % (v['url'])) - print (" :revision => \"%s\"" % (v['revision'])) - print (" end") - print ("") + resources_def.append(" resource \"%s\" do" % (v['resource'])) + resources_def.append(" url \"%s\"," % (v['url'])) + resources_def.append(" :revision => \"%s\"" % (v['revision'])) + resources_def.append(" end") + resources_def.append("") + + vars['{{ RESOURCES_DEFINITION }}'] = "\n".join(resources_def).strip() - print ("") - print ("") - print (" # resources installation, do not edit, autogenerated") + resources_inst = [] + resources_inst.append(" # resources installation, do not edit, autogenerated") for k, v in self.get_deps().items(): - print (" (buildpath/\"{target}\").install resource(\"{resource}\")".format(**v)) + resources_inst.append(" (buildpath/\"{target}\").install resource(\"{resource}\")".format(**v)) + + vars['{{ RESOURCES_INSTALLATION }}'] = "\n".join(resources_inst).strip() - print ("") + tpl = "" + with open(self.tpl_path) as f: + tpl = f.read() -if len(sys.argv) == 2: - version = sys.argv[1] - is_homebrew = False -else: - version = sys.argv[2] - is_homebrew = True + for k, v in vars.iteritems(): + tpl = tpl.replace(k, v) -deps_loader = V8DepsFileLoader(version) + with open(self.out_path, 'w') as f: + f.write(tpl) -deps_content = deps_loader.load() -# print(deps_content) -# deps_content = FileRead(sys.argv[1]) +class PPAPackagingDepsResolver(AbstractDepsResolver): + def import_deps_fast(self): + for k, v in self.get_deps().items(): + tgz = v['url'] + '/+archive/' + v['revision']+ '.tar.gz' + + cmd = "mkdir -p " + v['target'] -v8_deps_resolver = V8DepsResolver(version) -if is_homebrew: - deps_resolver = HomebrewDepsResolver(deps_content) -else: - deps_resolver = DepsResolver(deps_content) + if os.path.isdir(v['target']): + cmd = "rm -rf " + v['target'] + " && " + cmd -v8_deps_resolver.output_deps() + print(cmd) + os.system(cmd) -deps_resolver.output_deps() + cmd = "curl -s " + tgz + " | tar zxf - -C " + v['target'] + print (cmd) + os.system(cmd) diff --git a/scripts/homebrew/README.md b/scripts/homebrew/README.md new file mode 100644 index 0000000..bb3ce8e --- /dev/null +++ b/scripts/homebrew/README.md @@ -0,0 +1,21 @@ +Homebrew formula for v8 JavaScript engling and semi-automated script to update it +============================== + +Prerequisites +------------- + +You need up to date homebrew and supported OS X + +Refreshing formula +------------------ + +The process is very much automated and the following command can be used to update formula to desired v8 version. + + ./load_deps.py + +Installing v8 +------------- + +You can install it a same way as other Hombrew formulae: + + brew install v8.rb diff --git a/scripts/homebrew/load_deps.py b/scripts/homebrew/load_deps.py new file mode 100755 index 0000000..f9792e1 --- /dev/null +++ b/scripts/homebrew/load_deps.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import sys +import os + +parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +os.sys.path.insert(0, parentdir) + +import deps + +if len(sys.argv) != 2: + # print("Usage: %s " % sys.argv[0]) + print("Usage: %s " % sys.argv[0]) + exit(1) + +version = sys.argv[1] + +deps_loader = deps.V8DepsRemoteFileLoader(version) +deps_content = deps_loader.load() + +dir_path = os.path.dirname(os.path.realpath(__file__)) + +deps_resolver = deps.HomebrewDepsResolver(deps_content, version, dir_path +'/v8.rb.in', dir_path + '/v8.rb') + +deps_resolver.import_deps_fast() diff --git a/scripts/homebrew/v8.rb b/scripts/homebrew/v8.rb index c148078..106bbec 100644 --- a/scripts/homebrew/v8.rb +++ b/scripts/homebrew/v8.rb @@ -3,8 +3,8 @@ class V8 < Formula desc "Google's JavaScript engine" homepage "https://code.google.com/p/v8/" - url "https://chromium.googlesource.com/v8/v8.git/+archive/5.2.371.tar.gz" - sha256 "526134c9f543def42e96ab55fb9ef4b0f5f741aa755d9dad59cad1120dcda0f7" + url "https://chromium.googlesource.com/v8/v8.git/+archive/5.4.420.tar.gz" + sha256 "b62a9735443cc391c3404eaa0480de40cc0d72ae0645704b5f9c261e42ef8dfc" head "https://chromium.googlesource.com/v8/v8.git" bottle do @@ -34,12 +34,22 @@ class V8 < Formula resource "buildtools" do url "https://chromium.googlesource.com/chromium/buildtools.git", - :revision => "06e80a0e17319868d4a9b13f9bb6a248dc8d8b20" + :revision => "adb8bf4e8fc92aa1717bf151b862d58e6f27c4f2" + end + + resource "inspector_protocol" do + url "https://chromium.googlesource.com/chromium/src/third_party/WebKit/Source/platform/inspector_protocol.git", + :revision => "9d440c96636c5a41ce3e40f1924fe41dd2694f51" end resource "ecmascript_simd" do url "https://chromium.googlesource.com/external/github.com/tc39/ecmascript_simd.git", - :revision => "c8ef63c728283debc25891123eb00482fee4b8cd" + :revision => "baf493985cb9ea7cdbd0d68704860a8156de9556" + end + + resource "mb" do + url "https://chromium.googlesource.com/chromium/src/tools/mb.git", + :revision => "c78da3f5bccc979b35907c4cbf937aa5187e41fa" end resource "googlemock" do @@ -49,7 +59,12 @@ class V8 < Formula resource "clang" do url "https://chromium.googlesource.com/chromium/src/tools/clang.git", - :revision => "996bab489f816e51dde704bd215fb3403919f07e" + :revision => "6d377a47e9c668c7550d17a7d4e6ba9f5931703a" + end + + resource "markupsafe" do + url "https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git", + :revision => "484a5661041cac13bfc688a26ec5434b05d18961" end resource "googletest" do @@ -57,9 +72,14 @@ class V8 < Formula :revision => "6f8a66431cb592dad629028a50b3dd418a408c87" end - resource "common" do - url "https://chromium.googlesource.com/chromium/src/base/trace_event/common.git", - :revision => "54b8455be9505c2cb0cf5c26bb86739c236471aa" + resource "jinja2" do + url "https://chromium.googlesource.com/chromium/src/third_party/jinja2.git", + :revision => "2222b31554f03e62600cd7e383376a7c187967a1" + end + + resource "build" do + url "https://chromium.googlesource.com/chromium/src/build.git", + :revision => "4155375bddb65fe3d2dbc42ab0d64c4d72527165" end resource "benchmarks" do @@ -69,27 +89,37 @@ class V8 < Formula resource "gyp" do url "https://chromium.googlesource.com/external/gyp.git", - :revision => "bce1c7793010574d88d7915e2d55395213ac63d1" + :revision => "702ac58e477214c635d9b541932e75a95d349352" end resource "test262" do url "https://chromium.googlesource.com/external/github.com/tc39/test262.git", - :revision => "9c45e2ac684bae64614d8eb55789cae97323a7e7" + :revision => "88bc7fe7586f161201c5f14f55c9c489f82b1b67" + end + + resource "instrumented_libraries" do + url "https://chromium.googlesource.com/chromium/src/third_party/instrumented_libraries.git", + :revision => "f15768d7fdf68c0748d20738184120c8ab2e6db7" end resource "swarming" do url "https://chromium.googlesource.com/external/swarming.client.git", - :revision => "df6e95e7669883c8fe9ef956c69a544154701a49" + :revision => "e4288c3040a32f2e7ad92f957668f2ee3d36e5a6" + end + + resource "test262-harness-py" do + url "https://chromium.googlesource.com/external/github.com/test262-utils/test262-harness-py.git", + :revision => "cbd968f54f7a95c6556d53ba852292a4c49d11d8" end resource "icu" do url "https://chromium.googlesource.com/chromium/deps/icu.git", - :revision => "c291cde264469b20ca969ce8832088acb21e0c48" + :revision => "53ce631655a61aaaa42b43b4d64abe23e9b8d71f" end - resource "build" do - url "https://chromium.googlesource.com/chromium/src/build.git", - :revision => "b2d15686436cdc17f67c3621c314f8d96b5b6fd9" + resource "common" do + url "https://chromium.googlesource.com/chromium/src/base/trace_event/common.git", + :revision => "315bf1e2d45be7d53346c31cfcc37424a32c30c8" end def install @@ -113,26 +143,26 @@ def install "'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']", "\\0, 'DYLIB_INSTALL_NAME_BASE': '#{opt_lib}'" - # fix gyp: Error importing pymod_do_mainmodule (detect_v8_host_arch): No module named detect_v8_host_arch - # https://groups.google.com/forum/#!topic/v8-dev/T8CTU6n5EQw - inreplace "Makefile", - 'PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)"', - 'PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)"' - # resources installation, do not edit, autogenerated (buildpath/"test/mozilla/data").install resource("mozilla-tests") (buildpath/"buildtools").install resource("buildtools") + (buildpath/"third_party/WebKit/Source/platform/inspector_protocol").install resource("inspector_protocol") (buildpath/"test/simdjs/data").install resource("ecmascript_simd") + (buildpath/"tools/mb").install resource("mb") (buildpath/"testing/gmock").install resource("googlemock") (buildpath/"tools/clang").install resource("clang") + (buildpath/"third_party/markupsafe").install resource("markupsafe") (buildpath/"testing/gtest").install resource("googletest") - (buildpath/"base/trace_event/common").install resource("common") + (buildpath/"third_party/jinja2").install resource("jinja2") + (buildpath/"build").install resource("build") (buildpath/"test/benchmarks/data").install resource("benchmarks") (buildpath/"tools/gyp").install resource("gyp") (buildpath/"test/test262/data").install resource("test262") + (buildpath/"third_party/instrumented_libraries").install resource("instrumented_libraries") (buildpath/"tools/swarming_client").install resource("swarming") + (buildpath/"test/test262/harness").install resource("test262-harness-py") (buildpath/"third_party/icu").install resource("icu") - (buildpath/"build").install resource("build") + (buildpath/"base/trace_event/common").install resource("common") system "make", "native", "library=shared", "snapshot=on", "console=readline", i18nsupport, diff --git a/scripts/homebrew/v8.rb.in b/scripts/homebrew/v8.rb.in new file mode 100644 index 0000000..04de2dd --- /dev/null +++ b/scripts/homebrew/v8.rb.in @@ -0,0 +1,70 @@ +# Track Chrome stable. +# https://omahaproxy.appspot.com/ +# This formula is auto-generated by load_deps.py script. Do not edit it manually. +class V8 < Formula + desc "Google's JavaScript engine" + homepage "https://code.google.com/p/v8/" + {{ URL }} + {{ SHA256 }} + head "https://chromium.googlesource.com/v8/v8.git" + + bottle do + cellar :any + end + + option "with-readline", "Use readline instead of libedit" + + # not building on Snow Leopard: + # https://github.com/Homebrew/homebrew/issues/21426 + depends_on :macos => :lion + + depends_on :python => :build # gyp doesn't run under 2.6 or lower + depends_on "readline" => :optional + depends_on "icu4c" => :recommended + + needs :cxx11 + + # Update from "DEPS" file in tarball. + + {{ RESOURCES_DEFINITION }} + + def install + # Bully GYP into correctly linking with c++11 + ENV.cxx11 + ENV["GYP_DEFINES"] = "clang=1 mac_deployment_target=#{MacOS.version}" + # https://code.google.com/p/v8/issues/detail?id=4511#c3 + ENV.append "GYP_DEFINES", "v8_use_external_startup_data=0" + + if build.with? "icu4c" + ENV.append "GYP_DEFINES", "use_system_icu=1" + i18nsupport = "i18nsupport=on" + else + i18nsupport = "i18nsupport=off" + end + + # fix up libv8.dylib install_name + # https://github.com/Homebrew/homebrew/issues/36571 + # https://code.google.com/p/v8/issues/detail?id=3871 + inreplace "src/v8.gyp", + "'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']", + "\\0, 'DYLIB_INSTALL_NAME_BASE': '#{opt_lib}'" + + {{ RESOURCES_INSTALLATION }} + + system "make", "native", "library=shared", "snapshot=on", + "console=readline", i18nsupport, + "strictaliasing=off" + + include.install Dir["include/*"] + + cd "out/native" do + rm ["libgmock.a", "libgtest.a"] + lib.install Dir["lib*"] + bin.install "d8", "mksnapshot", "process", "v8_shell" => "v8" + end + end + + test do + assert_equal "Hello World!", pipe_output("#{bin}/v8 -e 'print(\"Hello World!\")'").chomp + end +end diff --git a/scripts/ppa-packaging/.gitignore b/scripts/ppa-packaging/.gitignore new file mode 100644 index 0000000..6763b1f --- /dev/null +++ b/scripts/ppa-packaging/.gitignore @@ -0,0 +1,3 @@ +*/work +*~ +.deb/* diff --git a/scripts/ppa-packaging/README.md b/scripts/ppa-packaging/README.md new file mode 100644 index 0000000..c4fb028 --- /dev/null +++ b/scripts/ppa-packaging/README.md @@ -0,0 +1,43 @@ +Semi-automated script to create binary packages for (multiple version) of Ubuntu +============================== + +Based on https://github.com/named-data/ppa-packaging and http://anonscm.debian.org/git/collab-maint/libv8.git + +Prerequisites +------------- + +The following packages needs to be installed in order to build source .deb package to be +upload to PPA: + + sudo apt-get install git devscripts debhelper dh-make + +Building source packages +------------------------ + +The build process is very much automated and the following command can be used to build +all packages and upload them to the ppa. + + make dput + +Before running dput make sure that you have access to upload packages to `named-data/ppa` +(or modify target PPA repository in `packaging.mk`). + +To build a specific package, go to the package's folder and run the same `make dput` command. + +Advanced uses +------------- + +The scripts by default create source packages for Ubuntu 14.04 LTS (trusty), 15.10 (wily), +and 16.04 LTS (xenial). If necessary, default actions and distributions can be overriden: + +To only build source packages (no upload) only for Ubuntu 16.04: + + make build DISTROS=precise + +To build binary package that can be installed with `dpkg -i .deb`: + + make build DEBUILD=debuild DISTROS=xenial + +The build package will be in `/work/_.deb` + + diff --git a/scripts/ppa-packaging/libv8/debian/README.source b/scripts/ppa-packaging/libv8/debian/README.source new file mode 100644 index 0000000..a38fd6b --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/README.source @@ -0,0 +1,59 @@ +CDBS+git-buildpackage +===================== + +This source package uses CDBS and git-buildpackage. NMUs need not (but +are encouraged to) make special use of these tools. In particular, the +debian/control.in file can be completely ignored. + +More info here: http://wiki.debian.org/CDBS+git-buildpackage + + +Branches, versions, SONAME +========================== + +v8 upstream releases versions as major.minor.build.patch. +A branch matches a major.minor version (like the 3.8 branch). +Given a branch, when the build number stays constant it means it can +be considered stable, meaning API/ABI won't change. + +Examples from http://v8.googlecode.com/svn/tags/ : +3.6.6.4 - 3.6.6.25 +3.7.12.7 - 3.7.12.30 +3.8.9.1 - 3.8.9.23 +3.9.24.1 - 3.9.24.29 +3.10.8.1 - 3.10.8.13 + +To reflect that upstream practice, the debian package use a SONAME built +upon major.minor.build version, since version 3.10.8. This gives : +libv8.so.3.10.8 + +This allows easier "patch" updates to libv8, avoiding the need to +rebuild all libv8 reverse dependencies. Previous soname would have been +libv8.so.3.10.8.14. +Important: it is certain that a change in minor version introduces +API and ABI breakage. Never define a libv8.so.3 soname ! + +However, upstream doesn't *guarantee* ABI compatibility, so each +patch-level update should be uploaded to experimental first, to make +sure any accidental ABI break does not happen. + +Side note: http://www.upstream-tracker.org/versions/v8.html gives +valuable information about upstream involuntarily breaking API/ABI, like +what happened with 3.7.12.31, fixed in 3.7.12.32. + + +gbp.conf and branched versions +============================== + +v8 stable versions (upstream /branches/), are maintained in git-buildpackage, +and are mapped to : + +* (master, upstream) for unstable releases, passing all tests on all archs; +* (master-experimental, upstream-experimental) for latest upstream branch releases, + tests are disabled because some might fail. +* (master-stable, upstream-stable) for libv8 in debian/stable. + +debian/gbp.conf is configured for each debian branch. +When moving experimental to unstable layout, gbp.conf is typically +overwritten by merge. It needs to be restored, until #671791 feature +is implemented. diff --git a/scripts/ppa-packaging/libv8/debian/changelog b/scripts/ppa-packaging/libv8/debian/changelog new file mode 100644 index 0000000..bb2a3da --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/changelog @@ -0,0 +1,12 @@ +libv8-5.4 (5.4.420-ppa1~DISTRO) DISTRO; urgency=medium + + * New version based on 5.4.420 + (https://chromium.googlesource.com/v8/v8.git) + + -- Bogdan Padalko Sun, 14 Aug 2016 17:58:56 +0000 + +libv8-5.2 (5.2.371-ppa1~DISTRO) DISTRO; urgency=medium + + * New version based on 5.2.371 + + -- Bogdan Padalko Fri, 15 Jul 2016 19:30:37 +0000 diff --git a/scripts/ppa-packaging/libv8/debian/compat b/scripts/ppa-packaging/libv8/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/compat @@ -0,0 +1 @@ +7 diff --git a/scripts/ppa-packaging/libv8/debian/control b/scripts/ppa-packaging/libv8/debian/control new file mode 100644 index 0000000..bffc0b1 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/control @@ -0,0 +1,72 @@ +Source: libv8-5.4 +Priority: optional +Maintainer: Debian Javascript Maintainers +Uploaders: Jérémy Lal , + Jonas Smedegaard +Build-Depends: cdbs, + autotools-dev, + devscripts, + debhelper, + dh-buildinfo, + libicu-dev, + abi-compliance-checker +Standards-Version: 3.9.6 +Section: libs +Homepage: http://code.google.com/p/v8/ +Vcs-Browser: http://anonscm.debian.org/git/collab-maint/libv8.git +Vcs-Git: git://anonscm.debian.org/collab-maint/libv8.git + +Package: libv8-dev +Section: libdevel +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Conflicts: libv8-legacy-dev, libv8-3.14-dev +Replaces: libv8-legacy-dev, libv8-3.14-dev +Description: V8 JavaScript engine - development files for latest branch + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provide development headers for latest V8 branch. + +Package: libv8-5.4-dev +Section: libdevel +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Provides: libv8-legacy-dev, libv8-dev +Conflicts: libv8-dev +Replaces: libv8-dev +Description: V8 JavaScript engine - development files for 5.4 branch + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provide development headers for V8 5.4 branch. + +Package: libv8-5.4.420 +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: V8 JavaScript engine - runtime library + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the dynamic library for V8. + +Package: libv8-5.4-dbg +Priority: extra +Section: debug +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Description: V8 JavaScript engine - debugging symbols + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the debugging symbols for the library. + +Package: libv8-5.4-d8 +Priority: extra +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Description: V8 JavaScript engine - interactive shell + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the interactive V8 shell. diff --git a/scripts/ppa-packaging/libv8/debian/control.in b/scripts/ppa-packaging/libv8/debian/control.in new file mode 100644 index 0000000..62a2664 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/control.in @@ -0,0 +1,68 @@ +Source: libv8-5.4 +Priority: optional +Maintainer: Debian Javascript Maintainers +Uploaders: Jérémy Lal , + Jonas Smedegaard +Build-Depends: @cdbs@, + libicu-dev, + abi-compliance-checker +Standards-Version: 3.9.6 +Section: libs +Homepage: http://code.google.com/p/v8/ +Vcs-Browser: http://anonscm.debian.org/git/collab-maint/libv8.git +Vcs-Git: git://anonscm.debian.org/collab-maint/libv8.git + +Package: libv8-dev +Section: libdevel +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Conflicts: libv8-legacy-dev, libv8-3.14-dev +Replaces: libv8-legacy-dev, libv8-3.14-dev +Description: V8 JavaScript engine - development files for latest branch + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provide development headers for latest V8 branch. + +Package: libv8-5.4-dev +Section: libdevel +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Provides: libv8-legacy-dev, libv8-dev +Conflicts: libv8-dev +Replaces: libv8-dev +Description: V8 JavaScript engine - development files for 5.4 branch + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provide development headers for V8 5.4 branch. + +Package: libv8-5.4.420 +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: V8 JavaScript engine - runtime library + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the dynamic library for V8. + +Package: libv8-5.4-dbg +Priority: extra +Section: debug +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Description: V8 JavaScript engine - debugging symbols + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the debugging symbols for the library. + +Package: libv8-5.4-d8 +Priority: extra +Architecture: i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips +Depends: libv8-5.4.420 (= ${binary:Version}), ${misc:Depends} +Description: V8 JavaScript engine - interactive shell + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the interactive V8 shell. diff --git a/scripts/ppa-packaging/libv8/debian/control.in.in b/scripts/ppa-packaging/libv8/debian/control.in.in new file mode 100644 index 0000000..b4b7e72 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/control.in.in @@ -0,0 +1,50 @@ +Source: libv8-__API__ +Priority: optional +Maintainer: Bogdan Padalko +Build-Depends: @cdbs@, + libicu-dev +Standards-Version: 3.9.8 +Section: libs +Homepage: https://developers.google.com/v8/ +Vcs-Browser: https://github.com/pinepain/ppa-packaging +Vcs-Git: https://github.com/pinepain/ppa-packaging.git + +Package: libv8-__API__-dev +Section: libdevel +Architecture: __ARCHS__ +Depends: libv8-__ABI__ (= ${binary:Version}), ${misc:Depends} +Description: V8 JavaScript engine - development files for __API__ branch + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provide development headers for V8 __API__ branch. + +Package: libv8-__ABI__ +Architecture: __ARCHS__ +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: V8 JavaScript engine - runtime library + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the dynamic library for V8. + +Package: libv8-__API__-dbg +Priority: extra +Section: debug +Architecture: __ARCHS__ +Depends: libv8-__ABI__ (= ${binary:Version}), ${misc:Depends} +Description: V8 JavaScript engine - debugging symbols + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the debugging symbols for the library. + +Package: libv8-__API__-d8 +Priority: extra +Architecture: __ARCHS__ +Depends: libv8-__ABI__ (= ${binary:Version}), ${misc:Depends} +Description: V8 JavaScript engine - interactive shell + V8 is a high performance JavaScript engine written in C++. It is used + in the web browser Chromium. + . + This package provides the interactive V8 shell. diff --git a/scripts/ppa-packaging/libv8/debian/libv8-d8.install b/scripts/ppa-packaging/libv8/debian/libv8-d8.install new file mode 100644 index 0000000..1e0d19f --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/libv8-d8.install @@ -0,0 +1,2 @@ +debian/tmp/usr/bin/d8 usr/bin + diff --git a/scripts/ppa-packaging/libv8/debian/libv8-dev.examples b/scripts/ppa-packaging/libv8/debian/libv8-dev.examples new file mode 100644 index 0000000..781fb73 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/libv8-dev.examples @@ -0,0 +1 @@ +samples/* diff --git a/scripts/ppa-packaging/libv8/debian/libv8-dev.install b/scripts/ppa-packaging/libv8/debian/libv8-dev.install new file mode 100644 index 0000000..dbfef05 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/libv8-dev.install @@ -0,0 +1,4 @@ +include/*.h usr/include/ +include/libplatform usr/include/ +debian/tmp/usr/lib/libv8.so usr/lib +out/lib.static/*.a usr/lib diff --git a/scripts/ppa-packaging/libv8/debian/rules b/scripts/ppa-packaging/libv8/debian/rules new file mode 100755 index 0000000..a670f18 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/rules @@ -0,0 +1,178 @@ +#!/usr/bin/make -f + +# This needs to run before inclusion of CDBS snippets +debian/control:: debian/control.in +DEB_PHONY_RULES += debian/control.in +debian/control.in:: + sed $(foreach re,API ABI ARCHS,-e 's/__$(re)__/$($(re))/g') \ + < debian/control.in.in > debian/control.in + + +include /usr/share/cdbs/1/rules/upstream-tarball.mk +include /usr/share/cdbs/1/rules/utils.mk +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/rules/debhelper.mk + +CLEAN_UPSTREAM_VERSION=$(shell echo $(DEB_UPSTREAM_VERSION) | sed 's/~dfsg\d*$$//') + +# See README.source for details on these. +MAJOR = $(word 1, $(subst .,$(space), $(CLEAN_UPSTREAM_VERSION))) +MINOR = $(word 2, $(subst .,$(space), $(CLEAN_UPSTREAM_VERSION))) +BUILD = $(word 3, $(subst .,$(space), $(CLEAN_UPSTREAM_VERSION))) + +API = $(MAJOR).$(MINOR) +ABI = $(MAJOR).$(MINOR).$(BUILD) + +LIBSTEM = libv8.so + +# Supported archs +ARCHS = i386 kfreebsd-i386 hurd-i386 amd64 kfreebsd-amd64 armel armhf mipsel mips + +# allow parallel builds +DEB_BUILD_PARALLEL=1 + +# suppress checking binary files, to not upset dpkg-source +DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^.+$ + +# dpkg-gensymbols(1) - this is not needed since we are not using symbols +# DEB_DH_MAKESHLIBS_ARGS = -- -c4 + +# map HOST ARCH AND OS to v8 options +v8arch := $(or $(v8arch),$(if $(filter i386,$(DEB_HOST_ARCH)),ia32)) +v8arch := $(or $(v8arch),$(if $(filter kfreebsd-i386,$(DEB_HOST_ARCH)),ia32)) +v8arch := $(or $(v8arch),$(if $(filter hurd-i386,$(DEB_HOST_ARCH)),ia32)) +v8arch := $(or $(v8arch),$(if $(filter amd64,$(DEB_HOST_ARCH)),x64)) +v8arch := $(or $(v8arch),$(if $(filter kfreebsd-amd64,$(DEB_HOST_ARCH)),x64)) +v8arch := $(or $(v8arch),$(if $(filter armel,$(DEB_HOST_ARCH)),arm)) +v8arch := $(or $(v8arch),$(if $(filter armhf,$(DEB_HOST_ARCH)),arm)) +v8arch := $(or $(v8arch),$(if $(filter mipsel,$(DEB_HOST_ARCH)),mipsel)) +v8arch := $(or $(v8arch),$(if $(filter mips,$(DEB_HOST_ARCH)),mips)) +v8arch := $(or $(v8arch),$(DEB_HOST_ARCH)) +v8os := $(or $(v8os),$(if $(filter linux,$(DEB_HOST_ARCH_OS)),linux)) +v8os := $(or $(v8os),$(if $(filter kfreebsd,$(DEB_HOST_ARCH_OS)),freebsd)) +v8os := $(or $(v8os),$(DEB_HOST_ARCH_OS)) + +GYPFLAGS += -Dhost_arch=$(v8arch) -DOS=$(v8os) -Duse_system_icu=1 -Dclang=0 -Dhost_clang=0 + +# the default test timeout in seconds +timeOut = 180 + +# build for loongson, which uses mips3, a sub-instruction-set of mips32r2 +ifeq (mipsel, $(DEB_HOST_ARCH)) +GYPFLAGS += -Dmips_arch_variant=loongson +timeOut = 600 +endif + +# build for loongson, which uses mips3, a sub-instruction-set of mips32r2 +ifeq (mips, $(DEB_HOST_ARCH)) +GYPFLAGS += -Dmips_arch_variant=loongson +timeOut = 600 +endif + +# armel and armhf arches need flags to work around those issues : +# -fno-tree-sink: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39604 +# -Wno-psabi: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42748 +ifeq (armhf, $(DEB_HOST_ARCH)) +CXXFLAGS += -fno-tree-sink +CXXFLAGS += -Wno-psabi +ifeq ($(shell dpkg-vendor --derives-from raspbian && echo true),true) +# enable vfpv2, disable armv7 +GYPFLAGS += -Darmv7=0 -Darm_fpu=vfpv2 -Darm_neon=0 -Dv8_use_arm_eabi_hardfloat=true +DEB_MAKE_EXTRA_ARGS += vfp3=off +else +# enable armv7 vfpv3 +GYPFLAGS += -Darmv7=1 -Darm_fpu=vfpv3 -Darm_neon=0 -Dv8_use_arm_eabi_hardfloat=true +endif +endif + +ifeq (armel, $(DEB_HOST_ARCH)) +# hints can be found there: +# https://groups.google.com/forum/#!topic/v8-users/PIP1OgH0sOQ +# https://code.google.com/p/v8/issues/detail?id=914 +# arm processors features are detected at runtime - and that can lead to +# a situation where compilation works but runtime crashes +CXXFLAGS += -fno-tree-sink +CXXFLAGS += -Wno-psabi +ifeq ($(shell dpkg-vendor --is ubuntu && echo true),true) +# Ubuntu targets armv7+ with VFP and thumb2 support by default for armel +GYPFLAGS += -Darmv7=1 -Darm_fpu=vfpv3 -Darm_neon=0 -Dv8_use_arm_eabi_hardfloat=false +else +DEB_MAKE_EXTRA_ARGS += vfp3=off +# Disable thumb-interworking because v8 supports it only on >= armv5t. +# http://code.google.com/p/v8/issues/detail?id=590 +CXXFLAGS += -mno-thumb-interwork +# disable armv7, use softfloat +GYPFLAGS += -Darmv7=0 -Dv8_use_arm_eabi_hardfloat=false +endif +endif + +# hardening gyp +CXXFLAGS+=$(CPPFLAGS) + +# let cctest build +CXXFLAGS += -Wno-unused-variable + +# eliminates swarming_client dependency +GYPFLAGS += -Dtest_isolation_mode=noop + +# for some reason just snapshot=on for make doesn't work +# and v8 starts built with V8_USE_EXTERNAL_STARTUP_DATA which is not what we want. This is simple workaround: +GYPFLAGS += -Dv8_use_snapshot=true -Dv8_use_external_startup_data=0 + +export LDFLAGS +export CXXFLAGS +export GYPFLAGS + +DEB_MAKE_EXTRA_ARGS += library=shared snapshot=on i18nsupport=on soname_version=$(ABI) OS=$(v8os) V=1 +DEB_MAKE_CLEAN_TARGET = clean +DEB_MAKE_BUILD_TARGET = $(v8arch).release + +v8out = $(CURDIR)/out/$(v8arch).release/lib.target/$(LIBSTEM).$(ABI) +d8out = $(CURDIR)/out/$(v8arch).release/d8 + +# regression tests +# * relax regression tests when targeted experimental suite +# * run only javascript tests, cctests are for development purposes +#DEB_MAKE_CHECK_TARGET = $(v8arch).release.check \ +# LD_PRELOAD=$(v8out) \ +# TESTFLAGS="--no-presubmit mjsunit message preparser" \ +# TESTJOBS="$(DEB_MAKE_PARALLEL) --timeout=$(timeOut)" \ +# $(if $(shell dpkg-parsechangelog | grep -Fx 'Distribution: experimental'),|| true) + +DEB_DH_INSTALL_ARGS_libv8-$(ABI) = usr/lib/$(LIBSTEM).$(ABI) + +package = libv8-$(API) + +build/$(package)-dev:: + mkdir -p out/lib.static + cp out/$(v8arch).release/obj.target/src/*.a out/lib.static/ + # turn thin archives to normal to distribute static libs + for lib in `find ./out/lib.static/ -name *.a`; do ar -t $$lib | xargs ar rvs $$lib.new && mv -v $$lib.new $$lib; done + +build/$(package)-d8:: + mkdir -p debian/tmp/usr/bin + cp $(d8out) debian/tmp/usr/bin/d8 + +# Setup dynamically named debhelper install file during build +pre-build:: + cp -f debian/libv8-dev.install debian/$(package)-dev.install + cp -f debian/libv8-dev.examples debian/$(package)-dev.examples + cp -f debian/libv8-d8.install debian/$(package)-d8.install +clean:: + rm -f debian/$(package)-d8.install + rm -f debian/$(package)-dev.install + rm -f debian/$(package)-dev.examples + +clean:: + rm -rf out + find . -name "*.pyc" -exec rm -f '{}' \; + rm -f test/*/*.status2 + rm -f debian/libv8*.new.abi + rm -f debian/acc_report.html + + +common-install-impl:: + mkdir -p debian/tmp/usr/lib ; \ + cd debian/tmp/usr/lib ; \ + cp $(v8out) . ; \ + ln -s -T $(LIBSTEM).$(ABI) $(LIBSTEM) diff --git a/scripts/ppa-packaging/libv8/debian/source/format b/scripts/ppa-packaging/libv8/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/scripts/ppa-packaging/libv8/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/scripts/ppa-packaging/libv8/load_deps.py b/scripts/ppa-packaging/libv8/load_deps.py new file mode 100755 index 0000000..fe67da0 --- /dev/null +++ b/scripts/ppa-packaging/libv8/load_deps.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import os + +parentdir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +os.sys.path.insert(0, parentdir) + +import deps + +deps_loader = deps.V8DepsLocalFileLoader('./DEPS') +deps_content = deps_loader.load() + +deps_resolver = deps.PPAPackagingDepsResolver(deps_content) + +deps_resolver.import_deps_fast() diff --git a/scripts/ppa-packaging/packaging.mk b/scripts/ppa-packaging/packaging.mk new file mode 100644 index 0000000..21d85c8 --- /dev/null +++ b/scripts/ppa-packaging/packaging.mk @@ -0,0 +1,102 @@ +# PPA archive +#PPA=ppa:username/ppa-name + +# List of target distributions +DISTROS=trusty wily xenial + +DEBUILD=debuild -S +DEBUILD="echo ok" + +all: _phony + +_phony: + +distro: work/${NAME}_${VERSION} + +work/${NAME}_${VERSION}: + \ + mkdir work || true ; \ + cd work ; \ + if test -z "${GIT_FAST}"; then \ + git clone "${GIT_URL}" "${NAME}_${VERSION}" ; \ + cd "${NAME}_${VERSION}" ; \ + git fetch origin "${GIT_VERSION}"; \ + git checkout "${GIT_VERSION}" ; \ + else \ + git clone --depth=1 --branch="${GIT_VERSION}" "${GIT_URL}" "${NAME}_${VERSION}" ; \ + cd "${NAME}_${VERSION}" ; \ + fi; \ + \ + git submodule init ; git submodule update; \ + \ + if test -n "${GIT_POST_HOOK}"; then \ + ../../${GIT_POST_HOOK} ${GIT_VERSION}; \ + fi; \ + \ + cd .. ; \ + tar --exclude .git --exclude '*.pyc' -cf - ${NAME}_${VERSION} | gzip -n9c > ${NAME}_${VERSION}.orig.tar.gz + +source-build: + $(MAKE) _build DEBUILD="debuild -S -sa" + +build: + $(MAKE) _build DEBUILD=debuild + +install: build + sudo dpkg -i work/*.deb + +_build: distro + \ +if test -z "$$DEBEMAIL" -o -z "$$DEBFULLNAME"; then \ + echo "DEBFULLNAME and DEBEMAIL environmental variable should be set" ; \ + echo "For example:" ; \ + echo "export DEBEMAIL=\"my@emailaddress.com\"" ; \ + echo "export DEBFULLNAME=\"Full Name\"" ;\ + exit 1; \ +fi + \ +cd "work/${NAME}_${VERSION}" ; \ +for distro in ${DISTROS}; do \ + NEW_VER="${VERSION}-ppa${PPA_VERSION}~$$distro"; \ + rm -Rf debian ; cp -r ../../debian . ; \ + sed -i -e "s/DISTRO/$$distro/g" debian/changelog ; \ + for file in debian/*.$$distro; do \ + if [ -f $$file ]; then \ + rename -f "s/\.$$distro$$//" $$file ; \ + fi ; \ + done ; \ + CUR_NAME=`dpkg-parsechangelog | grep '^Source: ' | awk '{print $$2}'`; \ + CUR_VER=`dpkg-parsechangelog | grep '^Version: ' | awk '{print $$2}'`; \ + if dpkg --compare-versions $$NEW_VER gt $$CUR_VER; then \ + echo "New version. Will update changelog and build source package" ; \ + dch -v $$NEW_VER --package="${NAME}" -D $$distro --force-distribution \ + "New version based on ${GIT_VERSION} (${GIT_URL})" ; \ + DEB_MAINTAINER_MODE=1 debuild clean ; \ + else \ + if dpkg --compare-versions $$NEW_VER ne $$CUR_VER; then \ + echo "ERROR: Cannot rebuild source package, because new version is earlier \ +than the one specified in changelog ($$NEW_VER < $$CUR_VER)" ; \ + exit 1; \ + fi ; \ + echo "Same version, just rebuild source package" ; \ + fi ; \ + ${DEBUILD} ; \ +done + +dput: source-build + \ +cd "work" ; \ +for distro in ${DISTROS}; do \ + dput -f "${PPA}" "${NAME}_${VERSION}-ppa${PPA_VERSION}~$$distro""_source.changes" ; \ +done ; \ +\ +cd .. ; \ +NEW_VER="${VERSION}-ppa${PPA_VERSION}~DISTRO"; \ +CUR_VER=`dpkg-parsechangelog | grep '^Version: ' | awk '{print $$2}'`; \ +if dpkg --compare-versions $$NEW_VER gt $$CUR_VER; then \ + dch -v $$NEW_VER --package="${NAME}" -D DISTRO --force-distribution \ + "New version based on ${GIT_VERSION} (${GIT_URL})" ; \ +fi + +clean: + @rm -Rf work From a850b5b74c19115638ce85bcbd1cddb5e777c21d Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Sun, 14 Aug 2016 23:35:15 +0300 Subject: [PATCH 2/2] Upgrade to v8 5.4.420 --- .travis.yml | 4 ++-- README.md | 8 ++++---- tests/V8Exception_Error.phpt | 1 - tests/V8Exception_RangeError.phpt | 1 - tests/V8Exception_ReferenceError.phpt | 1 - tests/V8Exception_SyntaxError.phpt | 1 - tests/V8Exception_TypeError.phpt | 1 - tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt | 2 +- tests/V8StringValue.phpt | 4 ++-- 9 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60251b4..a03e008 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,8 @@ env: - NO_INTERACTION=1 - TEST_TIMEOUT=120 matrix: - - V8=5.2 - - V8=5.2 TEST_PHP_ARGS=-m + - V8=5.4 + - V8=5.4 TEST_PHP_ARGS=-m before_install: - sudo add-apt-repository ppa:pinepain/libv8-${V8} -y diff --git a/README.md b/README.md index 2088d3e..5fe5bf1 100644 --- a/README.md +++ b/README.md @@ -63,15 +63,15 @@ you from V8 API utilizing to implement more amazing stuff. ### Requirements -You will need some fresh v8 Google JavaScript enging version installed. At this time extension tested on 5.2.371. +You will need some fresh v8 Google JavaScript enging version installed. At this time extension tested on 5.4.420. - - For Ubuntu there are [pinepain/libv8-5.2](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-5.2) PPA. + - For Ubuntu there are [pinepain/libv8-5.4](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-5.4) PPA. To install fresh libv8 do: ``` - $ sudo add-apt-repository ppa:pinepain/libv8-5.2 -y + $ sudo add-apt-repository ppa:pinepain/libv8-5.4 -y $ sudo apt-get update -q - $ sudo apt-get install -y libv8-5.2-dev + $ sudo apt-get install -y libv8-5.4-dev ``` - For OS X there are [v8.rb](https://github.com/pinepain/php-v8/blob/master/scripts/homebrew/v8.rb) homebrew formula. To install fresh libv8 do: diff --git a/tests/V8Exception_Error.phpt b/tests/V8Exception_Error.phpt index 52f9076..92b7415 100644 --- a/tests/V8Exception_Error.phpt +++ b/tests/V8Exception_Error.phpt @@ -98,7 +98,6 @@ e("test"): V8\Exceptions\TryCatchException: Error: test exception: 'Error: foo' exception.stack: Error: foo - at Error (native) at test.js:5:9 Checks on V8\ObjectValue: diff --git a/tests/V8Exception_RangeError.phpt b/tests/V8Exception_RangeError.phpt index bdc770d..67080a4 100644 --- a/tests/V8Exception_RangeError.phpt +++ b/tests/V8Exception_RangeError.phpt @@ -99,7 +99,6 @@ e("test"): V8\Exceptions\TryCatchException: RangeError: test exception: 'RangeError: foo' exception.stack: RangeError: foo - at RangeError (native) at test.js:5:9 Checks on V8\ObjectValue: diff --git a/tests/V8Exception_ReferenceError.phpt b/tests/V8Exception_ReferenceError.phpt index 07a68b6..2416574 100644 --- a/tests/V8Exception_ReferenceError.phpt +++ b/tests/V8Exception_ReferenceError.phpt @@ -99,7 +99,6 @@ e("test"): V8\Exceptions\TryCatchException: ReferenceError: test exception: 'ReferenceError: foo' exception.stack: ReferenceError: foo - at ReferenceError (native) at test.js:5:9 Checks on V8\ObjectValue: diff --git a/tests/V8Exception_SyntaxError.phpt b/tests/V8Exception_SyntaxError.phpt index 23cb139..53c7344 100644 --- a/tests/V8Exception_SyntaxError.phpt +++ b/tests/V8Exception_SyntaxError.phpt @@ -99,7 +99,6 @@ e("test"): V8\Exceptions\TryCatchException: SyntaxError: test exception: 'SyntaxError: foo' exception.stack: SyntaxError: foo - at SyntaxError (native) at test.js:5:9 Checks on V8\ObjectValue: diff --git a/tests/V8Exception_TypeError.phpt b/tests/V8Exception_TypeError.phpt index d7cde72..779192b 100644 --- a/tests/V8Exception_TypeError.phpt +++ b/tests/V8Exception_TypeError.phpt @@ -99,7 +99,6 @@ e("test"): V8\Exceptions\TryCatchException: TypeError: test exception: 'TypeError: foo' exception.stack: TypeError: foo - at TypeError (native) at test.js:5:9 Checks on V8\ObjectValue: diff --git a/tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt b/tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt index b8db4d0..5911453 100644 --- a/tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt +++ b/tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt @@ -71,7 +71,7 @@ $res1 = $script1->Run($context1); --EXPECT-- typeof func: function func: function func() { [native code] } -func(): [object global] +func(): [object Object] typeof test: function test: [object Object] diff --git a/tests/V8StringValue.phpt b/tests/V8StringValue.phpt index ef44faf..1013ee4 100644 --- a/tests/V8StringValue.phpt +++ b/tests/V8StringValue.phpt @@ -93,7 +93,7 @@ foreach (['Hello, world!', 'Привет, мир!', 'こんにちは世界'] as ?> ---EXPECT-- +--EXPECTF-- Default constructor: -------------------- object(V8\StringValue)#4 (1) { @@ -170,7 +170,7 @@ V8\StringValue(V8\Value)->IsRegExp(): bool(false) Getters: -------- -V8\StringValue(V8\NameValue)->GetIdentityHash(): int(1034255942) +V8\StringValue(V8\NameValue)->GetIdentityHash(): int(%d) V8\StringValue->Length(): int(11) V8\StringValue->Utf8Length(): int(11) V8\StringValue->IsOneByte(): bool(true)