pantry/projects/turso.tech/package.yml
Johannes Gustafsson 612ff5c2cd
fix turso build (#4221)
* fix turso build

* fix test

interesting that that breaks version setting, but that seems like it's working as intended by the dev?

* no --version in the linux version?

---------

Co-authored-by: Jacob Heider <jacob@pkgx.dev>
2023-11-27 10:53:36 -05:00

38 lines
930 B
YAML

distributable:
url: https://github.com/tursodatabase/turso-cli/archive/refs/tags/v{{version}}.tar.gz
strip-components: 1
versions:
github: tursodatabase/turso-cli/tags
strip: /^v/
provides:
- bin/turso
build:
script:
- echo "{{version}}" > internal/cmd/version.txt
- go mod download
- go generate --tags=prod ./...
- go build $ARGS -ldflags="$LDFLAGS" ./cmd/turso
dependencies:
go.dev: ^1.20
env:
GO111MODULE: on
CGO_ENABLED: 0
ARGS:
- -v
- -trimpath
- -tags=prod
- -o "{{prefix}}"/bin/turso
LDFLAGS:
- -s
- -w
- -X main.debugMode=false
linux:
# or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
LDFLAGS:
- -buildmode=pie
test: 'test "$(turso db locations 2>&1 || true)" = "Error: user not logged in, please login with turso auth login"'