blob: 76ec308965dfaffbadcee47482c466863374ad2d [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
15 sudo apt-get -q -y install language-pack-is git-svn apache2
16 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ábora1ccaed2019-02-02 17:34:21 +010037 brew update >/dev/null
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
52 sudo apt-get -q -y install coccinelle
53 ;;
54Documentation)
55 sudo apt-get -q update
56 sudo apt-get -q -y install asciidoc xmlto
SZEDER Gáborf34a1bd2019-03-29 13:35:18 +010057
58 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
59 gem install asciidoctor
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010060 ;;
Lars Schneider657343a2017-09-10 16:44:28 +020061esac
62
SZEDER Gábor0f0c5112018-11-01 12:47:14 +010063if type p4d >/dev/null && type p4 >/dev/null
64then
65 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
66 p4d -V | grep Rev.
67 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
68 p4 -V | grep Rev.
69fi
70if type git-lfs >/dev/null
71then
72 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
73 git-lfs version
74fi