sq_mini_racer 0.2.3.sqreen3 → 0.2.3.sqreen4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/mini_racer_extension/extconf.rb +33 -2
- data/lib/sqreen/mini_racer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 679f35609f5d2a94e34c3457bc820af674e0aeca42c53a7c8ed321d82a8a9b20
|
4
|
+
data.tar.gz: 062413bdebc8a6f787d125ebb819243f34f2f2cfe9341d9bf127cf35533bec07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30f1eee24877e7672b1c916a0b99c296ec017dab890cb8b197a5d4189edf4e3b52765a946d9774cc2b618e2fb946e4a8517bd8e5ab839d4d2fafc78ee2c01b2a
|
7
|
+
data.tar.gz: 65e140b8d96aa420ff53b0e44ef6958158315778a6de39870139f551888c3a2cf031126ceafa34e17c725ac5c0d493099b03f261216a2bba40d2da13bc9c115c
|
@@ -77,13 +77,44 @@ def libv8_gem_name
|
|
77
77
|
is_musl ? 'libv8-alpine' : 'libv8'
|
78
78
|
end
|
79
79
|
|
80
|
+
# old rubygem versions prefer source gems to binary ones
|
81
|
+
# ... and their --platform switch is broken too, as it leaves the 'ruby'
|
82
|
+
# platform in Gem.platforms.
|
83
|
+
def force_platform_gem
|
84
|
+
gem_version = `gem --version`
|
85
|
+
return 'gem' unless $?.success?
|
86
|
+
|
87
|
+
return 'gem' if gem_version.to_f.zero? || gem_version.to_f >= 2.3
|
88
|
+
return 'gem' if RUBY_PLATFORM != 'x86_64-linux'
|
89
|
+
|
90
|
+
gem_binary = `which gem`
|
91
|
+
return 'gem' unless $?.success?
|
92
|
+
|
93
|
+
ruby = File.foreach(gem_binary.strip).first.sub(/^#!/, '').strip
|
94
|
+
unless File.file? ruby
|
95
|
+
warn "No valid ruby: #{ruby}"
|
96
|
+
return 'gem'
|
97
|
+
end
|
98
|
+
|
99
|
+
require 'tempfile'
|
100
|
+
file = Tempfile.new('sq_mini_racer')
|
101
|
+
file << <<EOS
|
102
|
+
require 'rubygems'
|
103
|
+
Gem.platforms.reject! { |it| it == 'ruby' }
|
104
|
+
#{IO.read(gem_binary.strip)}
|
105
|
+
EOS
|
106
|
+
file.close
|
107
|
+
"#{ruby} '#{file.path}'"
|
108
|
+
end
|
109
|
+
|
80
110
|
LIBV8_VERSION = '6.7.288.46.1'
|
81
111
|
libv8_rb = Dir.glob('**/libv8.rb').first
|
82
112
|
FileUtils.mkdir_p('gemdir')
|
83
113
|
unless libv8_rb
|
84
114
|
gem_name = libv8_gem_name
|
85
|
-
|
86
|
-
|
115
|
+
cmd = "#{fixup_libtinfo} #{force_platform_gem} install --version '= #{LIBV8_VERSION}' --install-dir gemdir #{gem_name}"
|
116
|
+
puts "Will try downloading #{gem_name} gem: #{cmd}"
|
117
|
+
`#{cmd}`
|
87
118
|
unless $?.success?
|
88
119
|
warn <<EOS
|
89
120
|
|