Last active
January 28, 2022 17:43
-
-
Save ake-persson/ca29cca70f0b458aee4d to your computer and use it in GitHub Desktop.
Revisions
-
Michael Persson revised this gist
Jun 5, 2015 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ # Homebrew Formula for a Go app These are quick notes from making my own Formula and Tap. ## Add go build script to your Git repo **gobuild.sh** @@ -88,9 +90,6 @@ Add your formula to the root of the repo. After this you can use it like: *The "name" should not include "homebrew-" which is a prefix* ```bash brew tap mickep76/funk-gnarge brew install mickep76/funk-gnarge/tf ``` -
Michael Persson revised this gist
Jun 5, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -85,7 +85,7 @@ Create a Git repo called "homebrew-something". Add your formula to the root of the repo. After this you can use it like: *The "name" should not include "homebrew-" which is a prefix* ```bash brew tap <user>/<name> -
Michael Persson revised this gist
Jun 5, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -85,7 +85,7 @@ Create a Git repo called "homebrew-something". Add your formula to the root of the repo. After this you can use it like: *The "name" should not include "-homebrew" which is a prefix* ```bash brew tap <user>/<name> -
Michael Persson revised this gist
Jun 5, 2015 . 1 changed file with 17 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -77,4 +77,20 @@ HOMEBREW_MAKE_JOBS=1 brew install -v tf ## Github pull request [Github pull request](https://help.github.com/articles/using-pull-requests/) ## Make your own Tap Create a Git repo called "homebrew-something". Add your formula to the root of the repo. After this you can use it like: *The <name> should not include "-homebrew" which is a prefix* ```bash brew tap <user>/<name> brew install <user>/<name>/<formula> ``` -
Michael Persson revised this gist
Jun 5, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ brew update ## Create Formula skel ```bash brew create 'https://github.com/mickep76/tf/archive/0.2.tar.gz' ``` ## Modify Formula @@ -66,15 +66,15 @@ end ## Audit Formula ```bash brew audit --strict tf ``` ## Test local install ```bash HOMEBREW_MAKE_JOBS=1 brew install -v tf ``` ## Github pull request [Github pull request](https://help.github.com/articles/using-pull-requests/) -
Michael Persson revised this gist
Jun 5, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Homebrew Formula for a Go app ## Add go build script to your Git repo @@ -44,7 +44,7 @@ brew update **/usr/local/Library/Formula/tf.rb** ``` class Tf < Formula homepage "https://github.com/mickep76/tf" url "https://github.com/mickep76/tf/archive/0.2.tar.gz" -
Michael Persson revised this gist
Jun 5, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ set -eux export GOPATH="$(pwd)/.gobuild" SRCDIR="${GOPATH}/src/github.com/mickep76/tf" [ -d ${GOPATH} ] && rm -rf ${GOPATH} mkdir -p ${GOPATH}/{src,pkg,bin} mkdir -p ${SRCDIR} cp tf.go ${SRCDIR} -
Michael Persson created this gist
Jun 5, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,80 @@ # Create Homebrew Formula for a Go application ## Add go build script to your Git repo **gobuild.sh** ```bash #!/bin/bash set -eux export GOPATH="$(pwd)/.gobuild" SRCDIR="${GOPATH}/src/github.com/mickep76/tf" [ -d ${TMPDIR} ] && rm -rf ${TMPDIR} mkdir -p ${GOPATH}/{src,pkg,bin} mkdir -p ${SRCDIR} cp tf.go ${SRCDIR} ( echo ${GOPATH} cd ${SRCDIR} go get . go install . ) ``` ## Create tar.gz You can do this by tagging your Github repository with a version. ## Update Brew ```bash brew update ``` ## Create Formula skel ```bash # brew create 'https://github.com/mickep76/tf/archive/0.2.tar.gz' ``` ## Modify Formula **/usr/local/Library/Formula/tf.rb** ```bash class Tf < Formula homepage "https://github.com/mickep76/tf" url "https://github.com/mickep76/tf/archive/0.2.tar.gz" sha256 "b59730cfbc3c62027bd91942c70d3d07c2bbc4f82b0332d17da977bb7f2041bc" depends_on "go" => :build def install system "gobuild.sh" bin.install ".gobuild/bin/tf" => "tf" end test do system "#{bin}/tf", "--help" end end ``` ## Audit Formula ```bash # brew audit --strict tf ``` ## Test local install ```bash # HOMEBREW_MAKE_JOBS=1 brew install -v tf ``` ## Github pull request [Github pull request](https://help.github.com/articles/using-pull-requests/)