2018-10-09 07:28:50 +02:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub }:
|
|
|
|
|
|
|
|
buildGoPackage rec {
|
2018-10-04 21:44:03 +02:00
|
|
|
version = "2.11.0";
|
2018-10-09 07:28:50 +02:00
|
|
|
name = "helm-${version}";
|
2016-12-13 00:43:24 +01:00
|
|
|
|
2018-10-09 07:28:50 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "helm";
|
|
|
|
repo = "helm";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1z810a6mxyrrw4i908dip8aqsj95c0kmv6xpb1wwhskg1zmf85wk";
|
2016-12-13 00:43:24 +01:00
|
|
|
};
|
|
|
|
|
2018-10-09 07:28:50 +02:00
|
|
|
goPackagePath = "k8s.io/helm";
|
|
|
|
subPackages = [ "cmd/helm" "cmd/tiller" "cmd/rudder" ];
|
2016-12-13 00:43:24 +01:00
|
|
|
|
2018-10-09 07:28:50 +02:00
|
|
|
goDeps = ./deps.nix;
|
2016-12-13 00:43:24 +01:00
|
|
|
|
2018-10-09 07:28:50 +02:00
|
|
|
# Thsese are the original flags from the helm makefile
|
|
|
|
buildFlagsArray = ''
|
2018-11-22 14:44:44 +01:00
|
|
|
-ldflags=-X k8s.io/helm/pkg/version.Version=v${version}
|
2018-10-09 07:28:50 +02:00
|
|
|
-w
|
|
|
|
-s
|
|
|
|
'';
|
2016-12-13 00:43:24 +01:00
|
|
|
|
2018-10-09 07:28:50 +02:00
|
|
|
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
|
2016-12-13 00:43:24 +01:00
|
|
|
'';
|
|
|
|
|
2018-10-09 07:28:50 +02:00
|
|
|
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
|
2016-12-13 00:43:24 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/kubernetes/helm;
|
|
|
|
description = "A package manager for kubernetes";
|
|
|
|
license = licenses.asl20;
|
2018-10-09 07:28:50 +02:00
|
|
|
maintainers = [ maintainers.rlupton20 maintainers.edude03 ];
|
2016-12-13 00:43:24 +01:00
|
|
|
};
|
|
|
|
}
|