Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let
- components = [
- "cmd/hyperkube"
- "cmd/kubeadm"
- "cmd/kubectl"
- ];
- in
- (self: super: with super; {
- hyperkube = stdenv.mkDerivation rec {
- name = "hyperkube-${version}";
- version = "1.14.1";
- src = fetchFromGitHub {
- owner = "kubernetes";
- repo = "kubernetes";
- rev = "v${version}";
- sha256 = "1z60k3rlxah8cgv1r1p2y3p55pyixjxz5n9szsaq30j05d8rc1a8";
- };
- buildInputs = [ removeReferencesTo which go_1_12 rsync go-bindata ];
- outputs = ["out" "pause"];
- postPatch = ''
- substituteInPlace "hack/lib/golang.sh" --replace "_cgo" ""
- substituteInPlace "hack/generate-docs.sh" --replace "make" "make SHELL=${stdenv.shell}"
- substituteInPlace "hack/update-generated-docs.sh" --replace "make" "make SHELL=${stdenv.shell}"
- # hack/update-munge-docs.sh only performs some tests on the documentation.
- # They broke building k8s; disabled for now.
- echo "true" > "hack/update-munge-docs.sh"
- patchShebangs ./hack
- '';
- WHAT="${builtins.concatStringsSep " " components}";
- postBuild = ''
- (cd build/pause && cc pause.c -o pause)
- '';
- installPhase = ''
- mkdir -p "$out/bin" "$out/share/bash-completion/completions" "$out/share/zsh/site-functions" "$pause/bin"
- cp _output/local/go/bin/{hyperkube,kubeadm,kubectl} "$out/bin/"
- cp build/pause/pause "$pause/bin/pause"
- $out/bin/kubectl completion bash > $out/share/bash-completion/completions/kubectl
- $out/bin/kubectl completion zsh > $out/share/zsh/site-functions/_kubectl
- '';
- preFixup = ''
- find $out/bin $pause/bin -type f -exec remove-references-to -t ${go} '{}' +
- '';
- meta = {
- description = "Production-Grade Container Scheduling and Management";
- license = stdenv.lib.licenses.asl20;
- homepage = https://kubernetes.io;
- platforms = lib.platforms.unix;
- };
- };
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement