Skip to content

Commit 82d35ed

Browse files
committed
Add update-cruby and update-jruby scripts
This PR adds update-cruby and update-jruby scripts. They are provided to update MRI and JRuby definition files. These scripts are based on script/update-truffleruby. https://github.com/rbenv/ruby-build/blob/v20200224/script/update-truffleruby
1 parent 0ef5e05 commit 82d35ed

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

script/update-cruby

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -o pipefail
5+
6+
if [ $# -ne 2 ]; then
7+
echo "usage: $0 VERSION RELEASE_DIRECTORY"
8+
exit 1
9+
fi
10+
11+
version="$1"
12+
release_directory="$2"
13+
file="share/ruby-build/${version}"
14+
15+
basename="ruby-${version}.tar.bz2"
16+
major_minor_version=$(echo ${version} | cut -d '.' -f 1,2)
17+
url="https://cache.ruby-lang.org/pub/ruby/${major_minor_version}/${basename}"
18+
sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1)
19+
20+
cat > "$file" <<EOS
21+
install_package "openssl-1.1.1d" "https://www.openssl.org/source/openssl-1.1.1d.tar.gz#1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2" mac_openssl --if has_broken_mac_openssl
22+
install_package "ruby-${version}" "${url}#${sha256}" ldflags_dirs enable_shared standard verify_openssl
23+
EOS

script/update-jruby

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -o pipefail
5+
6+
if [ $# -ne 2 ]; then
7+
echo "usage: $0 VERSION RELEASE_DIRECTORY"
8+
exit 1
9+
fi
10+
11+
version="$1"
12+
release_directory="$2"
13+
file="share/ruby-build/jruby-${version}"
14+
15+
basename="jruby-bin-${version}.tar.gz"
16+
url="https://s3.amazonaws.com/jruby.org/downloads/${version}/${basename}"
17+
sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1)
18+
19+
cat > "$file" <<EOS
20+
require_java 8
21+
install_package "jruby-${version}" "${url}#${sha256}" jruby
22+
EOS

0 commit comments

Comments
 (0)