Skip to content

Commit 747d797

Browse files
committed
Merge branch 'graal'
Closes rbenv#514
2 parents b1f3b10 + ea481d2 commit 747d797

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-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

test/build.bats

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,22 @@ nice gem things
421421
OUT
422422
}
423423

424+
@test "JRuby+Graal does not install launchers" {
425+
executable "${RUBY_BUILD_CACHE_PATH}/jruby-9000.dev/bin/jruby" <<OUT
426+
#!${BASH}
427+
# graalvm
428+
echo jruby "\$@" >> ../build.log
429+
OUT
430+
cached_tarball "jruby-9000.dev"
431+
432+
run_inline_definition <<DEF
433+
install_package "jruby-9000.dev" "http://lafo.ssw.uni-linz.ac.at/jruby-9000+graal-macosx-x86_64.tar.gz" jruby
434+
DEF
435+
assert_success
436+
437+
assert [ ! -e "$INSTALL_ROOT/build.log" ]
438+
}
439+
424440
@test "JRuby Java 7 missing" {
425441
cached_tarball "jruby-9000.dev" bin/jruby
426442

0 commit comments

Comments
 (0)