2021-10-17 02:26:50 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "kn";
|
2022-02-12 04:51:11 +00:00
|
|
|
version = "1.2.0";
|
2021-10-17 02:26:50 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "knative";
|
|
|
|
repo = "client";
|
2021-12-16 18:13:55 +00:00
|
|
|
rev = "knative-v${version}";
|
2022-02-12 04:51:11 +00:00
|
|
|
sha256 = "sha256-yWzrMkkusRueHyWT4LwrflH4N7BNri2ycHIuAyvXceo=";
|
2021-10-17 02:26:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
subPackages = [ "cmd/kn" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-X knative.dev/client/pkg/kn/commands/version.Version=v${version}"
|
|
|
|
"-X knative.dev/client/pkg/kn/commands/version.VersionEventing=v${version}"
|
|
|
|
"-X knative.dev/client/pkg/kn/commands/version.VersionServing=v${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd kn \
|
|
|
|
--bash <($out/bin/kn completion bash) \
|
|
|
|
--zsh <($out/bin/kn completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/kn version | grep ${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The Knative client kn is your door to the Knative world. It allows you to create Knative resources interactively from the command line or from within scripts";
|
|
|
|
homepage = "https://github.com/knative/client";
|
|
|
|
changelog = "https://github.com/knative/client/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bryanasdev000 ];
|
|
|
|
};
|
|
|
|
}
|