Skip to content

Commit

Permalink
[Truffle] Update binary builder for new versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Nov 18, 2014
1 parent 8a7ae41 commit aced7b5
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tool/build-graal-bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,30 @@

# Run in the root directory. Run -Pdist first.

#version=`cat VERSION`
version_file=9.0.0.0.dev
version_dir=9.0.0.0.dev-SNAPSHOT
version=`cat VERSION`

tar -zxf maven/jruby-dist/target/jruby-dist-$version_file-bin.tar.gz || exit $?
tar -zxf maven/jruby-dist/target/jruby-dist-$version-bin.tar.gz || exit $?

# Remove files we aren't going to patch so people don't use them by mistake

rm jruby-$version_dir/bin/*.bat jruby-$version_dir/bin/*.sh jruby-$version_dir/bin/*.bash jruby-$version_dir/bin/*.exe jruby-$version_dir/bin/*.dll || exit $?
rm jruby-$version/bin/*.bat jruby-$version/bin/*.sh jruby-$version/bin/*.bash jruby-$version/bin/*.exe jruby-$version/bin/*.dll || exit $?

# Patch the jruby bash script to set JAVACMD and JRUBY_OPTS

sed -i.backup 's|if \[ -z "\$JAVACMD" \] ; then|# Modifications for distribution with Graal\
JAVACMD=\"\$JRUBY_HOME/graalvm-jdk1.8.0/bin/java\"\
JRUBY_OPTS=\"-J-server -J-d64 \$JRUBY_OPTS\"\
\
if [ -z "$JAVACMD" ] ; then|' jruby-$version_dir/bin/jruby || exit $?
if [ -z "$JAVACMD" ] ; then|' jruby-$version/bin/jruby || exit $?

if diff jruby-$version_dir/bin/jruby jruby-$version_dir/bin/jruby.backup >/dev/null ; then
if diff jruby-$version/bin/jruby jruby-$version/bin/jruby.backup >/dev/null ; then
echo "patch didn't work"
exit 1
fi

rm jruby-$version_dir/bin/jruby.backup || exit $?
rm jruby-$version/bin/jruby.backup || exit $?

chmod +x jruby-$version_dir/bin/jruby || exit $?
chmod +x jruby-$version/bin/jruby || exit $?

function pack {
# $1 ... platform (linux, ...)
Expand All @@ -54,10 +52,10 @@ function pack {

tar -zxf $buildname || exit $?
chmod -R +w graalvm-jdk1.8.0
cp -r graalvm-jdk1.8.0 jruby-$version_dir || exit $?
rm -rf jruby-$version_dir/graalvm-jdk1.8.0/src.zip jruby-$version_dir/graalvm-jdk1.8.0/demo jruby-$version_dir/graalvm-jdk1.8.0/include jruby-$version_dir/graalvm-jdk1.8.0/sample || exit $?
targetname=jruby-dist-$version_file+graal-$1-x86_64-bin.tar.gz
tar -zcf $targetname jruby-$version_dir || exit $?
cp -r graalvm-jdk1.8.0 jruby-$version || exit $?
rm -rf jruby-$version/graalvm-jdk1.8.0/src.zip jruby-$version/graalvm-jdk1.8.0/demo jruby-$version/graalvm-jdk1.8.0/include jruby-$version/graalvm-jdk1.8.0/sample || exit $?
targetname=jruby-dist-$version+graal-$1-x86_64-bin.tar.gz
tar -zcf $targetname jruby-$version || exit $?
shasum -a 1 $targetname > $targetname.sha1 || exit $?
}

Expand Down

0 comments on commit aced7b5

Please sign in to comment.