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-09-19 14:51:00 +02:00
|
|
|
basename="truffleruby-jvm-${version}-${platform}.tar.gz"
|
|
|
|
url="https://github.com/oracle/truffleruby/releases/download/graal-${version}/${basename}"
|
2020-07-12 12:55:39 +02:00
|
|
|
sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1)
|
|
|
|
|
|
|
|
cat >> "$file" <<EOS
|
2023-09-19 14:51:00 +02:00
|
|
|
install_package "truffleruby+graalvm-${version}" "${url}#${sha256}" truffleruby
|
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
|
2023-09-19 14:51:00 +02:00
|
|
|
add_platform "linux-amd64"
|
2020-07-12 12:55:39 +02:00
|
|
|
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
|
|
|
EOS
|
2023-09-19 14:51:00 +02:00
|
|
|
add_platform "macos-amd64"
|
2020-07-12 12:55:39 +02:00
|
|
|
cat >> "$file" <<EOS
|
2022-07-26 14:58:34 +02:00
|
|
|
Darwin-arm64)
|
|
|
|
EOS
|
2023-06-14 00:10:48 +02:00
|
|
|
add_platform "macos-aarch64"
|
2022-07-26 14:58:34 +02:00
|
|
|
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
|