diff --git a/bin/ruby-build b/bin/ruby-build index 48316ebc95..8e00ad29c9 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -677,14 +677,11 @@ build_package_rbx() { } build_package_mruby() { - local package_name="$1" - - { rake + { ./minirake mkdir -p "$PREFIX_PATH" - cp -fR build/host/* "$PREFIX_PATH" - cd "$PREFIX_PATH/bin" - ln -fs mruby ruby - ln -fs mirb irb + cp -fR build/host/* include "$PREFIX_PATH" + ln -fs mruby "$PREFIX_PATH/bin/ruby" + ln -fs mirb "$PREFIX_PATH/bin/irb" } >&4 2>&1 } diff --git a/test/build.bats b/test/build.bats index 50dbb98035..cf41c4f79a 100755 --- a/test/build.bats +++ b/test/build.bats @@ -455,41 +455,41 @@ OUT assert_success "hello world" } -@test "mruby strategy overwrites non-writable files" { - cached_tarball "mruby-1.0" build/host/bin/{mruby,mirb} +@test "mruby strategy" { + package="$TMP/mruby-1.0" + executable "$package/minirake" <> '$INSTALL_ROOT'/build.log +mkdir -p build/host/bin +touch build/host/bin/{mruby,mirb} +chmod +x build/host/bin/{mruby,mirb} +OUT + mkdir -p "$package/include" + touch "$package/include/mruby.h" + mkdir -p "$RUBY_BUILD_CACHE_PATH" + tar czf "$RUBY_BUILD_CACHE_PATH/${package##*/}.tar.gz" -C "${package%/*}" "${package##*/}" + rm -rf "$package" + + stub gem false + stub rake false mkdir -p "$INSTALL_ROOT/bin" touch "$INSTALL_ROOT/bin/mruby" chmod -w "$INSTALL_ROOT/bin/mruby" - stub gem false - stub rake '--version : echo 1' true - run_inline_definition <