Skip to content

Commit

Permalink
fix: ldflags
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Nov 8, 2022
1 parent 5660800 commit 31c61e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ package-darwin:
-name=Punchr

# fyne-cross doesn't really pick up the right architectures. So we'll compile it again
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'gui/client/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'gui/client/client.VersionCLI=$(VERSION_CLIENT)'" -o fyne-cross/dist/darwin-amd64/Punchr.app/Contents/MacOS/punchr fyne.go
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'gui/client/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'gui/client/client.VersionCLI=$(VERSION_CLIENT)'" -o fyne-cross/dist/darwin-arm64/Punchr.app/Contents/MacOS/punchr fyne.go
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'github.com/dennis-tra/punchr/gui/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'github.com/dennis-tra/punchr/gui/client.VersionCLI=$(VERSION_CLIENT)'" -o fyne-cross/dist/darwin-amd64/Punchr.app/Contents/MacOS/punchr fyne.go
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'github.com/dennis-tra/punchr/gui/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'github.com/dennis-tra/punchr/gui/client.VersionCLI=$(VERSION_CLIENT)'" -o fyne-cross/dist/darwin-arm64/Punchr.app/Contents/MacOS/punchr fyne.go

package-linux:
fyne-cross linux \
-app-version=$(VERSION_CLIENT_GUI) \
-arch=amd64,386 \
-ldflags="-X 'gui/client/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'gui/client/client.VersionCLI=$(VERSION_CLIENT)'" \
-ldflags="-X 'github.com/dennis-tra/punchr/gui/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'github.com/dennis-tra/punchr/gui/client.VersionCLI=$(VERSION_CLIENT)'" \
-name=Punchr \
-release

Expand All @@ -78,7 +78,7 @@ package-freebsd:
fyne-cross freebsd \
-app-version=$(VERSION_CLIENT_GUI) \
-arch=amd64,arm64 \
-ldflags="-X 'gui/client/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'gui/client/client.VersionCLI=$(VERSION_CLIENT)'" \
-ldflags="-X 'github.com/dennis-tra/punchr/gui/client.VersionGUI=$(VERSION_CLIENT_GUI)' -X 'github.com/dennis-tra/punchr/gui/client.VersionCLI=$(VERSION_CLIENT)'" \
-name=Punchr \
-release

Expand Down
2 changes: 1 addition & 1 deletion cmd/client/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.8.0
4 changes: 2 additions & 2 deletions crosscompile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ archs=(amd64 arm64 386)
for os in "${oss[@]}"; do
for arch in "${archs[@]}"; do
echo "Compiling $os $arch..."
GOOS=${os} GOARCH=${arch} go build -ldflags="-X 'pkg/client/client.Version=$(cat cmd/client/version)'" -o dist/punchr_cli_${os}_${arch} cmd/client/*.go
GOOS=${os} GOARCH=${arch} go build -ldflags="-X 'github.com/dennis-tra/punchr/pkg/client.Version=$(cat cmd/client/version)'" -o dist/punchr_cli_${os}_${arch} cmd/client/*.go
done
done

arms=(5 6 7)
for arm in "${arms[@]}"; do
echo "Compiling linux arm$arm..."
GOOS=linux GOARCH=arm GOARM=${arm} go build -ldflags="-X 'pkg/client/client.Version=$(cat cmd/client/version)'" -o dist/punchr_cli_linux_arm${arm} cmd/client/*.go
GOOS=linux GOARCH=arm GOARM=${arm} go build -ldflags="-X 'github.com/dennis-tra/punchr/pkg/client.Version=$(cat cmd/client/version)'" -o dist/punchr_cli_linux_arm${arm} cmd/client/*.go
done
2 changes: 1 addition & 1 deletion gui/client/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.8.0

0 comments on commit 31c61e5

Please sign in to comment.