blob: 8ce9ce276e4dd2b66389a21151bf93b4de6a75d9 [file] [log] [blame]
Lars Schneider657343a2017-09-10 16:44:28 +02001#!/usr/bin/env bash
2#
3# Install dependencies required to build and test Git on Linux and macOS
4#
5
Johannes Schindelinc2160f22019-01-27 15:26:50 -08006. ${0%/*}/lib.sh
Lars Schneider657343a2017-09-10 16:44:28 +02007
Junio C Hamanof67242c2017-09-11 10:18:29 +09008P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
9LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
Lars Schneider657343a2017-09-10 16:44:28 +020010
SZEDER Gáborbf427a92017-12-12 00:34:44 +010011case "$jobname" in
12linux-clang|linux-gcc)
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010013 sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
14 sudo apt-get -q update
SZEDER Gábordb864302019-04-30 14:37:24 +020015 sudo apt-get -q -y install language-pack-is libsvn-perl apache2
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010016 case "$jobname" in
17 linux-gcc)
18 sudo apt-get -q -y install gcc-8
19 ;;
20 esac
21
SZEDER Gábor83d1efe2017-11-01 12:55:35 +010022 mkdir --parents "$P4_PATH"
23 pushd "$P4_PATH"
Junio C Hamanof67242c2017-09-11 10:18:29 +090024 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
Junio C Hamanof67242c2017-09-11 10:18:29 +090028 popd
SZEDER Gábor83d1efe2017-11-01 12:55:35 +010029 mkdir --parents "$GIT_LFS_PATH"
30 pushd "$GIT_LFS_PATH"
Junio C Hamanof67242c2017-09-11 10:18:29 +090031 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 .
Junio C Hamanof67242c2017-09-11 10:18:29 +090034 popd
Lars Schneider657343a2017-09-10 16:44:28 +020035 ;;
SZEDER Gáborbf427a92017-12-12 00:34:44 +010036osx-clang|osx-gcc)
SZEDER Gáboraf8ed042019-07-03 12:47:48 +020037 export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
Junio C Hamanof67242c2017-09-11 10:18:29 +090038 # Uncomment this if you want to run perf tests:
39 # brew install gnu-time
Johannes Schindelinb011fab2019-01-27 15:26:51 -080040 test -z "$BREW_INSTALL_PACKAGES" ||
41 brew install $BREW_INSTALL_PACKAGES
Junio C Hamanof67242c2017-09-11 10:18:29 +090042 brew link --force gettext
43 brew install caskroom/cask/perforce
SZEDER Gábor2c8921d2019-01-17 02:29:13 +010044 case "$jobname" in
45 osx-gcc)
46 brew link gcc@8
47 ;;
48 esac
Lars Schneider657343a2017-09-10 16:44:28 +020049 ;;
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010050StaticAnalysis)
51 sudo apt-get -q update
Johannes Schindelin411e4f42019-10-01 04:16:26 -070052 sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
53 libexpat-dev gettext
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010054 ;;
55Documentation)
56 sudo apt-get -q update
57 sudo apt-get -q -y install asciidoc xmlto
SZEDER Gáborf34a1bd2019-03-29 13:35:18 +010058
59 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
SZEDER Gábor615a6c32019-03-29 20:52:46 +010060 gem install --version 1.5.8 asciidoctor
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010061 ;;
Lars Schneider657343a2017-09-10 16:44:28 +020062esac
63
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010064if 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