2016-09-08 18:02:47 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Micro < Formula
|
|
|
|
desc "Modern and intuitive terminal-based text editor"
|
|
|
|
homepage "https://github.com/zyedidia/micro"
|
|
|
|
url "https://github.com/zyedidia/micro.git",
|
2016-10-10 22:53:21 +00:00
|
|
|
:tag => "v1.1.1",
|
|
|
|
:revision => "b09093f78c1632a7a55225d2b5692f7dcc329a67"
|
2016-09-08 18:02:47 +00:00
|
|
|
head "https://github.com/zyedidia/micro.git"
|
|
|
|
|
2016-09-09 14:54:22 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-10-11 15:05:38 +00:00
|
|
|
sha256 "74ac83d7dfc205de112422879b7eec9d42074ddfdff2c294e9a51b4dcb82a6ef" => :sierra
|
|
|
|
sha256 "c0e01b2deed511bfed74bddf0469b65cfb420ccbe00136a1aca5111412c81d01" => :el_capitan
|
|
|
|
sha256 "2f0f8035cdbe2613b51943d19cf52fcf5c348cce1ec799546f8e337a103cb4c6" => :yosemite
|
2016-09-09 14:54:22 +00:00
|
|
|
end
|
|
|
|
|
2016-09-08 18:02:47 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
2016-10-07 01:27:23 +00:00
|
|
|
go_resource "github.com/blang/semver" do
|
|
|
|
url "https://github.com/blang/semver.git",
|
|
|
|
:revision => "60ec3488bfea7cca02b021d106d9911120d25fe9"
|
|
|
|
end
|
|
|
|
|
2016-09-08 18:02:47 +00:00
|
|
|
go_resource "github.com/gdamore/encoding" do
|
|
|
|
url "https://github.com/gdamore/encoding.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "b23993cbb6353f0e6aa98d0ee318a34728f628b9"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/go-errors/errors" do
|
|
|
|
url "https://github.com/go-errors/errors.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "a41850380601eeb43f4350f7d17c6bbd8944aaf8"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/layeh/gopher-luar" do
|
|
|
|
url "https://github.com/layeh/gopher-luar.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "921d03e21a7844141b02d4c729269b6709762f28"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/lucasb-eyer/go-colorful" do
|
|
|
|
url "https://github.com/lucasb-eyer/go-colorful.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "9c2852a141bf4711e4276f8f119c90d0f20a556c"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/mattn/go-isatty" do
|
|
|
|
url "https://github.com/mattn/go-isatty.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/mattn/go-runewidth" do
|
|
|
|
url "https://github.com/mattn/go-runewidth.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "d6bea18f789704b5f83375793155289da36a3c7f"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/mitchellh/go-homedir" do
|
|
|
|
url "https://github.com/mitchellh/go-homedir.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "756f7b183b7ab78acdbbee5c7f392838ed459dda"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/sergi/go-diff" do
|
|
|
|
url "https://github.com/sergi/go-diff.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "ec7fdbb58eb3e300c8595ad5ac74a5aa50019cc7"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/yuin/gopher-lua" do
|
|
|
|
url "https://github.com/yuin/gopher-lua.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "6a1397dfb6f8e7af08496129dd96f5f62c148f47"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/zyedidia/clipboard" do
|
|
|
|
url "https://github.com/zyedidia/clipboard.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "72497670a7bd47eb648153f55bea83852546abe0"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/zyedidia/glob" do
|
|
|
|
url "https://github.com/zyedidia/glob.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "7cf5a078d22fc41b27fbda73685c88a3f2c6fe28"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
2016-10-07 01:27:23 +00:00
|
|
|
go_resource "github.com/zyedidia/json5" do
|
|
|
|
url "https://github.com/zyedidia/json5.git",
|
|
|
|
:revision => "2518f8beebde6814f2d30d566260480d2ded2f76"
|
|
|
|
end
|
|
|
|
|
2016-09-08 18:02:47 +00:00
|
|
|
go_resource "github.com/zyedidia/tcell" do
|
|
|
|
url "https://github.com/zyedidia/tcell.git",
|
2016-10-07 01:27:23 +00:00
|
|
|
:revision => "2cdfb9030fb6b921fb1c8679219f881fd0824947"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "golang.org/x/text" do
|
|
|
|
url "https://go.googlesource.com/text.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "ceefd2213ed29504fff30155163c8f59827734f3"
|
2016-09-08 18:02:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
mkdir_p buildpath/"src/github.com/zyedidia"
|
|
|
|
ln_s buildpath, buildpath/"src/github.com/zyedidia/micro"
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
hash = `git rev-parse --short HEAD`.chomp
|
|
|
|
date = `go run tools/build-date.go`.chomp
|
|
|
|
system "go", "build", "-o", bin/"micro", "-ldflags", <<-EOS.undent, "./cmd/micro"
|
|
|
|
-X main.Version=#{version}
|
|
|
|
-X main.CommitHash=#{hash}
|
|
|
|
-X 'main.CompileDate=#{date}'
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
assert_match version.to_s, shell_output("#{bin}/micro -version")
|
|
|
|
end
|
|
|
|
end
|