nixpkgs/pkgs/development/tools/cue/default.nix

60 lines
1.3 KiB
Nix
Raw Normal View History

2023-10-26 14:25:46 +00:00
{ buildGoModule
, fetchFromGitHub
, lib
, installShellFiles
, testers
, cue
, callPackage
2023-10-26 14:25:46 +00:00
}:
2019-07-06 07:40:02 +00:00
buildGoModule rec {
pname = "cue";
2024-02-21 14:37:51 +00:00
version = "0.8.0";
2019-07-06 07:40:02 +00:00
src = fetchFromGitHub {
owner = "cue-lang";
repo = "cue";
2019-07-06 07:40:02 +00:00
rev = "v${version}";
2024-02-21 14:37:51 +00:00
hash = "sha256-7gn8/35rpbyzSP4ZM21ig6Wsq5Tp18x1Ex/IVb2iE7k=";
2019-07-06 07:40:02 +00:00
};
2024-02-21 14:37:51 +00:00
vendorHash = "sha256-0OZtKIDdEnQLnSj109EpGvaZvMIy7gPAZ+weHzYKGSg=";
2023-10-26 14:25:46 +00:00
2024-02-21 14:37:51 +00:00
subPackages = [ "cmd/*" ];
2019-07-06 07:40:02 +00:00
2022-05-04 08:44:21 +00:00
nativeBuildInputs = [ installShellFiles ];
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
doInstallCheck = true;
installCheckPhase = ''
$out/bin/cue eval - <<<'a: "all good"' > /dev/null
'';
passthru = {
writeCueValidator = callPackage ./validator.nix { };
tests = {
version = testers.testVersion {
package = cue;
command = "cue version";
};
};
2022-05-04 08:44:21 +00:00
};
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/";
license = lib.licenses.asl20;
2022-05-04 08:44:21 +00:00
maintainers = with maintainers; [ aaronjheng ];
2024-02-21 14:37:51 +00:00
mainProgram = "cue";
2019-07-06 07:40:02 +00:00
};
2020-05-16 17:15:28 +00:00
}