mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
ff1a94e523
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
46 lines
1.3 KiB
Nix
46 lines
1.3 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "kn";
|
|
version = "1.13.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "knative";
|
|
repo = "client";
|
|
rev = "knative-v${version}";
|
|
sha256 = "sha256-irMipYDYMyA0l9d7tI1wS7XsxGWjBzTvxmhpKM1gLW8=";
|
|
};
|
|
|
|
vendorHash = 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";
|
|
mainProgram = "kn";
|
|
homepage = "https://github.com/knative/client";
|
|
changelog = "https://github.com/knative/client/releases/tag/v${version}";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ bryanasdev000 ];
|
|
};
|
|
}
|