Git 2.34.1
[alt-git.git] / ci / install-dependencies.sh
blob1d0e48f451558e685602ac362270d169b42caa92
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 "$jobname" in
15 linux-clang|linux-gcc|linux-leaks)
16 sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
17 sudo apt-get -q update
18 sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
19 $UBUNTU_COMMON_PKGS
20 case "$jobname" in
21 linux-gcc)
22 sudo apt-get -q -y install gcc-8
24 esac
26 mkdir --parents "$P4_PATH"
27 pushd "$P4_PATH"
28 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
29 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
30 chmod u+x p4d
31 chmod u+x p4
32 popd
33 mkdir --parents "$GIT_LFS_PATH"
34 pushd "$GIT_LFS_PATH"
35 wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
36 tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
37 cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
38 popd
40 osx-clang|osx-gcc)
41 export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
42 # Uncomment this if you want to run perf tests:
43 # brew install gnu-time
44 test -z "$BREW_INSTALL_PACKAGES" ||
45 brew install $BREW_INSTALL_PACKAGES
46 brew link --force gettext
47 brew install --cask --no-quarantine perforce || {
48 # Update the definitions and try again
49 cask_repo="$(brew --repository)"/Library/Taps/homebrew/homebrew-cask &&
50 git -C "$cask_repo" pull --no-stat --ff-only &&
51 brew install --cask --no-quarantine perforce
52 } ||
53 brew install homebrew/cask/perforce
54 case "$jobname" in
55 osx-gcc)
56 brew install gcc@9
57 # Just in case the image is updated to contain gcc@9
58 # pre-installed but not linked.
59 brew link gcc@9
61 esac
63 StaticAnalysis)
64 sudo apt-get -q update
65 sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
66 libexpat-dev gettext make
68 sparse)
69 sudo apt-get -q update -q
70 sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \
71 libexpat-dev gettext zlib1g-dev
73 Documentation)
74 sudo apt-get -q update
75 sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns make
77 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
78 sudo gem install --version 1.5.8 asciidoctor
80 linux-gcc-default|linux-gcc-4.8)
81 sudo apt-get -q update
82 sudo apt-get -q -y install $UBUNTU_COMMON_PKGS
84 esac
86 if type p4d >/dev/null && type p4 >/dev/null
87 then
88 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
89 p4d -V | grep Rev.
90 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
91 p4 -V | grep Rev.
93 if type git-lfs >/dev/null
94 then
95 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
96 git-lfs version