homebrew-core/Formula/immortal.rb
2018-08-24 08:58:23 +02:00

38 lines
1.5 KiB
Ruby

class Immortal < Formula
desc "OS agnostic (*nix) cross-platform supervisor"
homepage "https://immortal.run/"
url "https://github.com/immortal/immortal/archive/0.20.0.tar.gz"
sha256 "729c08265bcb93996215cc64af16155651f8355cd1c571077576d923740f0613"
head "https://github.com/immortal/immortal.git"
bottle do
cellar :any_skip_relocation
sha256 "b8f62dd8a76c4597cf35c00b0ac322f8463be2b2918094fc997932f1b8aae9a0" => :mojave
sha256 "1798dbf2f4030b312903b768ba308c1e2b4cc77e927fd77b25eec7346ce62654" => :high_sierra
sha256 "09a9e753d342cd5b42aacd9784e98d693d233ae8de5029abdb625216d31f24bf" => :sierra
sha256 "415c779202d33ea45bac3eb387b75fe672482c54b8c3e969e63348f668d82973" => :el_capitan
end
depends_on "dep" => :build
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/immortal/immortal").install buildpath.children
cd "src/github.com/immortal/immortal" do
system "dep", "ensure", "-vendor-only"
ldflags = "-s -w -X main.version=#{version}"
system "go", "build", "-ldflags", ldflags, "-o", "#{bin}/immortal", "cmd/immortal/main.go"
system "go", "build", "-ldflags", ldflags, "-o", "#{bin}/immortalctl", "cmd/immortalctl/main.go"
system "go", "build", "-ldflags", ldflags, "-o", "#{bin}/immortaldir", "cmd/immortaldir/main.go"
man8.install Dir["man/*.8"]
prefix.install_metafiles
end
end
test do
system bin/"immortal", "-v"
system bin/"immortalctl", "-v"
system bin/"immortaldir", "-v"
end
end