Skip to content

Commit

Permalink
Modify formula to sync with homebrew core, and change python to 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
markwu committed Mar 31, 2022
1 parent 3ce3dbb commit b89c8bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
16 changes: 11 additions & 5 deletions Formula/macvim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
class Macvim < Formula
desc "GUI for vim, made for macOS"
homepage "https://github.com/macvim-dev/macvim"
head "https://github.com/macvim-dev/macvim.git"
head "https://github.com/macvim-dev/macvim.git", branch: "master"

depends_on :xcode => :build
depends_on xcode: :build
depends_on "cscope"
depends_on "gettext"
depends_on "lua"
depends_on "[email protected]"
depends_on :macos
depends_on "[email protected]"
depends_on "ruby"

def install
Expand All @@ -34,10 +36,13 @@ def install
"--with-lua-prefix=#{Formula["lua"].opt_prefix}",
"--enable-luainterp",
"--enable-python3interp",
"--disable-sparkle"
"--disable-sparkle",
"--with-macarchs=#{Hardware::CPU.arch}"
system "make"

prefix.install "src/MacVim/build/Release/MacVim.app"
# Remove autoupdating universal binaries
(prefix/"MacVim.app/Contents/Frameworks/Sparkle.framework").rmtree
bin.install_symlink prefix/"MacVim.app/Contents/bin/mvim"

# Create MacVim vimdiff, view, ex equivalents
Expand All @@ -48,9 +53,10 @@ def install
test do
output = shell_output("#{bin}/mvim --version")
assert_match "+ruby", output
assert_match "+gettext", output

# Simple test to check if MacVim was linked to Homebrew's Python 3
py3_exec_prefix = Utils.popen_read(Formula["python@3.8"].opt_bin/"python3-config", "--exec-prefix")
py3_exec_prefix = shell_output(Formula["python@3.9"].opt_bin/"python3-config --exec-prefix")
assert_match py3_exec_prefix.chomp, output
(testpath/"commands.vim").write <<~EOS
:python3 import vim; vim.current.buffer[0] = 'hello python3'
Expand Down
11 changes: 5 additions & 6 deletions Formula/vim.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
class Vim < Formula
desc "Vi 'workalike' with many additional features"
homepage "https://www.vim.org/"
head "https://github.com/vim/vim.git"
head "https://github.com/vim/vim.git", branch: "master"

depends_on "gettext"
depends_on "lua"
depends_on "ncurses"
depends_on "perl"
depends_on "python@3.8"
depends_on "python@3.9"
depends_on "ruby"

uses_from_macos "ncurses"

def install
ENV.prepend_path "PATH", Formula["python@3.8"].opt_libexec/"bin"
ENV.prepend_path "PATH", Formula["python@3.9"].opt_libexec/"bin"

# https://github.com/Homebrew/homebrew-core/pull/1046
ENV.delete("SDKROOT")
Expand All @@ -30,9 +29,9 @@ def install
"--mandir=#{man}",
"--enable-multibyte",
"--with-tlib=ncurses",
"--with-compiledby=Homebrew",
"--enable-cscope",
"--enable-terminal",
"--with-compiledby=Homebrew",
"--enable-perlinterp",
"--enable-rubyinterp",
"--enable-python3interp",
Expand Down

0 comments on commit b89c8bb

Please sign in to comment.