aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/macvim.rb
diff options
context:
space:
mode:
authorTim D. Smith2015-03-08 12:45:17 -0700
committerTim D. Smith2015-03-10 17:19:32 -0700
commit14fc4411c8ebea423c5cbc999af967e8e6f4d2fe (patch)
treea1eaaf580e347334ea8139b26272642c3c53fd4e /Library/Formula/macvim.rb
parentf3dfb9ef40a30a1f7c57db42d3909a664ad875d5 (diff)
downloadhomebrew-14fc4411c8ebea423c5cbc999af967e8e6f4d2fe.tar.bz2
macvim: add python framework to (c|ld)flags
MacVim assumes that it's building against a framework python and that the framework is in the compiler's and linker's framework search paths. This change means that #include <Python/Python.h> (which only works against a framework) and -framework Python can find a python other than the system python, avoiding header mixing-and-matching and avoiding the confusing double linkage in otool output. Leaving the existing python-config calls in place means that the python linkage will probably continue to work if macvim is built against a non-framework Python, though it will continue to pull in parts from the system framework. Only add the framework search path explicitly if our target Python isn't system Python, to avoid trouble on Xcode-only systems. Closes #37509.
Diffstat (limited to 'Library/Formula/macvim.rb')
-rw-r--r--Library/Formula/macvim.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/Library/Formula/macvim.rb b/Library/Formula/macvim.rb
index af25bb6d8..10945f396 100644
--- a/Library/Formula/macvim.rb
+++ b/Library/Formula/macvim.rb
@@ -1,8 +1,6 @@
-require 'formula'
-
# Reference: https://github.com/b4winckler/macvim/wiki/building
class Macvim < Formula
- homepage 'http://code.google.com/p/macvim/'
+ homepage 'https://code.google.com/p/macvim/'
url 'https://github.com/b4winckler/macvim/archive/snapshot-73.tar.gz'
version '7.4-73'
sha1 'b87e37fecb305a99bc268becca39f8854e3ff9f0'
@@ -67,6 +65,15 @@ class Macvim < Formula
elsif build.with? "python"
ENV.prepend "LDFLAGS", `python-config --ldflags`.chomp
ENV.prepend "CFLAGS", `python-config --cflags`.chomp
+ framework_script = <<-EOS.undent
+ import distutils.sysconfig
+ print distutils.sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX")
+ EOS
+ framework_prefix = `python -c '#{framework_script}'`.chuzzle
+ if framework_prefix && framework_prefix != "/System/Library/Frameworks"
+ ENV.prepend "LDFLAGS", "-F#{framework_prefix}"
+ ENV.prepend "CFLAGS", "-F#{framework_prefix}"
+ end
args << "--enable-pythoninterp"
end