Commit 730a8164 by Mislav Marohnić

Use rake from the current bundle for Rubinius

Rake might not be available on the system, but if there is a Gemfile,
assume that it bundles rake.
parent eaa187b4
...@@ -699,6 +699,14 @@ build_package_verify_openssl() { ...@@ -699,6 +699,14 @@ build_package_verify_openssl() {
end' >&4 2>&1 end' >&4 2>&1
} }
rake() {
if [ -e "./Gemfile" ]; then
bundle exec rake "$@"
else
command rake "$@"
fi
}
version() { version() {
echo "ruby-build ${RUBY_BUILD_VERSION}" echo "ruby-build ${RUBY_BUILD_VERSION}"
} }
......
...@@ -13,7 +13,7 @@ setup() { ...@@ -13,7 +13,7 @@ setup() {
cached_tarball() { cached_tarball() {
mkdir -p "$RUBY_BUILD_CACHE_PATH" mkdir -p "$RUBY_BUILD_CACHE_PATH"
pushd "$RUBY_BUILD_CACHE_PATH" >/dev/null pushd "$RUBY_BUILD_CACHE_PATH" >/dev/null
tarball "$1" tarball "$@"
popd >/dev/null popd >/dev/null
} }
...@@ -21,14 +21,20 @@ tarball() { ...@@ -21,14 +21,20 @@ tarball() {
local name="$1" local name="$1"
local path="$PWD/$name" local path="$PWD/$name"
local configure="$path/configure" local configure="$path/configure"
shift 1
mkdir -p "$path" mkdir -p "$path"
cat > "$configure" <<OUT cat > "$configure" <<OUT
#!$BASH #!$BASH
echo "$name: \$@" > build.log echo "$name: \$@" >> build.log
OUT OUT
chmod +x "$configure" chmod +x "$configure"
for file; do
mkdir -p "$(dirname "${path}/${file}")"
touch "${path}/${file}"
done
tar czf "${path}.tar.gz" -C "${path%/*}" "$name" tar czf "${path}.tar.gz" -C "${path%/*}" "$name"
} }
...@@ -147,3 +153,27 @@ DEF ...@@ -147,3 +153,27 @@ DEF
assert [ -e "$INSTALL_ROOT/bin/ruby" ] assert [ -e "$INSTALL_ROOT/bin/ruby" ]
assert [ -e "$INSTALL_ROOT/bin/irb" ] assert [ -e "$INSTALL_ROOT/bin/irb" ]
} }
@test "rbx uses bundle then rake" {
cached_tarball "rubinius-2.0.0" "Gemfile"
cd "$TMP"
cat > "definition" <<DEF
install_package "rubinius-2.0.0" "http://releases.rubini.us/rubinius-2.0.0.tar.gz" rbx
DEF
stub rake false
stub bundle ' : echo bundle >> build.log' \
" exec rake install : { cat build.log; echo bundle \"\$@\"; } >> '$INSTALL_ROOT/build.log'"
run ruby-build "definition" "$INSTALL_ROOT"
assert_success
unstub bundle
assert_build_log <<OUT
bundle
rubinius-2.0.0: --prefix=$INSTALL_ROOT
bundle exec rake install
OUT
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment