64 lines
2.3 KiB
Ruby
64 lines
2.3 KiB
Ruby
class Neovim < Formula
|
|
desc "Ambitious Vim-fork focused on extensibility and agility"
|
|
homepage "https://neovim.io/"
|
|
url "https://github.com/neovim/neovim/archive/v0.2.1.tar.gz"
|
|
sha256 "9e2c068a8994c9023a5f84cde9eb7188d3c85996a7e42e611e3cd0996e345dd3"
|
|
head "https://github.com/neovim/neovim.git"
|
|
|
|
bottle do
|
|
sha256 "5b2beeca891639e3d58b883cd845f1a66c75db92de0a244dad4cb4d6549c4261" => :high_sierra
|
|
sha256 "cac83c5234d836de17f9e7c255ffdbbcade53a66373cf789d171a3de9a845f0f" => :sierra
|
|
sha256 "43c71c339aaca0afc2a60a24df3335980ad3c57b669b071d56e10c9f821b85a0" => :el_capitan
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "lua@5.1" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "gettext"
|
|
depends_on "jemalloc"
|
|
depends_on "libtermkey"
|
|
depends_on "libuv"
|
|
depends_on "libvterm"
|
|
depends_on "luajit"
|
|
depends_on "msgpack"
|
|
depends_on "unibilium"
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
resource "lpeg" do
|
|
url "https://luarocks.org/manifests/gvvaughan/lpeg-1.0.1-1.src.rock", :using => :nounzip
|
|
sha256 "149be31e0155c4694f77ea7264d9b398dd134eca0d00ff03358d91a6cfb2ea9d"
|
|
end
|
|
|
|
resource "mpack" do
|
|
url "https://luarocks.org/manifests/tarruda/mpack-1.0.6-0.src.rock", :using => :nounzip
|
|
sha256 "9068d9d3f407c72a7ea18bc270b0fa90aad60a2f3099fa23d5902dd71ea4cd5f"
|
|
end
|
|
|
|
def install
|
|
resources.each do |r|
|
|
r.stage(buildpath/"deps-build/build/src/#{r.name}")
|
|
end
|
|
|
|
ENV.prepend_path "LUA_PATH", "#{buildpath}/deps-build/share/lua/5.1/?.lua"
|
|
ENV.prepend_path "LUA_CPATH", "#{buildpath}/deps-build/lib/lua/5.1/?.so"
|
|
|
|
cd "deps-build" do
|
|
system "luarocks-5.1", "build", "build/src/lpeg/lpeg-1.0.1-1.src.rock", "--tree=."
|
|
system "luarocks-5.1", "build", "build/src/mpack/mpack-1.0.6-0.src.rock", "--tree=."
|
|
system "cmake", "../third-party", "-DUSE_BUNDLED=OFF", *std_cmake_args
|
|
system "make"
|
|
end
|
|
|
|
mkdir "build" do
|
|
system "cmake", "..", *std_cmake_args
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.txt").write("Hello World from Vim!!")
|
|
system bin/"nvim", "--headless", "-i", "NONE", "-u", "NONE",
|
|
"+s/Vim/Neovim/g", "+wq", "test.txt"
|
|
assert_equal "Hello World from Neovim!!", (testpath/"test.txt").read.chomp
|
|
end
|
|
end
|