ci: run `hdr-check` as part of the `Static Analysis` job
[git/git.git] / ci / install-dependencies.sh
CommitLineData
657343a6
LS
1#!/usr/bin/env bash
2#
3# Install dependencies required to build and test Git on Linux and macOS
4#
5
c2160f2d 6. ${0%/*}/lib.sh
657343a6 7
f67242c1
JH
8P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
9LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
10
bf427a94
SG
11case "$jobname" in
12linux-clang|linux-gcc)
0f0c5118
SG
13 sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
14 sudo apt-get -q update
db864306 15 sudo apt-get -q -y install language-pack-is libsvn-perl apache2
0f0c5118
SG
16 case "$jobname" in
17 linux-gcc)
18 sudo apt-get -q -y install gcc-8
19 ;;
20 esac
21
83d1efe5
SG
22 mkdir --parents "$P4_PATH"
23 pushd "$P4_PATH"
f67242c1
JH
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
f67242c1 28 popd
83d1efe5
SG
29 mkdir --parents "$GIT_LFS_PATH"
30 pushd "$GIT_LFS_PATH"
f67242c1
JH
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 .
f67242c1 34 popd
657343a6 35 ;;
bf427a94 36osx-clang|osx-gcc)
af8ed047 37 export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
f67242c1
JH
38 # Uncomment this if you want to run perf tests:
39 # brew install gnu-time
b011fabd
JS
40 test -z "$BREW_INSTALL_PACKAGES" ||
41 brew install $BREW_INSTALL_PACKAGES
f67242c1
JH
42 brew link --force gettext
43 brew install caskroom/cask/perforce
2c8921db
SG
44 case "$jobname" in
45 osx-gcc)
46 brew link gcc@8
47 ;;
48 esac
657343a6 49 ;;
0f0c5118
SG
50StaticAnalysis)
51 sudo apt-get -q update
411e4f47
JS
52 sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
53 libexpat-dev gettext
0f0c5118
SG
54 ;;
55Documentation)
56 sudo apt-get -q update
57 sudo apt-get -q -y install asciidoc xmlto
f34a1bd9
SG
58
59 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
615a6c37 60 gem install --version 1.5.8 asciidoctor
0f0c5118 61 ;;
657343a6
LS
62esac
63
0f0c5118
SG
64if type p4d >/dev/null && type p4 >/dev/null
65then
66 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
67 p4d -V | grep Rev.
68 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
69 p4 -V | grep Rev.
70fi
71if type git-lfs >/dev/null
72then
73 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
74 git-lfs version
75fi