install-dependencies.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/usr/bin/env bash
  2. #
  3. # Install dependencies required to build and test Git on Linux and macOS
  4. #
  5. . ${0%/*}/lib.sh
  6. P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
  7. LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
  8. UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
  9. tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
  10. libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl"
  11. case "$jobname" in
  12. linux-clang|linux-gcc)
  13. sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
  14. sudo apt-get -q update
  15. sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
  16. $UBUNTU_COMMON_PKGS
  17. case "$jobname" in
  18. linux-gcc)
  19. sudo apt-get -q -y install gcc-8
  20. ;;
  21. esac
  22. mkdir --parents "$P4_PATH"
  23. pushd "$P4_PATH"
  24. wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
  25. wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
  26. chmod u+x p4d
  27. chmod u+x p4
  28. popd
  29. mkdir --parents "$GIT_LFS_PATH"
  30. pushd "$GIT_LFS_PATH"
  31. wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
  32. tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
  33. cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
  34. popd
  35. ;;
  36. osx-clang|osx-gcc)
  37. export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
  38. # Uncomment this if you want to run perf tests:
  39. # brew install gnu-time
  40. test -z "$BREW_INSTALL_PACKAGES" ||
  41. brew install $BREW_INSTALL_PACKAGES
  42. brew link --force gettext
  43. brew cask install --no-quarantine perforce || {
  44. # Update the definitions and try again
  45. cask_repo="$(brew --repository)"/Library/Taps/homebrew/homebrew-cask &&
  46. git -C "$cask_repo" pull --no-stat &&
  47. brew cask install --no-quarantine perforce
  48. } ||
  49. brew install caskroom/cask/perforce
  50. case "$jobname" in
  51. osx-gcc)
  52. brew install gcc@9
  53. # Just in case the image is updated to contain gcc@9
  54. # pre-installed but not linked.
  55. brew link gcc@9
  56. ;;
  57. esac
  58. ;;
  59. StaticAnalysis)
  60. sudo apt-get -q update
  61. sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
  62. libexpat-dev gettext make
  63. ;;
  64. Documentation)
  65. sudo apt-get -q update
  66. sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns make
  67. test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
  68. sudo gem install --version 1.5.8 asciidoctor
  69. ;;
  70. linux-gcc-4.8|GETTEXT_POISON)
  71. sudo apt-get -q update
  72. sudo apt-get -q -y install $UBUNTU_COMMON_PKGS
  73. ;;
  74. esac
  75. if type p4d >/dev/null && type p4 >/dev/null
  76. then
  77. echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
  78. p4d -V | grep Rev.
  79. echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
  80. p4 -V | grep Rev.
  81. fi
  82. if type git-lfs >/dev/null
  83. then
  84. echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
  85. git-lfs version
  86. fi