nixpkgs/pkgs/applications/networking/cluster/helm/default.nix
2022-10-13 17:45:58 +10:00

51 lines
1.6 KiB
Nix

{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "kubernetes-helm";
version = "3.10.1";
src = fetchFromGitHub {
owner = "helm";
repo = "helm";
rev = "v${version}";
sha256 = "sha256-OyU97zyN7fZMZAD2BEp8TW2z2E9Rl/yeiVkQaJ1GWZk=";
};
vendorSha256 = "sha256-vyHT/N5lat/vqM2jK4Q+jJOtZpS52YCYGcJqfa5e0KM=";
subPackages = [ "cmd/helm" ];
ldflags = [
"-w"
"-s"
"-X helm.sh/helm/v3/internal/version.version=v${version}"
"-X helm.sh/helm/v3/internal/version.gitCommit=${src.rev}"
];
preCheck = ''
# skipping version tests because they require dot git directory
substituteInPlace cmd/helm/version_test.go \
--replace "TestVersion" "SkipVersion"
'' + lib.optionalString stdenv.isLinux ''
# skipping plugin tests on linux
substituteInPlace cmd/helm/plugin_test.go \
--replace "TestPluginDynamicCompletion" "SkipPluginDynamicCompletion" \
--replace "TestLoadPlugins" "SkipLoadPlugins"
substituteInPlace cmd/helm/helm_test.go \
--replace "TestPluginExitCode" "SkipPluginExitCode"
'';
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$out/bin/helm completion bash > helm.bash
$out/bin/helm completion zsh > helm.zsh
installShellCompletion helm.{bash,zsh}
'';
meta = with lib; {
homepage = "https://github.com/kubernetes/helm";
description = "A package manager for kubernetes";
mainProgram = "helm";
license = licenses.asl20;
maintainers = with maintainers; [ rlupton20 edude03 saschagrunert Frostman Chili-Man techknowlogick ];
};
}