2022-05-18 14:49:53 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, installShellFiles, testers, cue }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "cue";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "0.4.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cue-lang";
|
|
|
|
repo = "cue";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-v9MYrijnbtJpTgRZ4hmkaekisOyujldGewCRNbkVzWw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Disable script tests
|
|
|
|
rm -f cmd/cue/cmd/script_test.go
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
vendorHash = "sha256-jTfV8DJlr5LxS3HjOEBkVzBvZKiySrmINumXSUIq2mI=";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
excludedPackages = [ "internal/ci/updatetxtar" "internal/cmd/embedpkg" "internal/cmd/qgo" "pkg/gen" ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X cuelang.org/go/cmd/cue/cmd.version=${version}" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +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)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/cue eval - <<<'a: "all good"' > /dev/null
|
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = cue;
|
|
|
|
command = "cue version";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A data constraint language which aims to simplify tasks involving defining and using data";
|
|
|
|
homepage = "https://cuelang.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.asl20;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ aaronjheng ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
}
|