Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. let
  2. components = [
  3. "cmd/hyperkube"
  4. "cmd/kubeadm"
  5. "cmd/kubectl"
  6. ];
  7. in
  8. (self: super: with super; {
  9. hyperkube = stdenv.mkDerivation rec {
  10. name = "hyperkube-${version}";
  11. version = "1.14.1";
  12.  
  13. src = fetchFromGitHub {
  14. owner = "kubernetes";
  15. repo = "kubernetes";
  16. rev = "v${version}";
  17. sha256 = "1z60k3rlxah8cgv1r1p2y3p55pyixjxz5n9szsaq30j05d8rc1a8";
  18. };
  19.  
  20. buildInputs = [ removeReferencesTo which go_1_12 rsync go-bindata ];
  21.  
  22. outputs = ["out" "pause"];
  23.  
  24. postPatch = ''
  25. substituteInPlace "hack/lib/golang.sh" --replace "_cgo" ""
  26. substituteInPlace "hack/generate-docs.sh" --replace "make" "make SHELL=${stdenv.shell}"
  27. substituteInPlace "hack/update-generated-docs.sh" --replace "make" "make SHELL=${stdenv.shell}"
  28. # hack/update-munge-docs.sh only performs some tests on the documentation.
  29. # They broke building k8s; disabled for now.
  30. echo "true" > "hack/update-munge-docs.sh"
  31.  
  32. patchShebangs ./hack
  33. '';
  34.  
  35. WHAT="${builtins.concatStringsSep " " components}";
  36.  
  37. postBuild = ''
  38. (cd build/pause && cc pause.c -o pause)
  39. '';
  40.  
  41. installPhase = ''
  42. mkdir -p "$out/bin" "$out/share/bash-completion/completions" "$out/share/zsh/site-functions" "$pause/bin"
  43.  
  44. cp _output/local/go/bin/{hyperkube,kubeadm,kubectl} "$out/bin/"
  45. cp build/pause/pause "$pause/bin/pause"
  46.  
  47. $out/bin/kubectl completion bash > $out/share/bash-completion/completions/kubectl
  48. $out/bin/kubectl completion zsh > $out/share/zsh/site-functions/_kubectl
  49. '';
  50.  
  51. preFixup = ''
  52. find $out/bin $pause/bin -type f -exec remove-references-to -t ${go} '{}' +
  53. '';
  54.  
  55. meta = {
  56. description = "Production-Grade Container Scheduling and Management";
  57. license = stdenv.lib.licenses.asl20;
  58. homepage = https://kubernetes.io;
  59. platforms = lib.platforms.unix;
  60. };
  61. };
  62. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement