Skip to content

Commit dcdccd7

Browse files
chrisseatonmislav
authored andcommitted
Add support for JRuby 9000 bundled with the Graal VM
JRuby 9000 (the next major release) includes a backend that supports a new JVM JIT compiler called Graal. Graal is based on OpenJDK but hasn't been released yet. http://openjdk.java.net/projects/graal/
1 parent 7710db5 commit dcdccd7

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

bin/ruby-build

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,29 @@ build_package_jruby() {
519519
fix_jruby_shebangs
520520
}
521521

522+
graal_architecture() {
523+
if [ "$(uname -m)" != "x86_64" ]; then
524+
echo "no nightly builds available" >&2
525+
exit 1
526+
fi
527+
528+
case "$(uname -s)" in
529+
"Darwin") echo "macosx-x86_64";;
530+
"Linux") echo "linux-x86_64";;
531+
*)
532+
echo "no nightly builds available" >&2
533+
exit 1;;
534+
esac
535+
}
536+
522537
install_jruby_launcher() {
523-
cd "${PREFIX_PATH}/bin"
524-
{ ./ruby gem install jruby-launcher
525-
} >&4 2>&1
538+
# If this version of JRuby has been modified for Graal, don't overwrite the
539+
# launcher scripts
540+
if ! grep -q graalvm "${PREFIX_PATH}/bin/jruby"; then
541+
cd "${PREFIX_PATH}/bin"
542+
{ ./ruby gem install jruby-launcher
543+
} >&4 2>&1
544+
fi
526545
}
527546

528547
fix_jruby_shebangs() {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install_package "jruby-9000.dev" "http://lafo.ssw.uni-linz.ac.at/graalvm/jruby-dist-9000+graal-$(graal_architecture).dev-bin.tar.gz" jruby

0 commit comments

Comments
 (0)