Support rbx5 and use the official package index instead of ruby-install

This commit is contained in:
Hiroshi SHIBATA 2020-06-12 09:14:02 +09:00
parent 9b7acf605a
commit c94de31cde
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -2,13 +2,14 @@
require 'open-uri'
require 'pathname'
require 'openssl'
file = "https://raw.githubusercontent.com/postmodern/ruby-versions/master/rubinius/checksums.sha256"
file = "http://rubinius-releases-rubinius-com.s3-us-west-2.amazonaws.com/index.txt"
dir = Pathname(File.expand_path("share/ruby-build"))
open(file).each do |package|
sha256, filename = package.chomp.split
version = filename.match(/rubinius-([34].[\d\.]+).tar.bz2/)
next if package.match(/sha512/)
version = package.match(/rubinius-([345].[\d\.]+).tar.bz2/)
next unless version
@ -17,10 +18,13 @@ open(file).each do |package|
next if File.exists?(dir.join(defname))
package_url = "https://rubinius-releases-rubinius-com.s3.amazonaws.com/rubinius-#{version}.tar.bz2"
sha256 = OpenSSL::Digest::SHA256.hexdigest(File.read(open(package_url)))
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
install_package "rubinius-#{version}" "https://rubinius-releases-rubinius-com.s3.amazonaws.com/rubinius-#{version}.tar.bz2##{sha256}" rbx
install_package "rubinius-#{version}" "#{package_url}" rbx
TEMPLATE
File.open(dir.join(defname), "w"){|f| f.write definition}