File: update-rbx-defs

package info (click to toggle)
ruby-build 20200401-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,304 kB
  • sloc: sh: 1,777; ruby: 18; makefile: 9
file content (27 lines) | stat: -rwxr-xr-x 918 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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-([34].[\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