2023-11-16 04:20:00 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, installShellFiles
|
|
|
|
, testers
|
|
|
|
, cue
|
2024-04-21 15:54:59 +00:00
|
|
|
, callPackage
|
2023-11-16 04:20:00 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "cue";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.10.0";
|
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}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-GvReoBP8QCdrKxox8yPLZEk5YvTvwr7kflpS/jN8GTg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-sLTpra7JwgF4l1UCrUtzQA4xrP4OqxBcZ1qEssBdFtk=";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
subPackages = [ "cmd/*" ];
|
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
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X cuelang.org/go/cmd/cue/cmd.version=v${version}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postInstall = ''
|
|
|
|
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
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru = {
|
|
|
|
writeCueValidator = callPackage ./validator.nix { };
|
|
|
|
tests = {
|
|
|
|
test-001-all-good = callPackage ./tests/001-all-good.nix { };
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = cue;
|
|
|
|
command = "cue version";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
};
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Data constraint language which aims to simplify tasks involving defining and using data";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://cuelang.org/";
|
2024-06-20 14:57:18 +00:00
|
|
|
license = licenses.asl20;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ aaronjheng ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cue";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
}
|