Skip to content

Commit

Permalink
fix: attempt to build with cgo enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Feb 10, 2024
1 parent 8e51c7d commit 49f0b5d
Showing 1 changed file with 25 additions and 32 deletions.
57 changes: 25 additions & 32 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ changelog:

# ---------------------------
# Builder
#
# CGO is enabled and inspiration came from:
# https://github.com/goreleaser/goreleaser-cross-example
# https://github.com/goreleaser/goreleaser-cross-example-sysroot
# ---------------------------
builds:
- id: darwin-amd64
Expand All @@ -27,14 +31,24 @@ builds:
goarch:
- amd64
env:
- CGO_ENABLED=1
- PKG_CONFIG_SYSROOT_DIR=/sysroot/macos/amd64
- PKG_CONFIG_PATH=/sysroot/macos/amd64/usr/local/lib/pkgconfig
- CC=o64-clang
- CXX=o64-clang++
#- CC=o64-clang
#- CXX=o64-clang++
- CC=clang # Changed from o64-clang
- CXX=clang++ # Changed from o64-clang++
#mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}
#- -s -w -X github.com/bitcoin-sv/{{ .ProjectName }}/cmd.Version={{ .Version }}
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc

- id: linux-armhf
main: ./cmd/
Expand All @@ -46,45 +60,24 @@ builds:
goarm:
- 7
env:
- CC=arm-linux-gnueabihf-gcc
- CGO_ENABLED=1
- CC=arm-linux-gnueabihf-gcc # Make sure this points to the correct executable
- CXX=arm-linux-gnueabihf-g++
- CGO_CFLAGS=--sysroot=/sysroot/linux/armhf
- CGO_LDFLAGS=--sysroot=/sysroot/linux/armhf
- PKG_CONFIG_SYSROOT_DIR=/sysroot/linux/armhf
- PKG_CONFIG_PATH=/sysroot/linux/armhf/opt/vc/lib/pkgconfig:/sysroot/linux/armhf/usr/lib/arm-linux-gnueabihf/pkgconfig:/sysroot/linux/armhf/usr/lib/pkgconfig:/sysroot/linux/armhf/usr/local/lib/pkgconfig
#mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}

# - id: "amd64-build"
# main: ./cmd/
# env:
# - CGO_ENABLED=1
# - GO111MODULE=on
# goarch:
# - amd64
# goos:
# - linux
# mod_timestamp: "{{ .CommitTimestamp }}"
# ldflags:
# - -s -w -X github.com/bitcoin-sv/{{ .ProjectName }}/cmd.Version={{ .Version }}

# - id: "arm64-build"
# main: ./cmd/
# env:
# - CGO_ENABLED=1
# - GO111MODULE=on
# - CC=aarch64-linux-gnu-gcc
# - CXX=aarch64-linux-gnu-g++
# goarch:
# - arm64
# goos:
# - linux
# mod_timestamp: "{{ .CommitTimestamp }}"
# ldflags:
# - -s -w -X github.com/bitcoin-sv/{{ .ProjectName }}/cmd.Version={{ .Version }}

#- -s -w -X github.com/bitcoin-sv/{{ .ProjectName }}/cmd.Version={{ .Version }}
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
# ---------------------------
# Archives + Checksums
# ---------------------------
Expand Down

0 comments on commit 49f0b5d

Please sign in to comment.