travis-ci: move Travis CI code into dedicated scripts
[git] / ci / install-dependencies.sh
1 #!/usr/bin/env bash
2 #
3 # Install dependencies required to build and test Git on Linux and macOS
4 #
5
6 . ${0%/*}/lib-travisci.sh
7
8 case "${TRAVIS_OS_NAME:-linux}" in
9         linux)
10                 export GIT_TEST_HTTPD=YesPlease
11
12                 mkdir --parents custom/p4
13                 pushd custom/p4
14                         wget --quiet http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION/bin.linux26x86_64/p4d
15                         wget --quiet http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION/bin.linux26x86_64/p4
16                         chmod u+x p4d
17                         chmod u+x p4
18                         export PATH="$(pwd):$PATH"
19                 popd
20                 mkdir --parents custom/git-lfs
21                 pushd custom/git-lfs
22                         wget --quiet https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz
23                         tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
24                         cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
25                         export PATH="$(pwd):$PATH"
26                 popd
27         ;;
28         osx)
29                 brew update --quiet
30                 # Uncomment this if you want to run perf tests:
31                 # brew install gnu-time
32                 brew install git-lfs gettext
33                 brew link --force gettext
34                 brew install caskroom/cask/perforce
35         ;;
36 esac
37
38 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
39 p4d -V | grep Rev.
40 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
41 p4 -V | grep Rev.
42 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
43 git-lfs version