2018-05-07 23:21:08 +01:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, fetchurl, go-bindata, libvirt, qemu, docker-machine-kvm,
|
2018-05-08 22:20:11 +01:00
|
|
|
gpgme, makeWrapper, hostPlatform, vmnet, python }:
|
2017-01-31 17:39:24 +00:00
|
|
|
|
2018-05-07 23:21:08 +01:00
|
|
|
let binPath = stdenv.lib.optionals stdenv.isLinux [ libvirt qemu docker-machine-kvm ];
|
2017-01-31 17:39:24 +00:00
|
|
|
|
2017-03-12 01:12:53 +00:00
|
|
|
in buildGoPackage rec {
|
|
|
|
pname = "minikube";
|
|
|
|
name = "${pname}-${version}";
|
2018-05-19 15:38:16 +01:00
|
|
|
version = "0.27.0";
|
2016-12-06 01:23:59 +00:00
|
|
|
|
2017-03-12 01:12:53 +00:00
|
|
|
goPackagePath = "k8s.io/minikube";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kubernetes";
|
|
|
|
repo = "minikube";
|
|
|
|
rev = "v${version}";
|
2018-05-19 15:38:16 +01:00
|
|
|
sha256 = "00gj8x5p0vxwy0y0g5nnddmq049h7zxvhb73lb4gii5mghr9mkws";
|
2016-12-06 01:23:59 +00:00
|
|
|
};
|
|
|
|
|
2018-05-07 23:21:08 +01:00
|
|
|
buildInputs = [ go-bindata makeWrapper gpgme ] ++ stdenv.lib.optional hostPlatform.isDarwin vmnet;
|
2017-03-12 01:12:53 +00:00
|
|
|
subPackages = [ "cmd/minikube" ];
|
2016-12-06 01:23:59 +00:00
|
|
|
|
2017-03-12 01:12:53 +00:00
|
|
|
preBuild = ''
|
|
|
|
pushd go/src/${goPackagePath} >/dev/null
|
2016-12-06 01:23:59 +00:00
|
|
|
|
2018-05-08 22:20:11 +01:00
|
|
|
go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
|
2017-03-05 03:23:44 +00:00
|
|
|
|
2017-03-12 01:12:53 +00:00
|
|
|
ISO_VERSION=$(grep "^ISO_VERSION" Makefile | sed "s/^.*\s//")
|
|
|
|
ISO_BUCKET=$(grep "^ISO_BUCKET" Makefile | sed "s/^.*\s//")
|
2018-05-08 22:20:11 +01:00
|
|
|
KUBERNETES_VERSION=$(${python}/bin/python hack/get_k8s_version.py --k8s-version-only 2>&1) || true
|
2017-01-31 17:39:24 +00:00
|
|
|
|
2017-03-12 01:12:53 +00:00
|
|
|
export buildFlagsArray="-ldflags=\
|
|
|
|
-X k8s.io/minikube/pkg/version.version=v${version} \
|
|
|
|
-X k8s.io/minikube/pkg/version.isoVersion=$ISO_VERSION \
|
2018-05-08 22:20:11 +01:00
|
|
|
-X k8s.io/minikube/pkg/version.isoPath=$ISO_BUCKET \
|
|
|
|
-X k8s.io/minikube/vendor/k8s.io/client-go/pkg/version.gitVersion=$KUBERNETES_VERSION \
|
|
|
|
-X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.gitVersion=$KUBERNETES_VERSION"
|
2017-03-12 01:12:53 +00:00
|
|
|
|
|
|
|
popd >/dev/null
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $bin/share/bash-completion/completions/
|
2018-05-07 23:21:08 +01:00
|
|
|
MINIKUBE_WANTUPDATENOTIFICATION=false MINIKUBE_WANTKUBECTLDOWNLOADMSG=false HOME=$PWD $bin/bin/minikube completion bash > $bin/share/bash-completion/completions/minikube
|
2017-12-13 17:19:40 +00:00
|
|
|
mkdir -p $bin/share/zsh/site-functions/
|
2018-05-07 23:21:08 +01:00
|
|
|
MINIKUBE_WANTUPDATENOTIFICATION=false MINIKUBE_WANTKUBECTLDOWNLOADMSG=false HOME=$PWD $bin/bin/minikube completion zsh > $bin/share/zsh/site-functions/_minikube
|
2016-12-06 01:23:59 +00:00
|
|
|
'';
|
|
|
|
|
2017-03-12 01:12:53 +00:00
|
|
|
postFixup = "wrapProgram $bin/bin/${pname} --prefix PATH : ${stdenv.lib.makeBinPath binPath}";
|
|
|
|
|
2016-12-06 01:23:59 +00:00
|
|
|
meta = with stdenv.lib; {
|
2017-03-12 01:12:53 +00:00
|
|
|
homepage = https://github.com/kubernetes/minikube;
|
2016-12-06 01:23:59 +00:00
|
|
|
description = "A tool that makes it easy to run Kubernetes locally";
|
2017-03-12 01:12:53 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ebzzry copumpkin ];
|
|
|
|
platforms = with platforms; unix;
|
2016-12-06 01:23:59 +00:00
|
|
|
};
|
|
|
|
}
|