frangipanni icon indicating copy to clipboard operation
frangipanni copied to clipboard

Add - Build on M1 Mac and Homebrew

Open bdmorin opened this issue 2 years ago • 0 comments

I wanted to try this out, but had a bunch of issues, here's how I resolved them.

Default jp package for homebrew isn't JMSEPath.

brew remove jp
brew tap jmespath/jmespath
brew install jmespath/jmespath/jp 

I had to add darwn/arm64 to build.sh

❯ git diff build.sh
diff --git a/build.sh b/build.sh
index 96b2d09..030a3e3 100755
--- a/build.sh
+++ b/build.sh
@@ -33,7 +33,7 @@ for arch in 386 arm64 amd64
 do
   linux_compile "$arch"
 done
-for dist in windows/amd64 windows/386 darwin/amd64 freebsd/amd64 js/wasm netbsd/amd64 openbsd/amd64
+for dist in windows/amd64 windows/386 darwin/arm64 darwin/amd64 freebsd/amd64 js/wasm netbsd/amd64 openbsd/amd64
 do
   cross_compile "$dist"
 done

If you want to bypass the build.sh step:

GOOS=darwin GOARCH=arm64 go build -a -ldflags="-X 'main.Version=$(git describe)'" -o frangipanni_"$GOOS"_"$GOARCH" frangipanni.go

Enjoy!

bdmorin avatar Jan 11 '23 15:01 bdmorin