2018-04-22 02:54:28 +02:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require 'open-uri'
|
|
|
|
require 'pathname'
|
2020-06-12 02:14:02 +02:00
|
|
|
require 'openssl'
|
2018-04-22 02:54:28 +02:00
|
|
|
|
2020-06-12 02:14:02 +02:00
|
|
|
file = "http://rubinius-releases-rubinius-com.s3-us-west-2.amazonaws.com/index.txt"
|
2018-04-22 02:54:28 +02:00
|
|
|
dir = Pathname(File.expand_path("share/ruby-build"))
|
|
|
|
|
2020-06-12 04:28:49 +02:00
|
|
|
URI.open(file).each do |package|
|
2020-06-12 02:14:02 +02:00
|
|
|
next if package.match(/sha512/)
|
|
|
|
version = package.match(/rubinius-([345].[\d\.]+).tar.bz2/)
|
2018-04-22 02:54:28 +02:00
|
|
|
|
|
|
|
next unless version
|
|
|
|
|
|
|
|
version = version[1]
|
|
|
|
defname = "rbx-#{version}"
|
|
|
|
|
2020-06-12 04:28:49 +02:00
|
|
|
next if File.exist?(dir.join(defname))
|
2018-04-22 02:54:28 +02:00
|
|
|
|
2020-06-12 02:14:02 +02:00
|
|
|
package_url = "https://rubinius-releases-rubinius-com.s3.amazonaws.com/rubinius-#{version}.tar.bz2"
|
2020-06-12 04:28:49 +02:00
|
|
|
sha256 = OpenSSL::Digest::SHA256.hexdigest(File.read(URI.open(package_url)))
|
2020-06-12 02:14:02 +02:00
|
|
|
|
2018-04-22 02:54:28 +02:00
|
|
|
definition = <<-TEMPLATE
|
|
|
|
require_llvm 3.7
|
|
|
|
install_package "openssl-1.0.2o" "https://www.openssl.org/source/openssl-1.0.2o.tar.gz#ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d" mac_openssl --if has_broken_mac_openssl
|
2020-06-12 04:29:06 +02:00
|
|
|
install_package "rubinius-#{version}" "#{package_url}##{sha256}" rbx
|
2018-04-22 02:54:28 +02:00
|
|
|
TEMPLATE
|
|
|
|
|
|
|
|
File.open(dir.join(defname), "w"){|f| f.write definition}
|
|
|
|
end
|