2020-07-12 12:55:39 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "usage: $0 VERSION RELEASE_DIRECTORY"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
version="$1"
|
|
|
|
release_directory="$2"
|
2020-07-13 20:53:14 +02:00
|
|
|
file="share/ruby-build/truffleruby+graalvm-${version}"
|
2020-07-12 12:55:39 +02:00
|
|
|
|
|
|
|
add_platform() {
|
|
|
|
platform="$1"
|
2023-04-28 15:12:52 +02:00
|
|
|
if [[ "$version" = *preview* ]]; then
|
|
|
|
basename="graalvm-ruby-community-${version}-jdk17-${platform}.tar.gz"
|
|
|
|
url="https://github.com/oracle/truffleruby/releases/download/vm-${version}/${basename}"
|
|
|
|
else
|
|
|
|
basename="graalvm-ce-java17-${platform}-${version}.tar.gz"
|
|
|
|
url="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${version}/${basename}"
|
|
|
|
fi
|
2020-07-12 12:55:39 +02:00
|
|
|
sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1)
|
|
|
|
|
|
|
|
cat >> "$file" <<EOS
|
2020-07-13 20:53:14 +02:00
|
|
|
install_package "truffleruby+graalvm-${version}" "${url}#${sha256}" truffleruby_graalvm
|
2020-07-12 12:55:39 +02:00
|
|
|
;;
|
|
|
|
EOS
|
|
|
|
}
|
|
|
|
|
|
|
|
cat > "$file" <<EOS
|
2021-08-01 12:10:33 +02:00
|
|
|
platform="\$(uname -s)-\$(uname -m)"
|
|
|
|
case \$platform in
|
|
|
|
Linux-x86_64)
|
2020-07-12 12:55:39 +02:00
|
|
|
EOS
|
|
|
|
add_platform "linux-amd64"
|
|
|
|
cat >> "$file" <<EOS
|
2021-08-01 12:10:33 +02:00
|
|
|
Linux-aarch64)
|
|
|
|
EOS
|
|
|
|
add_platform "linux-aarch64"
|
|
|
|
cat >> "$file" <<EOS
|
|
|
|
Darwin-x86_64)
|
2020-07-12 12:55:39 +02:00
|
|
|
use_homebrew_openssl
|
|
|
|
EOS
|
|
|
|
add_platform "darwin-amd64"
|
|
|
|
cat >> "$file" <<EOS
|
2022-07-26 14:58:34 +02:00
|
|
|
Darwin-arm64)
|
|
|
|
use_homebrew_openssl
|
|
|
|
EOS
|
|
|
|
add_platform "darwin-aarch64"
|
|
|
|
cat >> "$file" <<EOS
|
2020-07-12 12:55:39 +02:00
|
|
|
*)
|
2021-08-01 12:10:33 +02:00
|
|
|
colorize 1 "Unsupported platform: \$platform"
|
2020-07-12 12:55:39 +02:00
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
EOS
|