2022-05-04 08:44:21 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, installShellFiles, testers, cue }:
|
2019-07-06 07:40:02 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "cue";
|
2023-08-09 12:23:09 +00:00
|
|
|
version = "0.6.0";
|
2019-07-06 07:40:02 +00:00
|
|
|
|
2022-01-18 12:33:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cue-lang";
|
|
|
|
repo = "cue";
|
2019-07-06 07:40:02 +00:00
|
|
|
rev = "v${version}";
|
2023-08-09 12:23:09 +00:00
|
|
|
hash = "sha256-1svWb83xbVZIlI9pviCYfQ6Kkp0QRjZwrauL7PPJLts=";
|
2019-07-06 07:40:02 +00:00
|
|
|
};
|
|
|
|
|
2022-05-04 08:44:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Disable script tests
|
|
|
|
rm -f cmd/cue/cmd/script_test.go
|
|
|
|
'';
|
|
|
|
|
2023-08-09 12:23:09 +00:00
|
|
|
vendorHash = "sha256-ku4tPTXdnKau0kqnAAEHDdSF4oAC/6SDkTq8cECOiEk=";
|
2022-05-04 08:44:21 +00:00
|
|
|
|
|
|
|
excludedPackages = [ "internal/ci/updatetxtar" "internal/cmd/embedpkg" "internal/cmd/qgo" "pkg/gen" ];
|
2019-07-06 07:40:02 +00:00
|
|
|
|
2022-05-04 08:44:21 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-08-04 00:26:27 +00:00
|
|
|
|
2022-05-04 08:44:21 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X cuelang.org/go/cmd/cue/cmd.version=${version}" ];
|
2019-07-06 07:40:02 +00:00
|
|
|
|
2022-05-04 08:44:21 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Completions
|
|
|
|
installShellCompletion --cmd cue \
|
|
|
|
--bash <($out/bin/cue completion bash) \
|
|
|
|
--fish <($out/bin/cue completion fish) \
|
|
|
|
--zsh <($out/bin/cue completion zsh)
|
|
|
|
'';
|
2019-07-06 07:40:02 +00:00
|
|
|
|
2022-01-18 12:33:52 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/cue eval - <<<'a: "all good"' > /dev/null
|
|
|
|
'';
|
|
|
|
|
2022-05-04 08:44:21 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = cue;
|
|
|
|
command = "cue version";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2019-11-22 02:08:54 +00:00
|
|
|
description = "A data constraint language which aims to simplify tasks involving defining and using data";
|
|
|
|
homepage = "https://cuelang.org/";
|
2021-01-23 12:26:19 +00:00
|
|
|
license = lib.licenses.asl20;
|
2022-05-04 08:44:21 +00:00
|
|
|
maintainers = with maintainers; [ aaronjheng ];
|
2019-07-06 07:40:02 +00:00
|
|
|
};
|
2020-05-16 17:15:28 +00:00
|
|
|
}
|