2024-11-20 02:06:42 +00:00
|
|
|
{
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
lib,
|
2024-11-20 02:17:19 +00:00
|
|
|
stdenv,
|
2024-11-20 02:06:42 +00:00
|
|
|
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-11-20 02:17:19 +00:00
|
|
|
version = "0.11.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}";
|
2024-11-20 02:17:19 +00:00
|
|
|
hash = "sha256-OneL29/d+OtOgcbCzl7B+sVsxF/gN2jA/36HthYXiQ0=";
|
2019-07-06 07:40:02 +00:00
|
|
|
};
|
|
|
|
|
2024-11-20 02:17:19 +00:00
|
|
|
vendorHash = "sha256-jl8TR1kxame30l7DkfOEioWA9wK/ACTNofiTi++vjuI=";
|
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 ];
|
2020-08-04 00:26:27 +00:00
|
|
|
|
2024-06-14 11:13:30 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X cuelang.org/go/cmd/cue/cmd.version=v${version}"
|
|
|
|
];
|
2019-07-06 07:40:02 +00:00
|
|
|
|
2024-11-20 02:17:19 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2022-05-04 08:44:21 +00:00
|
|
|
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
|
|
|
|
2024-03-29 18:03:54 +00:00
|
|
|
passthru = {
|
|
|
|
writeCueValidator = callPackage ./validator.nix { };
|
|
|
|
tests = {
|
2024-03-29 18:43:10 +00:00
|
|
|
test-001-all-good = callPackage ./tests/001-all-good.nix { };
|
2024-03-29 18:03:54 +00:00
|
|
|
version = testers.testVersion {
|
|
|
|
package = cue;
|
|
|
|
command = "cue version";
|
2024-04-23 15:42:14 +00:00
|
|
|
version = "v${version}";
|
2024-03-29 18:03:54 +00:00
|
|
|
};
|
|
|
|
};
|
2022-05-04 08:44:21 +00:00
|
|
|
};
|
|
|
|
|
2024-11-20 02:17:19 +00:00
|
|
|
meta = {
|
2019-11-22 02:08:54 +00:00
|
|
|
description = "Data constraint language which aims to simplify tasks involving defining and using data";
|
|
|
|
homepage = "https://cuelang.org/";
|
2024-11-20 02:17:19 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.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
|
|
|
}
|