From d26f5a7d96b396b1e6d09c6243be0369e2100bb4 Mon Sep 17 00:00:00 2001 From: John Allen Date: Sat, 14 Jan 2023 13:20:50 -0500 Subject: [PATCH] +cuelang (#101) * +cuelang Add `cue` from cuelang.org * split ldflags * add a better test --- projects/cuelang.org/data.cue | 3 +++ projects/cuelang.org/package.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 projects/cuelang.org/data.cue create mode 100644 projects/cuelang.org/package.yml diff --git a/projects/cuelang.org/data.cue b/projects/cuelang.org/data.cue new file mode 100644 index 00000000..841cf0b9 --- /dev/null +++ b/projects/cuelang.org/data.cue @@ -0,0 +1,3 @@ +package tea + +project: "cuelang.org" diff --git a/projects/cuelang.org/package.yml b/projects/cuelang.org/package.yml new file mode 100644 index 00000000..46d900ee --- /dev/null +++ b/projects/cuelang.org/package.yml @@ -0,0 +1,31 @@ +distributable: + url: https://github.com/cue-lang/cue/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: cue-lang/cue/tags + +provides: + - bin/cue + +build: + script: | + go mod download + go build -v -ldflags="$LDFLAGS" -o "{{ prefix }}"/bin/cue ./cmd/cue + dependencies: + go.dev: ^1.18 + env: + LDFLAGS: + - -s + - -w + - -X cuelang.org/go/cmd/cue/cmd.version=v{{ version }} + linux: + # or segmentation fault + # fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575 + LDFLAGS: + - -buildmode=pie + +test: + script: | + out=$(cue export data.cue --out yaml) + test "$out" = "project: cuelang.org"