├── .travis.yml ├── README.md └── macvim.rb /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | os: 4 | - osx 5 | 6 | osx_image: xcode9.2 7 | 8 | compiler: 9 | - clang 10 | 11 | sudo: false 12 | 13 | env: 14 | - VIMCMD=/usr/local/Cellar/macvim/HEAD-*/MacVim.app/Contents/MacOS/Vim 15 | 16 | script: 17 | - brew update || brew update 18 | - brew tap macvim-dev/macvim 19 | - brew install ruby 20 | - brew install --HEAD macvim-dev/macvim/macvim || true 21 | - rm -f result; $VIMCMD -g -f -c "redir>result" -c "lua print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result 22 | - rm -f result; $VIMCMD -g -f -c "redir>result" -c "perl VIM::Msg(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result 23 | - rm -f result; $VIMCMD -g -f -c "redir>result" -c "py print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result 24 | - rm -f result; $VIMCMD -g -f -c "redir>result" -c "py3 print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result 25 | - rm -f result; $VIMCMD -g -f -c "redir>result" -c "ruby puts(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result 26 | 27 | # vim:set sts=2 sw=2 tw=0 et: 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Homebrew Tap for MacVim [![Build Status](https://travis-ci.org/macvim-dev/homebrew-macvim.svg?branch=master)](https://travis-ci.org/macvim-dev/homebrew-macvim) 2 | 3 | ## Note: Deprecation 4 | 5 | This repo is currently deprecated. Homebrew Core maintains its own formula for MacVim (https://github.com/Homebrew/homebrew-core/blob/master/Formula/macvim.rb) and it is actively maintained and up to date. Consider using it in favor of this one. 6 | 7 | ## Usage 8 | 9 | ### One-time setup 10 | 11 | 1. Install Homebrew 12 | 13 | - http://brew.sh/ 14 | 15 | 2. Tap MacVim formula 16 | 17 | `$ brew tap macvim-dev/macvim` 18 | 19 | ### Install 20 | 21 | $ brew install --HEAD macvim-dev/macvim/macvim 22 | -------------------------------------------------------------------------------- /macvim.rb: -------------------------------------------------------------------------------- 1 | require 'formula' 2 | 3 | class Macvim < Formula 4 | desc 'GUI for vim, made for OS X' 5 | homepage 'https://github.com/macvim-dev/macvim' 6 | head 'https://github.com/macvim-dev/macvim.git' 7 | 8 | option 'with-properly-linked-python2-python3', 'Link with properly linked Python 2 and Python 3. You will get deadly signal SEGV if you don\'t have properly linked Python 2 and Python 3.' 9 | 10 | depends_on 'gettext' => :build 11 | depends_on 'lua' => :build 12 | depends_on 'python3' => :build 13 | 14 | def get_path(name) 15 | f = Formulary.factory(name) 16 | if f.rack.directory? 17 | kegs = f.rack.subdirs.map { |keg| Keg.new(keg) }.sort_by(&:version) 18 | return kegs.last.to_s unless kegs.empty? 19 | end 20 | nil 21 | end 22 | 23 | def install 24 | perl_version = '5.16' 25 | ENV.append 'VERSIONER_PERL_VERSION', perl_version 26 | ENV.append 'VERSIONER_PYTHON_VERSION', '2.7' 27 | ENV.append 'vi_cv_path_python3', "#{HOMEBREW_PREFIX}/bin/python3" 28 | ENV.append 'vi_cv_path_plain_lua', "#{HOMEBREW_PREFIX}/bin/lua" 29 | ENV.append 'vi_cv_dll_name_perl', "/System/Library/Perl/#{perl_version}/darwin-thread-multi-2level/CORE/libperl.dylib" 30 | ENV.append 'vi_cv_dll_name_python3', "#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/3.7/Python" 31 | 32 | opts = [] 33 | if build.with? 'properly-linked-python2-python3' 34 | opts << '--with-properly-linked-python2-python3' 35 | end 36 | 37 | system './configure', "--prefix=#{prefix}", 38 | '--with-features=huge', 39 | '--enable-multibyte', 40 | '--enable-terminal', 41 | '--enable-netbeans', 42 | '--with-tlib=ncurses', 43 | '--enable-cscope', 44 | '--enable-termtruecolor', 45 | '--enable-perlinterp=dynamic', 46 | '--enable-pythoninterp=dynamic', 47 | '--enable-python3interp=dynamic', 48 | '--enable-rubyinterp=dynamic', 49 | '--enable-luainterp=dynamic', 50 | "--with-lua-prefix=#{HOMEBREW_PREFIX}", 51 | *opts 52 | 53 | system 'make' 54 | 55 | apppath = 'src/MacVim/build/Release/MacVim.app' 56 | 57 | instance_variable_set("@gettext", get_path("gettext")) 58 | system "PATH=#{@gettext}/bin:$PATH " + 59 | "MSGFMT=#{@gettext}/bin/msgfmt " + 60 | 'INSTALL_DATA=install ' + 61 | 'FILEMOD=644 ' + 62 | "LOCALEDIR=../../#{apppath}/Contents/Resources/vim/runtime/lang " + 63 | 'make -C src/po install' 64 | 65 | prefix.install apppath 66 | 67 | appbin = prefix + "MacVim.app/Contents/bin" 68 | bin = prefix + 'bin' 69 | mkdir_p bin 70 | 71 | [ 72 | 'vim', 'vimdiff', 'view', 73 | 'gvim', 'gvimdiff', 'gview', 74 | 'mvim', 'mvimdiff', 'mview' 75 | ].each do |t| 76 | ln_s '../MacVim.app/Contents/bin/mvim', bin + t 77 | end 78 | end 79 | 80 | test do 81 | (testpath/'a').write 'hai' 82 | (testpath/'b').write 'bai' 83 | system bin/'vimdiff', 'a', 'b', 84 | '-c', 'FormatCommand diffformat', 85 | '-c', 'w! diff.html', '-c', 'qa!' 86 | File.exist? 'diff.html' 87 | end 88 | end 89 | --------------------------------------------------------------------------------