Revert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'"
[git/debian.git] / ci / install-dependencies.sh
blobdbcebad2fb293303f9271850094a29c3a249bda6
1 #!/usr/bin/env bash
3 # Install dependencies required to build and test Git on Linux and macOS
6 . ${0%/*}/lib.sh
8 P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
9 LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
10 UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
11 tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
12 libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl"
14 case "$runs_on_pool" in
15 ubuntu-latest)
16 sudo apt-get -q update
17 sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
18 $UBUNTU_COMMON_PKGS $CC_PACKAGE
19 mkdir --parents "$P4_PATH"
20 pushd "$P4_PATH"
21 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
22 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
23 chmod u+x p4d
24 chmod u+x p4
25 popd
26 mkdir --parents "$GIT_LFS_PATH"
27 pushd "$GIT_LFS_PATH"
28 wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
29 tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
30 cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
31 popd
33 macos-latest)
34 export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
35 # Uncomment this if you want to run perf tests:
36 # brew install gnu-time
37 test -z "$BREW_INSTALL_PACKAGES" ||
38 brew install $BREW_INSTALL_PACKAGES
39 brew link --force gettext
40 brew install --cask --no-quarantine perforce || {
41 # Update the definitions and try again
42 cask_repo="$(brew --repository)"/Library/Taps/homebrew/homebrew-cask &&
43 git -C "$cask_repo" pull --no-stat --ff-only &&
44 brew install --cask --no-quarantine perforce
45 } ||
46 brew install homebrew/cask/perforce
48 if test -n "$CC_PACKAGE"
49 then
50 BREW_PACKAGE=${CC_PACKAGE/-/@}
51 brew install "$BREW_PACKAGE"
52 brew link "$BREW_PACKAGE"
55 esac
57 case "$jobname" in
58 StaticAnalysis)
59 sudo apt-get -q update
60 sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
61 libexpat-dev gettext make
63 sparse)
64 sudo apt-get -q update -q
65 sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \
66 libexpat-dev gettext zlib1g-dev
68 Documentation)
69 sudo apt-get -q update
70 sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns make
72 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
73 sudo gem install --version 1.5.8 asciidoctor
75 linux-gcc-default)
76 sudo apt-get -q update
77 sudo apt-get -q -y install $UBUNTU_COMMON_PKGS
79 esac
81 if type p4d >/dev/null && type p4 >/dev/null
82 then
83 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
84 p4d -V | grep Rev.
85 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
86 p4 -V | grep Rev.
88 if type git-lfs >/dev/null
89 then
90 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
91 git-lfs version