libv8-node 15.14.0.1 → 17.9.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 494e077ccd0f8007334916f1b85160298ede846ed2b1a7c41b0534ca90f2845d
4
- data.tar.gz: 7c890236b1f1cd9e23af5d93d35b091f6ed48b149ba41b1f0869cf6ed5e656bd
3
+ metadata.gz: 77d656afd7388f0880caf7e7dd87f11f52e1433d78251bc830ce079dfd08e13f
4
+ data.tar.gz: 6f26a9758e57478e432686ef6763df7387d988cdb32c6c3895d2cb7e699f5c54
5
5
  SHA512:
6
- metadata.gz: 5dddfa049e9e0db5946e626cdc55e80581771802a02baa648c588eabee0d8a0439f8f69ae5e37473f9823adf765abae602ec08cbd2180d1e7c56009688426e11
7
- data.tar.gz: e2432ab8bc98acbf5c3fe9ea0ec6e7c65bf2a996ae7d625ca835dc7c7d47f0257c4a87a68d5789a2d7074d6e20ffb6d75b9ba4c195952ca4434051d4638f0e7b
6
+ metadata.gz: 638aad097efa406f29de95569a28ba12d35c711d374dc011612704658e2552ba058abaa18d5a3730e06cfe5e20b189154c6e83f2628c19a1753c847e583b101f
7
+ data.tar.gz: c0cc5d4664da75583e892eaeac8b5293943a93a0b4e8374f02e64df1504de1bfe3493a9f6f628a45cbbd1312b5746beb41a42bff046df1d75aef090325e81bfb
data/README.md CHANGED
@@ -0,0 +1,101 @@
1
+ # libv8-node
2
+
3
+ A project for distributing the v8 runtime libraries and headers in both source and binary form, packaged as a language-independent zip and as a Ruby gem.
4
+
5
+ ## Why?
6
+
7
+ The goal of libv8-node is three-fold:
8
+
9
+ - provide a build environment reliably producing a set of (non-Ruby) pre-compiled v8 libraries for as many platforms as possible
10
+ - package the pre-compiled v8 libraries as a binary gem leveraging rubygems platform matching
11
+ - provide a gem performing an automated compilation for all other platforms
12
+
13
+ Not only does this drastically reduce gem install times, but it also reduces dependencies on the local machine receiving the gem, as well as unifying the configurable variants that v8 supports.
14
+
15
+ ## How? (also why Node?)
16
+
17
+ Upstream V8 is dependent on a set of complicated Google-provided tools that fetch source *and* a set of upstream-built compiler toolchains. These are only supported to the extent that they enable the current Chrome versions to build, and only for Chrome-supported platforms. This means that these tools operate on a rolling release basis purely for Google's needs and rely on source control for fetching, thus in practice are only provided as convenience, only allow a frozen-in-time overall relationship and receive no backports, frequently breaking in the context of stable releases, and don't easily support many platforms.
18
+
19
+ Conversely, the Node.js team vendors v8 in their source code, integrate it in their build system, maintain that across many platforms with public tiered support, backport stability and security fixes under a public timeline, all packaged as a simple tarball.
20
+
21
+ Therefore we fetch a Node tarball, extract it, build it, save the v8 headers and built libraries, vendor the result, and build a gem from it.
22
+
23
+ See the Node [platform list](https://github.com/nodejs/node/blob/master/BUILDING.md#platform-list) and [support schedule](https://nodejs.org/en/about/releases/).
24
+
25
+ ## Do I get a binary?
26
+
27
+ It depends on what the Node version supports, how much of the platforms we can have in CI, and which hardware we have access to.
28
+
29
+ Check the CI artifacts on the repo's GitHub Actions and [libv8-node on rubygems.org](https://rubygems.org/gems/libv8-node) to be sure.
30
+
31
+ Here's an informal list of platforms we push so far, with equally informal tiers:
32
+
33
+ Tier 0 (CI built and tested):
34
+
35
+ - x86_64-darwin (17 to 20)
36
+ - x86_64-linux
37
+ - x86_64-linux-musl
38
+
39
+ Tier 1 (manual build and test):
40
+
41
+ - arm64-darwin (20)
42
+
43
+ Tier 2 (manual build and test, has known stability issues):
44
+
45
+ - aarch64-linux
46
+ - aarch64-linux-musl
47
+
48
+ As a fallback, the source gem (`ruby` gem platform) should compile on all Node supported platforms (including e.g. ppc64le or solaris), but we may not have tested it. Help is welcome!
49
+
50
+ If a published binary does not work for you, bundler allows to force using the `ruby` platform via `force_ruby_platform`, which will compile from source.
51
+
52
+ ### Note on OS X macOS binaries
53
+
54
+ If you're installing libv8 on a macOS system that is present in the list above, and despite that, RubyGems insists on downloading a source version and compiling it, check the output of ruby -e 'puts Gem::Platform.local'. If it does not reflect the current version of your OS, recompile Ruby.
55
+
56
+ The platform gets hardcoded in Ruby during compilation and if you've updated your OS since you've compiled Ruby, it does not represent correctly your current platform which leads to RubyGems trying to download a platform-specific gem for the older version of your OS.
57
+
58
+ ### Note on Alpine/musl
59
+
60
+ There is an outstanding issue with rubygems and bundler, where it may misselect the incorrect platform (e.g picking linux instead of linux-musl)
61
+
62
+ ## Versioning
63
+
64
+ The gem versioning is Node-based, e.g node 15.14.0 gives the gem 15.14.0.0. The last number is an increment for libv8-node fixes. We try as mucha s possible not to include too much changes in such gem fixes, so you can consider these like "patch" in semver.
65
+
66
+ Compared to the `libv8` gem, there is no odd/even scheme, thanks to the intriduction in bundler of the `force_ruby_platform` flag.
67
+
68
+ ## Requirements
69
+
70
+ ### Building
71
+
72
+ Building from source has a number of requirements, which mostly depend on the Node version. You can find these in the corresponding Node tree.
73
+
74
+ - https://github.com/nodejs/node/blob/master/BUILDING.md#supported-toolchains
75
+ - https://github.com/nodejs/node/blob/master/BUILDING.md#building-nodejs-on-supported-platforms
76
+
77
+ Be sure to check the one for the Node version in use.
78
+
79
+ ### Linking
80
+
81
+ Linking against the produced binaries e.g when installing a `ruby`-platform `mini_racer`) also has similar requirements. Notably, please make sure to have similarly recent compiler and libc++ installed.
82
+
83
+ ## Building from the repo
84
+
85
+ See `BUILDING.md`. Also make sure to read `CONTRIBUTING.md` if you plan to help.
86
+
87
+ ## About
88
+
89
+ This project spun off of [libv8](http://github.com/rubyjs/libv8), which itself spun off of [therubyracer](http://github.com/rubyjs/therubyracer) which depends on having a specific version of V8 to compile and run against. However, actually delivering that version reliably to all the different platforms proved to be a challenge to say the least.
90
+
91
+ ## License
92
+
93
+ (The MIT License)
94
+
95
+ Copyright (c) 2009,2010 Charles Lowell
96
+
97
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
98
+
99
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
100
+
101
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -18,7 +18,7 @@ module Libv8::Node
18
18
 
19
19
  def self.load!
20
20
  File.open(Pathname(__FILE__).dirname.join('.location.yml')) do |f|
21
- YAML.load(f) # rubocop:disable Security/YAMLLoad
21
+ YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(f) : YAML.load(f) # rubocop:disable Security/YAMLLoad
22
22
  end
23
23
  end
24
24
 
@@ -13,12 +13,16 @@ module Libv8::Node
13
13
 
14
14
  def object_paths
15
15
  [Shellwords.escape(File.join(vendored_source_path,
16
- 'out.gn',
16
+ platform,
17
17
  'libv8',
18
18
  'obj',
19
19
  "libv8_monolith.#{config['LIBEXT']}"))]
20
20
  end
21
21
 
22
+ def platform
23
+ Gem::Platform.local.tap { |p| RUBY_PLATFORM =~ /musl/ && p.version.nil? && p.instance_eval { @version = 'musl' } }.to_s.gsub(/-darwin-?\d+/, '-darwin')
24
+ end
25
+
22
26
  def config
23
27
  RbConfig::MAKEFILE_CONFIG
24
28
  end
@@ -1,7 +1,7 @@
1
1
  module Libv8; end
2
2
 
3
3
  module Libv8::Node
4
- VERSION = '15.14.0.1'.freeze
5
- NODE_VERSION = '15.14.0'.freeze
6
- LIBV8_VERSION = '8.6.395.17'.freeze # from v8/include/v8-version.h
4
+ VERSION = '17.9.1.0'.freeze
5
+ NODE_VERSION = '17.9.1'.freeze
6
+ LIBV8_VERSION = '9.6.180.15'.freeze # from v8/include/v8-version.h
7
7
  end
data/libexec/build-libv8 CHANGED
@@ -3,19 +3,19 @@
3
3
  set -e
4
4
  set -u
5
5
 
6
- version="${1}"
7
6
  libexec="$(cd "$(dirname "$0")"; pwd)"
8
7
  top="${libexec}/.."
9
8
  src="${2:-"${top}/src"}"
10
-
11
- platform=$(uname)
9
+ version="${1:-$("${libexec}/metadata" node_version)}"
12
10
 
13
11
  NJOBS="${NJOBS:-$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || true)}"
14
12
  NJOBS="${NJOBS:-1}"
15
13
 
16
14
  echo "parallel job count: ${NJOBS}"
17
15
 
18
- cd "${src}/node-${version}"
16
+ BUILDTYPE="${BUILDTYPE:-Release}"
17
+
18
+ cd "${src}/node-v${version}"
19
19
 
20
20
  if command -v python3 >/dev/null 2>&1; then
21
21
  PYTHON="${PYTHON:-python3}"
@@ -23,31 +23,20 @@ else
23
23
  PYTHON="${PYTHON:-python2}"
24
24
  fi
25
25
 
26
- case "${platform}" in
27
- SunOS)
28
- export CC="${CC:-/opt/local/gcc7/bin/gcc}"
29
- export CXX="${CXX:-/opt/local/gcc7/bin/g++}"
30
- ;;
31
- *)
32
- if cc --version | grep 4.9 >/dev/null; then
33
- export CC="${CC:-clang}"
34
- export CXX="${CXX:-clang++}"
35
- fi
36
- ;;
37
- esac
38
-
39
- case "$(uname -m)" in
40
- armv7l)
41
- enable_pointer_compression=""
42
- ;;
43
- *)
44
- enable_pointer_compression="--experimental-enable-pointer-compression"
45
- ;;
46
- esac
47
-
48
- "${PYTHON}" configure --openssl-no-asm --without-npm --shared --with-intl=full-icu ${enable_pointer_compression}
49
- make BUILDTYPE=Release config.gypi
50
- make BUILDTYPE=Release out/Makefile
26
+ configure_flags='--openssl-no-asm --without-npm --shared --with-intl=full-icu'
27
+ eval "$("${libexec}/platform")"
28
+
29
+ echo "configure: ${configure_flags}"
30
+ echo "compilers: CC='${CC}' CXX='${CXX}' CC_host='${CC_host:-}' CXX_host='${CXX_host:-}'"
31
+
32
+ ${CC} -v
33
+ ${CXX} -v
34
+
35
+ # shellcheck disable=SC2086
36
+ "${PYTHON}" configure ${configure_flags}
37
+
38
+ make BUILDTYPE="${BUILDTYPE}" config.gypi
39
+ make BUILDTYPE="${BUILDTYPE}" "out/Makefile"
51
40
 
52
41
  export PATH="${PWD}/out/tools/bin:${PATH}"
53
- make -j"${NJOBS}" -C out BUILDTYPE=Release V=0 libv8_monolith
42
+ make -j"${NJOBS}" -C out BUILDTYPE="${BUILDTYPE}" V=0
@@ -3,12 +3,12 @@
3
3
  set -e
4
4
  set -u
5
5
 
6
- version="${1}"
7
6
  libexec="$(cd "$(dirname "$0")"; pwd)"
8
7
  top="${libexec}/.."
9
8
  src="${2:-"${top}/src"}"
9
+ version="${1:-$("${libexec}/metadata" node_version)}"
10
10
 
11
- cd "${src}/node-${version}"
11
+ cd "${src}/node-v${version}"
12
12
 
13
13
  BASEDIR="${PWD}"
14
14
  BUILDTYPE="${BUILDTYPE:-Release}"
@@ -21,21 +21,13 @@ platform=$(uname)
21
21
  rm -f "${LIBV8_MONOLITH}"
22
22
  case "${platform}" in
23
23
  "SunOS")
24
- /usr/xpg4/bin/find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | while read -r obj; do
25
- ar cqS "${LIBV8_MONOLITH}" "${obj}"
26
- done
27
- ranlib "${LIBV8_MONOLITH}"
24
+ /usr/xpg4/bin/find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs ar cq "${LIBV8_MONOLITH}"
28
25
  ;;
29
26
  "Darwin")
30
- /usr/bin/find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | while read -r obj; do
31
- /usr/bin/ar -cqS "${LIBV8_MONOLITH}" "${obj}"
32
- done
33
- /usr/bin/ranlib "${LIBV8_MONOLITH}"
27
+ /usr/bin/find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs /usr/bin/ar -cq "${LIBV8_MONOLITH}"
34
28
  ;;
35
29
  "Linux")
36
- find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | while read -r obj; do
37
- ar -cq "${LIBV8_MONOLITH}" "${obj}"
38
- done
30
+ find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs ar -cq "${LIBV8_MONOLITH}"
39
31
  ;;
40
32
  *)
41
33
  echo "Unsupported platform: ${platform}"
@@ -3,12 +3,11 @@
3
3
  set -e
4
4
  set -u
5
5
 
6
- version="${1}"
7
6
  libexec="$(cd "$(dirname "$0")"; pwd)"
8
7
  top="${libexec}/.."
9
8
  src="${2:-"${top}/src"}"
9
+ version="${1:-$("${libexec}/metadata" node_version)}"
10
10
 
11
- sha256sum='e016ab40079a540dc42a6ffc97b1e398d1d50dd9519f859a5539f0309cdea673'
12
11
  check_sum() {
13
12
  filename="${1}"
14
13
  expected="${2}"
@@ -21,26 +20,41 @@ check_sum() {
21
20
  fi
22
21
  }
23
22
 
24
- if [ -f "${src}/node-${version}.tar.gz" ]; then
25
- if check_sum "${src}/node-${version}.tar.gz" "${sha256sum}"; then
26
- exit 0
27
- fi
28
- fi
23
+ download() {
24
+ file="${1}"
25
+ url="${2}"
29
26
 
30
- platform=$(uname)
27
+ platform="$(uname)"
31
28
 
32
- case "${platform}" in
33
- SunOS)
34
- CURLOPTS="${CURLOPTS:--k}"
35
- ;;
36
- *)
37
- CURLOPTS="${CURLOPTS:-}"
38
- ;;
39
- esac
29
+ case "${platform}" in
30
+ SunOS)
31
+ CURLOPTS="${CURLOPTS:--k}"
32
+ ;;
33
+ *)
34
+ CURLOPTS="${CURLOPTS:-}"
35
+ ;;
36
+ esac
40
37
 
41
- mkdir -p "${src}"
38
+ if command -v curl >/dev/null 2>&1; then
39
+ # shellcheck disable=SC2086
40
+ curl ${CURLOPTS} -L -o "${file}" "${url}"
41
+ else
42
+ wget -O "${file}" "${url}"
43
+ fi
44
+ }
42
45
 
43
- # shellcheck disable=SC2086
44
- curl ${CURLOPTS} -L -o "${src}/node-${version}.tar.gz" "https://github.com/nodejs/node/archive/v${version}.tar.gz"
46
+ if [ -f "${top}/sums/v${version}.sum" ]; then
47
+ sha256sum="$(cat "${top}/sums/v${version}.sum")"
48
+ else
49
+ sha256sum='0000000000000000000000000000000000000000000000000000000000000000'
50
+ fi
51
+
52
+ if [ -f "${src}/node-v${version}.tar.gz" ]; then
53
+ if check_sum "${src}/node-v${version}.tar.gz" "${sha256sum}"; then
54
+ exit 0
55
+ fi
56
+ fi
45
57
 
46
- check_sum "${src}/node-${version}.tar.gz" "${sha256sum}" && exit 0
58
+ mkdir -p "${src}"
59
+ download "${src}/node-v${version}.tar.gz" "https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
60
+ check_sum "${src}/node-v${version}.tar.gz" "${sha256sum}" && exit 0
data/libexec/extract-node CHANGED
@@ -3,27 +3,33 @@
3
3
  set -e
4
4
  set -u
5
5
 
6
- version="${1}"
7
6
  libexec="$(cd "$(dirname "$0")"; pwd)"
8
7
  top="${libexec}/.."
9
8
  src="${2:-"${top}/src"}"
9
+ version="${1:-$("${libexec}/metadata" node_version)}"
10
10
 
11
- platform=$(uname)
11
+ extract() {
12
+ dir="${1}"
13
+ file="${2}"
12
14
 
13
- case "${platform}" in
14
- SunOS)
15
- TAR="${TAR:-gtar}"
16
- ;;
17
- *)
18
- TAR="${TAR:-tar}"
19
- ;;
20
- esac
15
+ platform=$(uname)
16
+ case "${platform}" in
17
+ SunOS)
18
+ TAR="${TAR:-gtar}"
19
+ ;;
20
+ *)
21
+ TAR="${TAR:-tar}"
22
+ ;;
23
+ esac
21
24
 
22
- "${TAR}" -C "${src}" -xz -f "${src}/node-${version}.tar.gz"
25
+ "${TAR}" -C "${dir}" -xz -f "${file}"
26
+ }
23
27
 
24
- cd "${src}/node-${version}"
28
+ extract "${src}" "${src}/node-v${version}.tar.gz"
25
29
 
26
- patch -p1 < "${top}"/patch/gyp-libv8_monolith.patch
30
+ cd "${src}/node-v${version}"
31
+
32
+ #patch -p1 < "${top}"/patch/gyp-libv8_monolith.patch
27
33
  patch -p1 < "${top}"/patch/py2-icutrim.patch
28
34
  patch -p1 < "${top}"/patch/py2-genv8constants.patch
29
35
 
data/libexec/inject-libv8 CHANGED
@@ -3,26 +3,17 @@
3
3
  set -e
4
4
  set -u
5
5
 
6
- version="${1}"
7
6
  libexec="$(cd "$(dirname "$0")"; pwd)"
8
7
  top="${libexec}/.."
9
8
  src="${2:-"${top}/src"}"
9
+ version="${1:-$("${libexec}/metadata" node_version)}"
10
10
 
11
- cd "${src}/node-${version}"
11
+ cd "${src}/node-v${version}"
12
12
 
13
13
  BASEDIR="${PWD}"
14
14
  BUILDTYPE="${BUILDTYPE:-Release}"
15
15
 
16
- platform=$(uname)
17
-
18
- case "${platform}" in
19
- SunOS)
20
- STRIP="${STRIP:-gstrip}"
21
- ;;
22
- *)
23
- STRIP="${STRIP:-strip}"
24
- ;;
25
- esac
16
+ eval "$("${libexec}/platform")"
26
17
 
27
18
  cd "${BASEDIR}/deps/v8/include"
28
19
 
@@ -35,13 +26,20 @@ done
35
26
 
36
27
  cd "${BASEDIR}/out/${BUILDTYPE}"
37
28
 
38
- rm -rf "${top}/vendor/v8/out.gn"
29
+ case "${RUBY_TARGET_PLATFORM}" in
30
+ *-darwin*)
31
+ RUBY_TARGET_PLATFORM="$(echo "${RUBY_TARGET_PLATFORM}" | sed -e 's/-darwin[0-9]*/-darwin/')"
32
+ ;;
33
+ esac
34
+
35
+ rm -rf "${top}/vendor/v8/${RUBY_TARGET_PLATFORM}"
39
36
  # shellcheck disable=SC2043
40
37
  for lib in libv8_monolith.a; do
41
- dir="${top}/vendor/v8/out.gn/libv8/obj/$(dirname "${lib}")"
38
+ dir="${top}/vendor/v8/${RUBY_TARGET_PLATFORM}/libv8/obj/$(dirname "${lib}")"
42
39
  mkdir -p "${dir}"
43
40
  rm -f "${dir}/${lib}"
44
41
 
42
+ echo "${BASEDIR}/out/${BUILDTYPE}/${lib} -> ${dir}/${lib}"
45
43
  "${STRIP}" -S -x -o "${dir}/${lib}" "${lib}"
46
44
  done
47
45
 
data/libexec/metadata CHANGED
@@ -5,9 +5,9 @@ case "$1" in
5
5
  ruby -e 'puts RUBY_PLATFORM'
6
6
  ;;
7
7
  gem_platform)
8
- ruby -e 'puts Gem.platforms.last.to_s'
8
+ ruby -e 'puts Gem::Platform.local.tap { |p| RUBY_PLATFORM =~ /musl/ && p.version.nil? and p.instance_eval { @version = "musl" } }.to_s.gsub(/-darwin-?\d+/, "-darwin")'
9
9
  ;;
10
- version)
10
+ gem_version|version)
11
11
  ruby -I'lib' -r'libv8/node/version' -e 'puts Libv8::Node::VERSION'
12
12
  ;;
13
13
  node_version)
@@ -18,7 +18,7 @@ case "$1" in
18
18
  ;;
19
19
  libv8_version_h)
20
20
  # shellcheck disable=SC2016
21
- ruby -e 'h = File.read("src/node-'"$("$0" node_version)"'/deps/v8/include/v8-version.h"); eval h.each_line.with_object([]) { |l, e| l =~ /#define (V8_[A-Z_]+)\s(\d+)/ && e << "#{$1} = #{$2}" }.join(";"); puts "#{V8_MAJOR_VERSION}.#{V8_MINOR_VERSION}.#{V8_BUILD_NUMBER}.#{V8_PATCH_LEVEL}"'
21
+ ruby -e 'h = File.read("src/node-v'"$("$0" node_version)"'/deps/v8/include/v8-version.h"); eval h.each_line.with_object([]) { |l, e| l =~ /#define (V8_[A-Z_]+)\s(\d+)/ && e << "#{$1} = #{$2}" }.join(";"); puts "#{V8_MAJOR_VERSION}.#{V8_MINOR_VERSION}.#{V8_BUILD_NUMBER}.#{V8_PATCH_LEVEL}"'
22
22
  ;;
23
23
  *)
24
24
  exit 64
data/libexec/platform ADDED
@@ -0,0 +1,166 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+ set -u
5
+
6
+ if command -v clang >/dev/null 2>&1; then
7
+ CC="${CC:-clang}"
8
+ CXX="${CXX:-clang++}"
9
+ elif command -v gcc >/dev/null 2>&1; then
10
+ CC="${CC:-gcc}"
11
+ CXX="${CXX:-g++}"
12
+ elif command -v cc >/dev/null 2>&1; then
13
+ CC="${CC:-cc}"
14
+ CXX="${CXX:-c++}"
15
+ fi
16
+
17
+ STRIP="${STRIP:-strip}"
18
+
19
+ triple=$(${CC} -dumpmachine)
20
+ host_platform="${triple}"
21
+ target_platform="${TARGET_PLATFORM:-${1:-}}"
22
+ target_platform="${target_platform:-${host_platform}}"
23
+
24
+ case "${target_platform}" in
25
+ x86_64*-linux-musl)
26
+ RUBY_TARGET_PLATFORM='x86_64-linux-musl'
27
+ ;;
28
+ x86_64*-linux-*)
29
+ RUBY_TARGET_PLATFORM='x86_64-linux'
30
+ ;;
31
+ aarch64*-linux-musl)
32
+ RUBY_TARGET_PLATFORM='aarch64-linux-musl'
33
+ ;;
34
+ aarch64*-linux-*)
35
+ RUBY_TARGET_PLATFORM='aarch64-linux'
36
+ ;;
37
+ arm*-linux-musl)
38
+ RUBY_TARGET_PLATFORM='arm-linux-musl'
39
+ ;;
40
+ arm*-linux-*)
41
+ RUBY_TARGET_PLATFORM='arm-linux'
42
+ ;;
43
+ x86_64*-darwin*)
44
+ # not for cross compilation
45
+ RUBY_TARGET_PLATFORM='x86_64-darwin'
46
+ ;;
47
+ arm64*-darwin*)
48
+ # not for cross compilation
49
+ RUBY_TARGET_PLATFORM='arm64-darwin'
50
+ ;;
51
+ *)
52
+ if [ "${host_platform}" != "${target_platform}" ]; then
53
+ echo 'cross compilation not supported'
54
+ exit 1
55
+ fi
56
+ RUBY_TARGET_PLATFORM="$(ruby -e 'puts Gem::Platform.local.to_s')"
57
+ ;;
58
+ esac
59
+
60
+ case "${host_platform}" in
61
+ *solaris*)
62
+ CC="${CC:-/opt/local/gcc7/bin/gcc}"
63
+ CXX="${CXX:-/opt/local/gcc7/bin/g++}"
64
+ STRIP="gstrip"
65
+ ;;
66
+ esac
67
+
68
+ if [ "${host_platform}" != "${target_platform}" ]; then
69
+ echo "# cross compiling host: ${host_platform} target: ${target_platform}"
70
+ case "${target_platform}" in
71
+ aarch64-*linux*)
72
+ CC='aarch64-linux-gnu-gcc'
73
+ CXX='aarch64-linux-gnu-g++'
74
+ CC_host='gcc'
75
+ CXX_host='g++'
76
+ STRIP='aarch64-linux-gnu-strip'
77
+ configure_flags='--dest-cpu=arm64 --cross-compiling --dest-os=linux --with-arm-float-abi=hard --with-arm-fpu=neon'
78
+ ;;
79
+ arm*-*linux*)
80
+ CC='arm-linux-gnueabihf-gcc'
81
+ CXX='arm-linux-gnueabihf-g++'
82
+ CC_host='gcc -m32'
83
+ CXX_host='g++ -m32'
84
+ STRIP='arm-linux-gnueabihf-strip'
85
+ configure_flags='--dest-cpu=arm --cross-compiling --dest-os=linux --with-arm-float-abi=hard --with-arm-fpu=neon'
86
+ ;;
87
+ x86_64-*linux*)
88
+ CC='x86_64-linux-gnu-gcc'
89
+ CXX='x86_64-linux-gnu-g++'
90
+ CC_host='gcc'
91
+ CXX_host='g++'
92
+ STRIP='x86_64-linux-gnu-strip'
93
+ configure_flags='--dest-cpu=x86_64 --cross-compiling --dest-os=linux'
94
+ ;;
95
+ x86_64*-darwin*)
96
+ CC='clang -arch x86_64'
97
+ CXX='clang++ -arch x86_64'
98
+ CC_host='clang'
99
+ CXX_host='clang++'
100
+ STRIP='strip'
101
+ configure_flags='--dest-cpu=x86_64 --cross-compiling --dest-os=mac'
102
+ ;;
103
+ arm64*-darwin*)
104
+ CC='clang -arch arm64'
105
+ CXX='clang++ -arch arm64'
106
+ CC_host='clang'
107
+ CXX_host='clang++'
108
+ STRIP='strip'
109
+ configure_flags='--dest-cpu=arm64 --cross-compiling --dest-os=mac'
110
+ ;;
111
+ *)
112
+ configure_flags=''
113
+ ;;
114
+ esac
115
+ else
116
+ configure_flags=''
117
+ fi
118
+
119
+ # TODO: building with pointer compression is broken
120
+ # case "${target_platform}" in
121
+ # arm64-*)
122
+ # configure_flags="${configure_flags} --experimental-enable-pointer-compression"
123
+ # ;;
124
+ # arm*-*linux*)
125
+ # :
126
+ # ;;
127
+ # *)
128
+ # configure_flags="${configure_flags} --experimental-enable-pointer-compression"
129
+ # ;;
130
+ # esac
131
+
132
+ if command -v ccache >/dev/null 2>&1; then
133
+ if [ -n "${CC:-}" ] && [ "${CC}" = "${CC#ccache}" ]; then
134
+ CC="ccache ${CC}"
135
+ CXX="ccache ${CXX}"
136
+ fi
137
+
138
+ if [ -n "${CC_host:-}" ] && [ "${CC_host}" = "${CC_host#ccache}" ]; then
139
+ CC_host="ccache ${CC_host}"
140
+ CXX_host="ccache ${CXX_host}"
141
+ fi
142
+ fi
143
+
144
+ cat <<EOF
145
+ export CC='${CC}'
146
+ export CXX='${CXX}'
147
+ host_platform='${host_platform}'
148
+ target_platform='${target_platform}'
149
+ EOF
150
+
151
+ if [ -n "${CC_host:-}" ]; then cat <<EOF; fi
152
+ export CC_host='${CC_host}'
153
+ export CXX_host='${CXX_host}'
154
+ EOF
155
+
156
+ if [ -n "${STRIP:-}" ]; then cat <<EOF; fi
157
+ STRIP='${STRIP}'
158
+ EOF
159
+
160
+ if [ -n "${RUBY_TARGET_PLATFORM:-}" ]; then cat <<EOF; fi
161
+ RUBY_TARGET_PLATFORM='${RUBY_TARGET_PLATFORM}'
162
+ EOF
163
+
164
+ if [ -n "${configure_flags:-}" ]; then cat <<EOF; fi
165
+ configure_flags="\${configure_flags:-} ${configure_flags}"
166
+ EOF
data/sums/v16.10.0.sum ADDED
@@ -0,0 +1 @@
1
+ 69b09bb0c4cd9add7eb501b1625a405b15d6ce53596e98b863c8d066e0b6b202
data/sums/v16.11.1.sum ADDED
@@ -0,0 +1 @@
1
+ 8b5a54b284e524984772d34dc2efc68a10fc2f91db11390c6035ef2a9509ef2c
data/sums/v16.3.0.sum ADDED
@@ -0,0 +1 @@
1
+ 11d00034a9864660eadf9835d09de2bed97b245093626705d8917897d8f36704
data/sums/v16.4.2.sum ADDED
@@ -0,0 +1 @@
1
+ 46d907a06fe020ee8d7e6753357b82edd16f3871f8caaa188841d29d265de7bd
data/sums/v16.5.0.sum ADDED
@@ -0,0 +1 @@
1
+ a0d233cde072822af7fd3043b866e526a1739df32c3ace6210ae289f3266ccb7
data/sums/v16.6.2.sum ADDED
@@ -0,0 +1 @@
1
+ e8df4a0084c379a37c11b315b7d068760a38598119d7ca9262977adcbbb58933
data/sums/v16.7.0.sum ADDED
@@ -0,0 +1 @@
1
+ 0c4a82acc5ae67744d56f2c97db54b859f2b3ef8e78deacfb8aed0ed4c7cb690
data/sums/v16.8.0.sum ADDED
@@ -0,0 +1 @@
1
+ 0cc13572bc7c5a9bf7a2c5cb2800ff045780e43d0fa6e3eb0f1be46b4bf9a1c6
data/sums/v16.9.1.sum ADDED
@@ -0,0 +1 @@
1
+ 2cfab037d84550556999af6328e9b657842d9b183e6be2a4995c87d2c49e9d03
data/sums/v17.3.1.sum ADDED
@@ -0,0 +1 @@
1
+ 34ed7eeb1fd088c59e2719c229dc9587c9f106b45329798ca3945c386ac824ed
data/sums/v17.9.1.sum ADDED
@@ -0,0 +1 @@
1
+ 1102f5e0aafaab8014d19c6c57142caf2ba3ef69d88d7a7f0f82798051796027
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libv8-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.14.0.1
4
+ version: 17.9.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -62,15 +62,27 @@ files:
62
62
  - libexec/extract-node
63
63
  - libexec/inject-libv8
64
64
  - libexec/metadata
65
+ - libexec/platform
65
66
  - patch/gyp-libv8_monolith.patch
66
67
  - patch/py2-genv8constants.patch
67
68
  - patch/py2-icutrim.patch
68
69
  - patch/py3-genv8constants.patch
69
- homepage: https://github.com/sqreen/libv8-node
70
+ - sums/v16.10.0.sum
71
+ - sums/v16.11.1.sum
72
+ - sums/v16.3.0.sum
73
+ - sums/v16.4.2.sum
74
+ - sums/v16.5.0.sum
75
+ - sums/v16.6.2.sum
76
+ - sums/v16.7.0.sum
77
+ - sums/v16.8.0.sum
78
+ - sums/v16.9.1.sum
79
+ - sums/v17.3.1.sum
80
+ - sums/v17.9.1.sum
81
+ homepage: https://github.com/rubyjs/libv8-node
70
82
  licenses:
71
83
  - MIT
72
84
  metadata: {}
73
- post_install_message:
85
+ post_install_message:
74
86
  rdoc_options: []
75
87
  require_paths:
76
88
  - lib
@@ -86,8 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
98
  - !ruby/object:Gem::Version
87
99
  version: '0'
88
100
  requirements: []
89
- rubygems_version: 3.0.3
90
- signing_key:
101
+ rubygems_version: 3.2.26
102
+ signing_key:
91
103
  specification_version: 4
92
104
  summary: Node.JS's V8 JavaScript engine
93
105
  test_files: []