diff options
| author | Felix Bùˆnemann | 2013-10-23 10:38:41 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2013-10-23 12:05:48 +0100 |
| commit | 41d80fb4e81d98ad54e4e899f3044b0c6a83a4e6 (patch) | |
| tree | 3619e4ecb83c943082b7a770ae95e6ff0d452113 /Library/Formula | |
| parent | 99f75182a17912dd322caca3e8df2afad3fa83d4 (diff) | |
| download | homebrew-41d80fb4e81d98ad54e4e899f3044b0c6a83a4e6.tar.bz2 | |
macvim: fix compilation on 10.9.
On Mavericks we need to explicitly include AvailabilityMacros.h to have
the version detection macros defined.
Fix 10.9 ruby framework detection and compilation
Mavericks ships with version 1.8 and 2.0 of the Ruby.framework, so we
must directly link the framework version matching the ruby-command.
This also means that ruby.h must no longer included via the framework
name, which has the nice side effect of allowing you to compile with
non-framework rubies, if you remove the formula's hardcoded RUBY_PATH.
For macvim-HEAD we use the current framework's ruby command because it
only works with that and is incompatible with our patches.
Closes #20473.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/macvim.rb | 62 |
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. + * |
