1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 02:51:18 +00:00
nixpkgs/pkgs/applications/networking/cluster/helm/default.nix
2019-07-17 15:49:14 +08:00

49 lines
1.6 KiB
Nix

{ stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
version = "2.14.1";
name = "helm-${version}";
src = fetchFromGitHub {
owner = "helm";
repo = "helm";
rev = "v${version}";
sha256 = "16gvplqzllcif5h3qlfnlk8ifhkl5za3wj82129nf9darkixs4jh";
};
goPackagePath = "k8s.io/helm";
subPackages = [ "cmd/helm" "cmd/tiller" "cmd/rudder" ];
goDeps = ./deps.nix;
# Thsese are the original flags from the helm makefile
buildFlagsArray = ''
-ldflags=-X k8s.io/helm/pkg/version.Version=v${version} -X k8s.io/helm/pkg/version.GitTreeState=clean -X k8s.io/helm/pkg/version.BuildMetadata=
-w
-s
'';
preBuild = ''
# This is a hack(?) to flatten the dependency tree the same way glide or dep would
# Otherwise you'll get errors like
# have DeepCopyObject() "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime".Object
# want DeepCopyObject() "k8s.io/apimachinery/pkg/runtime".Object
rm -rf $NIX_BUILD_TOP/go/src/k8s.io/kubernetes/vendor
rm -rf $NIX_BUILD_TOP/go/src/k8s.io/apiextensions-apiserver/vendor
'';
postInstall = ''
mkdir -p $bin/share/bash-completion/completions
mkdir -p $bin/share/zsh/site-functions
$bin/bin/helm completion bash > $bin/share/bash-completion/completions/helm
$bin/bin/helm completion zsh > $bin/share/zsh/site-functions/_helm
'';
meta = with stdenv.lib; {
homepage = https://github.com/kubernetes/helm;
description = "A package manager for kubernetes";
license = licenses.asl20;
maintainers = [ maintainers.rlupton20 maintainers.edude03 ];
};
}