From c98b30d2e79df9351ec770dd91232552de1c676a Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Mon, 7 Jun 2021 14:06:00 +0100 Subject: [PATCH] macOS fat binaries. --- cmd/zenity/.gitignore | 1 - cmd/zenity/build.sh | 16 +++++++++------- go.mod | 1 + go.sum | 8 ++------ internal/zenutil/tools.go | 1 + 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/cmd/zenity/.gitignore b/cmd/zenity/.gitignore index dc9ab05..1ef41c9 100644 --- a/cmd/zenity/.gitignore +++ b/cmd/zenity/.gitignore @@ -1,3 +1,2 @@ zenity -*.syso *.zip \ No newline at end of file diff --git a/cmd/zenity/build.sh b/cmd/zenity/build.sh index 275c091..37f81ca 100755 --- a/cmd/zenity/build.sh +++ b/cmd/zenity/build.sh @@ -3,17 +3,19 @@ go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath && -zip -9 zenity_win32.zip zenity.exe +zip -9 zenity_win32.zip zenity.exe && +rm zenity.exe GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath && -zip -9 zenity_win64.zip zenity.exe +zip -9 zenity_win64.zip zenity.exe && +rm zenity.exe rm resource.syso -GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath && -zip -9 zenity_macos_arm.zip zenity - -GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath && -zip -9 zenity_macos.zip zenity +GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o zenity_macos_x64 && +GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o zenity_macos_arm && +go run github.com/randall77/makefat zenity zenity_macos_x64 zenity_macos_arm && +zip -9 zenity_macos.zip zenity && +rm zenity zenity_macos_* go build -tags dev diff --git a/go.mod b/go.mod index 4b14294..751963b 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.16 require ( github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947 github.com/josephspurrier/goversioninfo v1.2.0 + github.com/randall77/makefat v0.0.0-20210315173500-7ddd0e42c844 github.com/stretchr/testify v1.7.0 // indirect go.uber.org/goleak v1.1.10 // test golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb diff --git a/go.sum b/go.sum index a82376e..330c0f3 100644 --- a/go.sum +++ b/go.sum @@ -6,14 +6,13 @@ github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947 h1:Fm10/KNuoAyBm2P5P5 github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947/go.mod h1:Dv9D0NUlAsaQcGQZa5kc5mqR9ua72SmA8VXi4cd+cBw= github.com/josephspurrier/goversioninfo v1.2.0 h1:tpLHXAxLHKHg/dCU2AAYx08A4m+v9/CWg6+WUvTF4uQ= github.com/josephspurrier/goversioninfo v1.2.0/go.mod h1:AGP2a+Y/OVJZ+s6XM4IwFUpkETwvn0orYurY8qpw1+0= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/randall77/makefat v0.0.0-20210315173500-7ddd0e42c844 h1:GranzK4hv1/pqTIhMTXt2X8MmMOuH3hMeUR0o9SP5yc= +github.com/randall77/makefat v0.0.0-20210315173500-7ddd0e42c844/go.mod h1:T1TLSfyWVBRXVGzWd0o9BI4kfoO9InEgfQe4NV3mLz8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -31,7 +30,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -55,10 +53,8 @@ golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/internal/zenutil/tools.go b/internal/zenutil/tools.go index d55a895..c85d0fb 100644 --- a/internal/zenutil/tools.go +++ b/internal/zenutil/tools.go @@ -4,4 +4,5 @@ package tools import ( _ "github.com/josephspurrier/goversioninfo" + _ "github.com/randall77/makefat" )