ygot: init at 0.30.0
Co-authored-by: awwpotato <153149335+awwpotato@users.noreply.github.com>
This commit is contained in:
co-authored by
awwpotato
parent
48382072d0
commit
740cc14fad
@@ -0,0 +1,60 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "ygot";
|
||||
version = "0.30.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "openconfig";
|
||||
repo = "ygot";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-nV0vh4KZtXEMc8BNRkrRVwgb59KWahkqROxu9/7xP/E=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-MxyjO/uptmBXz+JWgRcP/SWeEWyz9pNA9eM4Rul45cM=";
|
||||
|
||||
excludedPackages = [
|
||||
"demo/*"
|
||||
"exampleoc"
|
||||
"integration_tests/"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
postInstall =
|
||||
''
|
||||
# The normal binary names are far too generic
|
||||
mv $out/bin/generator $out/bin/ygot_generator
|
||||
mv $out/bin/proto_generator $out/bin/ygot_proto_generator
|
||||
''
|
||||
+ lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
|
||||
let
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
in
|
||||
''
|
||||
installShellCompletion --cmd gnmidiff \
|
||||
--bash <(${emulator} $out/bin/gnmidiff completion bash) \
|
||||
--zsh <(${emulator} $out/bin/gnmidiff completion zsh) \
|
||||
--fish <(${emulator} $out/bin/gnmidiff completion fish)
|
||||
''
|
||||
);
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Collection of Go utilities for interacting with YANG modules";
|
||||
homepage = "https://github.com/openconfig/ygot";
|
||||
changelog = "https://github.com/openconfig/ygot/releases/tag/v${finalAttrs.version}";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = [ lib.maintainers.haylin ];
|
||||
mainProgram = "ygot_generator";
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user