aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/vim.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/vim.rb')
-rw-r--r--Library/Formula/vim.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Formula/vim.rb b/Library/Formula/vim.rb
index 25cd93738..319ed3286 100644
--- a/Library/Formula/vim.rb
+++ b/Library/Formula/vim.rb
@@ -92,4 +92,20 @@ class Vim < Formula
system "make", "install", "prefix=#{prefix}", "STRIP=true"
bin.install_symlink "vim" => "vi" if build.include? "override-system-vi"
end
+
+ test do
+ # Simple test to check if Vim was linked to Python version in $PATH
+ if build.with? "python"
+ vim_path = bin/"vim"
+
+ # Get linked framework using otool
+ otool_output = `otool -L #{vim_path} | grep -m 1 Python`.gsub(/\(.*\)/, "").strip.chomp
+
+ # Expand the link and get the python exec path
+ vim_framework_path = Pathname.new(otool_output).realpath.dirname.to_s.chomp
+ system_framework_path = `python-config --exec-prefix`.chomp
+
+ assert_equal system_framework_path, vim_framework_path
+ end
+ end
end