We're developing runscripts and try to support something like brew install runscripts
.
It's written in golang and have some dependencies which required to go get
. Now I have no idea to write the Formula to setup GOPATH and run go get
. Our project can be compiled into an binary but we need run --init
to install it.
Can anyone helps to give an example about a homebrew Formula of go project?
Fork homebrew, look at the content of Library/Formula/consul.rb. You don't need to manually generate all the resources. Use homebrew-go-resources. A more complete intro could be found here.
I have refer to termshare.rb and it seems we can simply go get
and homebrew will handle anything about GOPATH
for us.
That's great and I think my problem is solved.
The best I could find is how docker-swarm
is added to brew: https://github.com/Homebrew/homebrew/blob/4c6857b0e337b2d5afd49dcf7209b6b5091709f4/Library/Formula/docker-swarm.rb
It's relatively clean and simple to follow.
You can use goreleaser to generate the formula automatically: https://goreleaser.com/customization/homebrew/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With