11 pname = "kubernetes-helm";
14 src = fetchFromGitHub {
18 sha256 = "sha256-Uxb3nDcCTD61KHSon02eJJyj1MlJex/SmpOEIELdeMo=";
20 vendorHash = "sha256-4RKNNKUPLUv5bYde6pTL8u5/KXzN0Ai8n4fS9mbiZgw=";
22 subPackages = [ "cmd/helm" ];
26 "-X helm.sh/helm/v3/internal/version.version=v${version}"
27 "-X helm.sh/helm/v3/internal/version.gitCommit=${src.rev}"
31 # set k8s version to client-go version, to match upstream
32 K8S_MODULES_VER="$(go list -f '{{.Version}}' -m k8s.io/client-go)"
33 K8S_MODULES_MAJOR_VER="$(($(cut -d. -f1 <<<"$K8S_MODULES_VER") + 1))"
34 K8S_MODULES_MINOR_VER="$(cut -d. -f2 <<<"$K8S_MODULES_VER")"
35 old_ldflags="''${ldflags}"
36 ldflags="''${ldflags} -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMajor=''${K8S_MODULES_MAJOR_VER}"
37 ldflags="''${ldflags} -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMinor=''${K8S_MODULES_MINOR_VER}"
38 ldflags="''${ldflags} -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMajor=''${K8S_MODULES_MAJOR_VER}"
39 ldflags="''${ldflags} -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMinor=''${K8S_MODULES_MINOR_VER}"
42 __darwinAllowLocalNetworking = true;
45 # restore ldflags for tests
46 ldflags="''${old_ldflags}"
48 # skipping version tests because they require dot git directory
49 substituteInPlace cmd/helm/version_test.go \
50 --replace "TestVersion" "SkipVersion"
51 # skipping plugin tests
52 substituteInPlace cmd/helm/plugin_test.go \
53 --replace "TestPluginDynamicCompletion" "SkipPluginDynamicCompletion" \
54 --replace "TestLoadPlugins" "SkipLoadPlugins"
55 substituteInPlace cmd/helm/helm_test.go \
56 --replace "TestPluginExitCode" "SkipPluginExitCode"
59 nativeBuildInputs = [ installShellFiles ];
61 $out/bin/helm completion bash > helm.bash
62 $out/bin/helm completion zsh > helm.zsh
63 $out/bin/helm completion fish > helm.fish
64 installShellCompletion helm.{bash,zsh,fish}
67 passthru.tests.version = testers.testVersion {
68 package = kubernetes-helm;
69 command = "helm version";
70 version = "v${version}";
74 homepage = "https://github.com/kubernetes/helm";
75 description = "Package manager for kubernetes";
77 license = licenses.asl20;
78 maintainers = with maintainers; [