diff --git a/pkgs/applications/networking/cluster/docker-machine/kvm2.nix b/pkgs/applications/networking/cluster/docker-machine/kvm2.nix index eb2946cec771..78dcc713d323 100644 --- a/pkgs/applications/networking/cluster/docker-machine/kvm2.nix +++ b/pkgs/applications/networking/cluster/docker-machine/kvm2.nix @@ -1,32 +1,22 @@ -{ stdenv, buildGoModule, libvirt, pkgconfig, minikube }: +{ lib, buildGoModule, minikube }: buildGoModule rec { - pname = "docker-machine-kvm2"; - version = minikube.version; + inherit (minikube) version src nativeBuildInputs buildInputs goPackagePath postPatch preBuild; - goPackagePath = "k8s.io/minikube"; + pname = "docker-machine-kvm2"; subPackages = [ "cmd/drivers/kvm" ]; - src = minikube.src; - - modSha256 = minikube.go-modules.outputHash; - - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ libvirt ]; - - preBuild = '' - export buildFlagsArray=(-ldflags="-X k8s.io/minikube/pkg/drivers/kvm/version.VERSION=v${version}") - ''; + modSha256 = minikube.go-modules.outputHash; postInstall = '' mv $out/bin/kvm $out/bin/docker-machine-driver-kvm2 ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = https://github.com/kubernetes/minikube/blob/master/docs/drivers.md; description = "KVM2 driver for docker-machine."; license = licenses.asl20; - maintainers = with maintainers; [ tadfisher ]; + maintainers = with maintainers; [ tadfisher atkinschang ]; platforms = platforms.unix; }; } diff --git a/pkgs/applications/networking/cluster/minikube/default.nix b/pkgs/applications/networking/cluster/minikube/default.nix index 5637e486ef11..d59089443bbe 100644 --- a/pkgs/applications/networking/cluster/minikube/default.nix +++ b/pkgs/applications/networking/cluster/minikube/default.nix @@ -1,68 +1,73 @@ -{ stdenv, buildGoModule, fetchFromGitHub, go-bindata, libvirt, qemu -, gpgme, makeWrapper, vmnet -, docker-machine-kvm, docker-machine-kvm2 -, extraDrivers ? [] +{ stdenv +, buildGoModule +, fetchFromGitHub +, pkgconfig +, makeWrapper +, go-bindata +, bash +, libvirt +, vmnet }: -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 buildGoModule rec { +buildGoModule rec { pname = "minikube"; - version = "1.2.0"; - - kubernetesVersion = "1.15.0"; + version = "1.3.1"; + # for -ldflags + commit = "ca60a424ce69a4d79f502650199ca2b52f29e631"; goPackagePath = "k8s.io/minikube"; + subPackages = [ "cmd/minikube" ]; + modSha256 = "0ajzkc3xs7ql0v5762d3rh6idk04nhglfph3ldl25mnafwb7qd9l"; src = fetchFromGitHub { owner = "kubernetes"; repo = "minikube"; rev = "v${version}"; - sha256 = "0l9znrp49877cp1bkwx84c8lv282ga5a946rjbxi8gznkf3kwaw7"; + sha256 = "0kfd7041y6fayz8jl7zlw2lccnrx4d9qramx99j8mcw5syc2mwsd"; }; - modSha256 = "1cp63n0x2lgbqvvymx9byx48r42qw6w224x5x4iiarc2nryfdhn0"; + nativeBuildInputs = [ pkgconfig go-bindata makeWrapper ]; + buildInputs = stdenv.lib.optionals stdenv.isLinux [ libvirt ] + ++ stdenv.lib.optionals stdenv.isDarwin [ vmnet ]; - buildInputs = [ go-bindata makeWrapper gpgme ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin vmnet; - subPackages = [ "cmd/minikube" ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin "cmd/drivers/hyperkit"; + postPatch = '' + substituteInPlace pkg/minikube/command/exec_runner.go \ + --replace "/bin/bash" ${bash}/bin/bash + ''; preBuild = '' go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/... + go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/... 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" + -X ${goPackagePath}/pkg/version.version=v${version} \ + -X ${goPackagePath}/pkg/version.isoVersion=$ISO_VERSION \ + -X ${goPackagePath}/pkg/version.isoPath=$ISO_BUCKET \ + -X ${goPackagePath}/pkg/version.gitCommitID=${commit} \ + -X ${goPackagePath}/pkg/drivers/kvm.version=v${version} \ + -X ${goPackagePath}/pkg/drivers/kvm.gitCommitID=${commit} \ + -X ${goPackagePath}/pkg/drivers/hyperkit.version=v${version} \ + -X ${goPackagePath}/pkg/drivers/hyperkit.gitCommitID=${commit}" ''; postInstall = '' - wrapProgram $out/bin/${pname} --prefix PATH : $out/bin:${stdenv.lib.makeBinPath binPath} mkdir -p $out/share/bash-completion/completions/ MINIKUBE_WANTUPDATENOTIFICATION=false MINIKUBE_WANTKUBECTLDOWNLOADMSG=false HOME=$PWD $out/bin/minikube completion bash > $out/share/bash-completion/completions/minikube + mkdir -p $out/share/zsh/site-functions/ MINIKUBE_WANTUPDATENOTIFICATION=false MINIKUBE_WANTKUBECTLDOWNLOADMSG=false HOME=$PWD $out/bin/minikube completion zsh > $out/share/zsh/site-functions/_minikube - ''+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' - mv $out/bin/hyperkit $out/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 ]; + maintainers = with maintainers; [ ebzzry copumpkin vdemeester atkinschang ]; platforms = with platforms; unix; }; }