mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-06-19 18:28:08 +02:00
Added generate script for rbx definitions used postmodern/ruby-versions.
This commit is contained in:
parent
f50343c81f
commit
60a170698a
1 changed files with 27 additions and 0 deletions
27
script/update-rbx-defs
Executable file
27
script/update-rbx-defs
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'open-uri'
|
||||
require 'pathname'
|
||||
|
||||
file = "https://raw.githubusercontent.com/postmodern/ruby-versions/master/rubinius/checksums.sha256"
|
||||
dir = Pathname(File.expand_path("share/ruby-build"))
|
||||
|
||||
open(file).each do |package|
|
||||
sha256, filename = package.chomp.split
|
||||
version = filename.match(/rubinius-(3.[\d\.]+).tar.bz2/)
|
||||
|
||||
next unless version
|
||||
|
||||
version = version[1]
|
||||
defname = "rbx-#{version}"
|
||||
|
||||
next if File.exists?(dir.join(defname))
|
||||
|
||||
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
|
||||
TEMPLATE
|
||||
|
||||
File.open(dir.join(defname), "w"){|f| f.write definition}
|
||||
end
|
Loading…
Reference in a new issue