1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/networking/cluster/minikube/default.nix
Vincent Demeester 1f037a90f1 minikube: 0.30.0 -> 0.35.0 (#56879)
* minikube: 0.30.0 -> 0.34.1

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

* minikube: 0.34.1 -> 0.35.0

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2019-03-08 22:01:53 +01:00

75 lines
2.8 KiB
Nix

{ stdenv, buildGoPackage, fetchFromGitHub, go-bindata, libvirt, qemu
, gpgme, makeWrapper, vmnet, python
, docker-machine-kvm, docker-machine-kvm2
, extraDrivers ? []
}:
let
drivers = stdenv.lib.filter (d: d != null) (extraDrivers
++ stdenv.lib.optionals stdenv.isLinux [ docker-machine-kvm docker-machine-kvm2 ]);
binPath = drivers
++ stdenv.lib.optionals stdenv.isLinux ([ libvirt qemu ]);
in buildGoPackage rec {
pname = "minikube";
name = "${pname}-${version}";
version = "0.35.0";
kubernetesVersion = "1.13.4";
goPackagePath = "k8s.io/minikube";
src = fetchFromGitHub {
owner = "kubernetes";
repo = "minikube";
rev = "v${version}";
sha256 = "1qb342zs50sdfvfb8vbn7vrx11qqjy1hw518c053s7p34ljb24qd";
};
buildInputs = [ go-bindata makeWrapper gpgme ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin vmnet;
subPackages = [ "cmd/minikube" ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin "cmd/drivers/hyperkit";
preBuild = ''
pushd go/src/${goPackagePath} >/dev/null
go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
VERSION_MAJOR=$(grep "^VERSION_MAJOR" Makefile | sed "s/^.*\s//")
VERSION_MINOR=$(grep "^VERSION_MINOR" Makefile | sed "s/^.*\s//")
ISO_VERSION=v$VERSION_MAJOR.$VERSION_MINOR.0
ISO_BUCKET=$(grep "^ISO_BUCKET" Makefile | sed "s/^.*\s//")
KUBERNETES_VERSION=${kubernetesVersion}
export buildFlagsArray="-ldflags=\
-X k8s.io/minikube/pkg/version.version=v${version} \
-X k8s.io/minikube/pkg/version.isoVersion=$ISO_VERSION \
-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"
popd >/dev/null
'';
postInstall = ''
mkdir -p $bin/share/bash-completion/completions/
MINIKUBE_WANTUPDATENOTIFICATION=false MINIKUBE_WANTKUBECTLDOWNLOADMSG=false HOME=$PWD $bin/bin/minikube completion bash > $bin/share/bash-completion/completions/minikube
mkdir -p $bin/share/zsh/site-functions/
MINIKUBE_WANTUPDATENOTIFICATION=false MINIKUBE_WANTKUBECTLDOWNLOADMSG=false HOME=$PWD $bin/bin/minikube completion zsh > $bin/share/zsh/site-functions/_minikube
'';
postFixup = ''
wrapProgram $bin/bin/${pname} --prefix PATH : $bin/bin:${stdenv.lib.makeBinPath binPath}
'' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
mv $bin/bin/hyperkit $bin/bin/docker-machine-driver-hyperkit
'';
meta = with stdenv.lib; {
homepage = https://github.com/kubernetes/minikube;
description = "A tool that makes it easy to run Kubernetes locally";
license = licenses.asl20;
maintainers = with maintainers; [ ebzzry copumpkin vdemeester ];
platforms = with platforms; unix;
};
}