Commit dbd8c71d authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

Fix Rubinius gem binstubs path

Rubinius 2 insists that it installs RubyGems binstubs into
`PREFIX/gems/bin` instead of `PREFIX/bin`.

This creates complexity for rbenv rehash and exec processes, so we
symlink `gems/bin` into `bin` and have RubyGems create binstubs at a
location that is consistent with other Ruby implementations.

See sstephenson/rbenv#178, sstephenson/rbenv#461
parent 90cbc717
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -431,6 +431,7 @@ build_package_rbx() {
  { bundle
    ./configure --prefix="$PREFIX_PATH" $RUBY_CONFIGURE_OPTS
    rake install
    fix_rbx_gem_binstubs "$PREFIX_PATH"
  } >&4 2>&1
}

@@ -516,6 +517,20 @@ fix_directory_permissions() {
  find "$PREFIX_PATH" -type d \( -perm -020 -o -perm -002 \) -exec chmod go-w {} \;
}

fix_rbx_gem_binstubs() {
  local prefix="$1"
  local gemdir="${prefix}/gems/bin"
  local bindir="${prefix}/bin"
  # Symlink Rubinius' `gems/bin/` into `bin/`
  if [ -d "$gemdir" ]; then
    for file in "$gemdir"/*; do
      [ -x "$file" ] && mv "$file" "$bindir"
    done
    rm -rf "$gemdir"
    ln -s ../bin "$gemdir"
  fi
}

require_gcc() {
  local gcc="$(locate_gcc || true)"