Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
--- a/src/configure.in
+++ b/src/configure.in
@@ -993,11 +993,17 @@ AC_ARG_ENABLE(rubyinterp,
AC_MSG_RESULT($enable_rubyinterp)
if test "$enable_rubyinterp" = "yes"; then
AC_MSG_CHECKING(--with-ruby-command argument)
+ dnl If a ruby command was provided, set RUBY_CMD to the name of the binary and RUBY_PATH to its directory
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
- RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
- RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
+ RUBY_PATH=`echo "$withval" | sed 's/\(.*\)\/\([[[^/]]]*\)$/\1/'`; RUBY_CMD=`echo "$withval" | sed 's/.*\/\([[[^/]]]*\)$/\1/'`; AC_MSG_RESULT($RUBY_CMD),
+ RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD)
+ )
+ if test $RUBY_PATH != $RUBY_CMD; then
+ AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD, "", $RUBY_PATH)
+ else
+ AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
+ fi
AC_SUBST(vi_cv_path_ruby)
- AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
if test "X$vi_cv_path_ruby" != "X"; then
AC_MSG_CHECKING(Ruby version)
if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
@@ -1022,20 +1028,24 @@ if test "$enable_rubyinterp" = "yes"; then
librubyarg="$rubyhdrdir/$librubyarg"
else
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
- if test -d "/System/Library/Frameworks/Ruby.framework"; then
- dnl On Mac OS X it is safer to just use the -framework flag
- RUBY_LIBS="-framework Ruby"
- dnl Don't include the -I flag when -framework is set
- RUBY_CFLAGS=
- librubyarg=
- elif test -f "$rubylibdir/$librubyarg"; then
- librubyarg="$rubylibdir/$librubyarg"
- elif test "$librubyarg" = "libruby.a"; then
- dnl required on Mac OS 10.3 where libruby.a doesn't exist
- librubyarg="-lruby"
- else
- librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"`
- fi
+ if test $RUBY_PATH != $RUBY_CMD; then
+ librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, '') << %' -L#{Config.expand(Config::CONFIG[\"libdir\"])}'"`
+ else
+ if test -d "/System/Library/Frameworks/Ruby.framework"; then
+ dnl On Mac OS X it is safer to just use the -framework flag
+ RUBY_LIBS="-framework Ruby"
+ dnl Don't include the -I flag when -framework is set
+ RUBY_CFLAGS=
+ librubyarg=
+ elif test -f "$rubylibdir/$librubyarg"; then
+ librubyarg="$rubylibdir/$librubyarg"
+ elif test "$librubyarg" = "libruby.a"; then
+ dnl required on Mac OS 10.3 where libruby.a doesn't exist
+ librubyarg="-lruby"
+ else
+ librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, '') << %' -L#{Config.expand(Config::CONFIG[\"lib
+ fi
+ fi
fi
if test "X$librubyarg" != "X"; then
@mattsoutherden

This comment has been minimized.

Show comment Hide comment
@mattsoutherden

mattsoutherden Jul 20, 2010

This gist seems to have some of the lines cut off (11, 43, 57)

This gist seems to have some of the lines cut off (11, 43, 57)

@koudelka

This comment has been minimized.

Show comment Hide comment
@koudelka

koudelka Jul 20, 2010

Fixed! I was hoping the patch would have been rolled into macvim's trunk by now, guess not…

Owner

koudelka commented Jul 20, 2010

Fixed! I was hoping the patch would have been rolled into macvim's trunk by now, guess not…

@charlietanksley

This comment has been minimized.

Show comment Hide comment
@charlietanksley

charlietanksley Jul 28, 2010

I tried using this patch and my attempt failed. The error message makes it look like the one or more of the lines cut off before they should. Here is the error message, if you are interested:

patching file src/configure.in
Hunk #1 FAILED at 993.
patch unexpectedly ends in middle of line
Hunk #2 FAILED at 1028.
2 out of 2 hunks FAILED -- saving rejects to file src/configure.in.rej

(I'm trying to install it via Homebrew using the patch.)

I tried using this patch and my attempt failed. The error message makes it look like the one or more of the lines cut off before they should. Here is the error message, if you are interested:

patching file src/configure.in
Hunk #1 FAILED at 993.
patch unexpectedly ends in middle of line
Hunk #2 FAILED at 1028.
2 out of 2 hunks FAILED -- saving rejects to file src/configure.in.rej

(I'm trying to install it via Homebrew using the patch.)

@koudelka

This comment has been minimized.

Show comment Hide comment
@koudelka

koudelka Jul 28, 2010

Try grabbing my MacVim fork instead. http://github.com/koudelka/macvim

The patch should be applied to the primary repo soonish.

Owner

koudelka commented Jul 28, 2010

Try grabbing my MacVim fork instead. http://github.com/koudelka/macvim

The patch should be applied to the primary repo soonish.

@charlietanksley

This comment has been minimized.

Show comment Hide comment
@charlietanksley

charlietanksley Jul 28, 2010

Excellent. Thanks so much.

Excellent. Thanks so much.

@koudelka

This comment has been minimized.

Show comment Hide comment
@koudelka

koudelka Jul 28, 2010

Also, here're my configure args, in case you don't want to dig them all up:

./configure --with-features=huge --enable-rubyinterp --with-macsdk=10.6 --with-macarchs=x86_64 --with-ruby-command=/Users/mikes/.rvm/bin/ruby-1.9.1-p378
Owner

koudelka commented Jul 28, 2010

Also, here're my configure args, in case you don't want to dig them all up:

./configure --with-features=huge --enable-rubyinterp --with-macsdk=10.6 --with-macarchs=x86_64 --with-ruby-command=/Users/mikes/.rvm/bin/ruby-1.9.1-p378
@charlietanksley

This comment has been minimized.

Show comment Hide comment
@charlietanksley

charlietanksley Jul 28, 2010

Great. Thanks again. When you said the patch would be applied to the primary repo, did you mean that rvm ought to work with MacVim by default in the near future?

Great. Thanks again. When you said the patch would be applied to the primary repo, did you mean that rvm ought to work with MacVim by default in the near future?

@mattsoutherden

This comment has been minimized.

Show comment Hide comment
@mattsoutherden

mattsoutherden Jul 29, 2010

Ah, so does this patch only make MacVim work when specifying an RVM Ruby from the --with-ruby-command configure args?

I was hoping that when I start MacVim using the 'mvim' command, that Vim would pick up the current RVM Ruby from the environment. Is that not so?

Ah, so does this patch only make MacVim work when specifying an RVM Ruby from the --with-ruby-command configure args?

I was hoping that when I start MacVim using the 'mvim' command, that Vim would pick up the current RVM Ruby from the environment. Is that not so?

@jsmestad

This comment has been minimized.

Show comment Hide comment
@jsmestad

jsmestad Aug 7, 2010

Have the same question as mattshoutherden

jsmestad commented Aug 7, 2010

Have the same question as mattshoutherden

@koudelka

This comment has been minimized.

Show comment Hide comment
@koudelka

koudelka Aug 7, 2010

mattsoutherden is right, this is only a patch to make the configure args work correctly.

As far as I know, It doesn't provide for switching ruby executables at runtime. If you need that functionality, it might be worth experimenting with passing a symlink to the configure script, then changing where it points at runtime.

Owner

koudelka commented Aug 7, 2010

mattsoutherden is right, this is only a patch to make the configure args work correctly.

As far as I know, It doesn't provide for switching ruby executables at runtime. If you need that functionality, it might be worth experimenting with passing a symlink to the configure script, then changing where it points at runtime.

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Apr 16, 2011

Does this applies just fine for Vim 7.3.161? Or does it needs to be updated?

ghost commented Apr 16, 2011

Does this applies just fine for Vim 7.3.161? Or does it needs to be updated?

@koudelka

This comment has been minimized.

Show comment Hide comment
@koudelka

koudelka Apr 17, 2011

A similar patch was rolled into the main MacVim repo a while back, try there.

Owner

koudelka commented Apr 17, 2011

A similar patch was rolled into the main MacVim repo a while back, try there.

@danchoi

This comment has been minimized.

Show comment Hide comment
@danchoi

danchoi Jul 5, 2011

Someone pointed me to this gist, but I have no idea what problem this Gist is supposed to solve. Can someone fill me in?

danchoi commented Jul 5, 2011

Someone pointed me to this gist, but I have no idea what problem this Gist is supposed to solve. Can someone fill me in?

@koudelka

This comment has been minimized.

Show comment Hide comment
@koudelka

koudelka Jul 5, 2011

This is an old patch for macvim to get ruby working properly, an equivalent patch has been rolled into the project, afaik.

Owner

koudelka commented Jul 5, 2011

This is an old patch for macvim to get ruby working properly, an equivalent patch has been rolled into the project, afaik.

@danchoi

This comment has been minimized.

Show comment Hide comment
@danchoi

danchoi Jul 5, 2011

danchoi commented Jul 5, 2011

@koudelka

This comment has been minimized.

Show comment Hide comment
@koudelka

koudelka Jul 5, 2011

I'm not sure, the Command-T plugin used it.

Owner

koudelka commented Jul 5, 2011

I'm not sure, the Command-T plugin used it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment