aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/macvim.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/macvim.rb')
-rw-r--r--Library/Formula/macvim.rb62
1 files changed, 61 insertions, 1 deletions
diff --git a/Library/Formula/macvim.rb b/Library/Formula/macvim.rb
index cc60dacb7..ec6016ec8 100644
--- a/Library/Formula/macvim.rb
+++ b/Library/Formula/macvim.rb
@@ -22,6 +22,14 @@ class Macvim < Formula
env :std if MacOS.version <= :snow_leopard
# Help us! We'd like to use superenv in these environments too
+ # Mavericks Patches:
+ # * Fix Ruby.framework detection on OS X 10.9
+ # * Allow building against specific Ruby.framework version matcing ruby-command
+ # * Add missing version macros include for 10.9
+ def patches
+ DATA unless build.head?
+ end
+
def install
# Set ARCHFLAGS so the Python app (with C extension) that is
# used to create the custom icons will not try to compile in
@@ -31,6 +39,9 @@ class Macvim < Formula
# If building for 10.7 or up, make sure that CC is set to "clang".
ENV.clang if MacOS.version >= :lion
+ # macvim HEAD only works with the current Ruby.framework because it builds with -framework Ruby
+ system_ruby = build.head? ? "/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby" : RUBY_PATH
+
args = %W[
--with-features=huge
--enable-multibyte
@@ -38,7 +49,7 @@ class Macvim < Formula
--enable-perlinterp
--enable-rubyinterp
--enable-tclinterp
- --with-ruby-command=#{RUBY_PATH}
+ --with-ruby-command=#{system_ruby}
--with-tlib=ncurses
--with-compiledby=Homebrew
--with-local-dir=#{HOMEBREW_PREFIX}
@@ -116,3 +127,52 @@ class Macvim < Formula
EOS
end
end
+
+__END__
+diff --git a/src/auto/configure b/src/auto/configure
+index 4fd7b82..08af7f3 100755
+--- a/src/auto/configure
++++ b/src/auto/configure
+@@ -7206,8 +7208,9 @@ echo "${ECHO_T}$rubyhdrdir" >&6; }
+ librubyarg="$librubyarg"
+ RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
+ elif test -d "/System/Library/Frameworks/Ruby.framework"; then
+- RUBY_LIBS="-framework Ruby"
+- RUBY_CFLAGS=
++ ruby_fw_ver=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'][0,3]"`
++ RUBY_LIBS="/System/Library/Frameworks/Ruby.framework/Versions/$ruby_fw_ver/Ruby"
++ RUBY_CFLAGS="-I/System/Library/Frameworks/Ruby.framework/Versions/$ruby_fw_ver/Headers -DRUBY_VERSION=$rubyversion"
+ librubyarg=
+ fi
+
+diff --git a/src/if_ruby.c b/src/if_ruby.c
+index 4436e06..44fd5ee 100644
+--- a/src/if_ruby.c
++++ b/src/if_ruby.c
+@@ -96,11 +96,7 @@
+ # define rb_num2int rb_num2int_stub
+ #endif
+
+-#ifdef FEAT_GUI_MACVIM
+-# include <Ruby/ruby.h>
+-#else
+-# include <ruby.h>
+-#endif
++#include <ruby.h>
+ #ifdef RUBY19_OR_LATER
+ # include <ruby/encoding.h>
+ #endif
+diff --git a/src/os_mac.h b/src/os_mac.h
+index 78b79c2..54009ab 100644
+--- a/src/os_mac.h
++++ b/src/os_mac.h
+@@ -16,6 +16,9 @@
+ # define OPAQUE_TOOLBOX_STRUCTS 0
+ #endif
+
++/* Include MAC_OS_X_VERSION_* macros */
++#include <AvailabilityMacros.h>
++
+ /*
+ * Macintosh machine-dependent things.
+ *