Last active
January 4, 2023 22:23
-
-
Save miguelmota/33489af6d1655188869f3698020354c3 to your computer and use it in GitHub Desktop.
Homebrew golang formula example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "language/go" | |
class Cointop < Formula | |
desc "An interactive terminal based UI application for tracking cryptocurrencies" | |
homepage "https://cointop.sh" | |
url "https://github.com/miguelmota/cointop/archive/0.0.1.tar.gz" | |
sha256 "3b2b039da68c92d597ae4a6a89aab58d9741132efd514bbf5cf1a1a151b16213" | |
revision 1 | |
head "https://github.com/miguelmota/cointop.git" | |
depends_on "go" => :build | |
def install | |
ENV["GOPATH"] = buildpath | |
path = buildpath/"src/github.com/miguelmota/cointop" | |
system "go", "get", "-u", "github.com/miguelmota/cointop" | |
cd path do | |
system "go", "build", "-o", "#{bin}/cointop" | |
end | |
end | |
test do | |
system "true" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "language/go" | |
class Cointop < Formula | |
desc "An interactive terminal based UI application for tracking cryptocurrencies" | |
homepage "https://cointop.sh" | |
url "https://github.com/miguelmota/cointop/archive/0.0.1.tar.gz" | |
sha256 "3b2b039da68c92d597ae4a6a89aab58d9741132efd514bbf5cf1a1a151b16213" | |
revision 1 | |
head "https://github.com/miguelmota/cointop.git" | |
depends_on "go" => :build | |
def install | |
ENV["GOPATH"] = buildpath | |
path = buildpath/"src/github.com/miguelmota/cointop" | |
path.install Dir["*"] | |
cd path do | |
system "go", "build", "-o", "#{bin}/cointop" | |
end | |
end | |
test do | |
assert_match version.to_s, shell_output("#{bin}/cointop", "-v") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment