2024-09-19 14:19:46 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, installShellFiles, stdenv }:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "jrsonnet";
|
2021-07-14 22:03:04 +00:00
|
|
|
version = "0.4.2";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "CertainLach";
|
|
|
|
repo = "jrsonnet";
|
2021-07-14 22:03:04 +00:00
|
|
|
sha256 = "sha256-OX+iJJ3vdCsWWr8x31psV9Vne6xWDZnJc83NbJqMK1A=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"clap-3.0.0-beta.2" = "sha256-BaLzm2JZEicktfsCIXQipHtEKlEv2lBktfvHP58rjeM=";
|
|
|
|
};
|
|
|
|
};
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# skip flaky tests
|
|
|
|
checkFlags = [
|
|
|
|
"--skip=tests::native_ext"
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
postInstall = ''
|
|
|
|
ln -s $out/bin/jrsonnet $out/bin/jsonnet
|
2021-10-08 15:17:17 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2021-10-08 15:17:17 +00:00
|
|
|
for shell in bash zsh fish; do
|
|
|
|
installShellCompletion --cmd jrsonnet \
|
|
|
|
--$shell <($out/bin/jrsonnet --generate $shell /dev/null)
|
|
|
|
installShellCompletion --cmd jsonnet \
|
|
|
|
--$shell <($out/bin/jrsonnet --generate $shell /dev/null | sed s/jrsonnet/jsonnet/g)
|
|
|
|
done
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "Purely-functional configuration language that helps you define JSON data";
|
|
|
|
homepage = "https://github.com/CertainLach/jrsonnet";
|
2022-12-28 21:21:41 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda lach ];
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
}
|