cmake.sh 499 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. set -x
  3. set -euo pipefail
  4. # shellcheck disable=SC1091
  5. . lib.sh
  6. main() {
  7. local version=3.23.1
  8. install_packages curl
  9. local td
  10. td="$(mktemp -d)"
  11. pushd "${td}"
  12. curl --retry 3 -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-linux-x86_64.sh" -o cmake.sh
  13. sh cmake.sh --skip-license --prefix=/usr/local
  14. popd
  15. purge_packages
  16. rm -rf "${td}"
  17. rm -rf /var/lib/apt/lists/*
  18. rm "${0}"
  19. }
  20. main "${@}"