Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # Install dependencies required to build and test Git on Linux and macOS |
| 4 | # |
| 5 | |
Johannes Schindelin | c2160f2 | 2019-01-27 15:26:50 -0800 | [diff] [blame] | 6 | . ${0%/*}/lib.sh |
Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 7 | |
Junio C Hamano | f67242c | 2017-09-11 10:18:29 +0900 | [diff] [blame] | 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 |
Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 10 | |
SZEDER Gábor | bf427a9 | 2017-12-12 00:34:44 +0100 | [diff] [blame] | 11 | case "$jobname" in |
| 12 | linux-clang|linux-gcc) |
SZEDER Gábor | 0f0c511 | 2018-11-01 12:47:14 +0100 | [diff] [blame] | 13 | sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" |
| 14 | sudo apt-get -q update |
SZEDER Gábor | db86430 | 2019-04-30 14:37:24 +0200 | [diff] [blame] | 15 | sudo apt-get -q -y install language-pack-is libsvn-perl apache2 |
SZEDER Gábor | 0f0c511 | 2018-11-01 12:47:14 +0100 | [diff] [blame] | 16 | case "$jobname" in |
| 17 | linux-gcc) |
| 18 | sudo apt-get -q -y install gcc-8 |
| 19 | ;; |
| 20 | esac |
| 21 | |
SZEDER Gábor | 83d1efe | 2017-11-01 12:55:35 +0100 | [diff] [blame] | 22 | mkdir --parents "$P4_PATH" |
| 23 | pushd "$P4_PATH" |
Junio C Hamano | f67242c | 2017-09-11 10:18:29 +0900 | [diff] [blame] | 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 |
Junio C Hamano | f67242c | 2017-09-11 10:18:29 +0900 | [diff] [blame] | 28 | popd |
SZEDER Gábor | 83d1efe | 2017-11-01 12:55:35 +0100 | [diff] [blame] | 29 | mkdir --parents "$GIT_LFS_PATH" |
| 30 | pushd "$GIT_LFS_PATH" |
Junio C Hamano | f67242c | 2017-09-11 10:18:29 +0900 | [diff] [blame] | 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 . |
Junio C Hamano | f67242c | 2017-09-11 10:18:29 +0900 | [diff] [blame] | 34 | popd |
Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 35 | ;; |
SZEDER Gábor | bf427a9 | 2017-12-12 00:34:44 +0100 | [diff] [blame] | 36 | osx-clang|osx-gcc) |
SZEDER Gábor | af8ed04 | 2019-07-03 12:47:48 +0200 | [diff] [blame] | 37 | export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 |
Junio C Hamano | f67242c | 2017-09-11 10:18:29 +0900 | [diff] [blame] | 38 | # Uncomment this if you want to run perf tests: |
| 39 | # brew install gnu-time |
Johannes Schindelin | b011fab | 2019-01-27 15:26:51 -0800 | [diff] [blame] | 40 | test -z "$BREW_INSTALL_PACKAGES" || |
| 41 | brew install $BREW_INSTALL_PACKAGES |
Junio C Hamano | f67242c | 2017-09-11 10:18:29 +0900 | [diff] [blame] | 42 | brew link --force gettext |
| 43 | brew install caskroom/cask/perforce |
SZEDER Gábor | 2c8921d | 2019-01-17 02:29:13 +0100 | [diff] [blame] | 44 | case "$jobname" in |
| 45 | osx-gcc) |
| 46 | brew link gcc@8 |
| 47 | ;; |
| 48 | esac |
Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 49 | ;; |
SZEDER Gábor | 0f0c511 | 2018-11-01 12:47:14 +0100 | [diff] [blame] | 50 | StaticAnalysis) |
| 51 | sudo apt-get -q update |
Johannes Schindelin | 411e4f4 | 2019-10-01 04:16:26 -0700 | [diff] [blame^] | 52 | sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \ |
| 53 | libexpat-dev gettext |
SZEDER Gábor | 0f0c511 | 2018-11-01 12:47:14 +0100 | [diff] [blame] | 54 | ;; |
| 55 | Documentation) |
| 56 | sudo apt-get -q update |
| 57 | sudo apt-get -q -y install asciidoc xmlto |
SZEDER Gábor | f34a1bd | 2019-03-29 13:35:18 +0100 | [diff] [blame] | 58 | |
| 59 | test -n "$ALREADY_HAVE_ASCIIDOCTOR" || |
SZEDER Gábor | 615a6c3 | 2019-03-29 20:52:46 +0100 | [diff] [blame] | 60 | gem install --version 1.5.8 asciidoctor |
SZEDER Gábor | 0f0c511 | 2018-11-01 12:47:14 +0100 | [diff] [blame] | 61 | ;; |
Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 62 | esac |
| 63 | |
SZEDER Gábor | 0f0c511 | 2018-11-01 12:47:14 +0100 | [diff] [blame] | 64 | if type p4d >/dev/null && type p4 >/dev/null |
| 65 | then |
| 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. |
| 70 | fi |
| 71 | if type git-lfs >/dev/null |
| 72 | then |
| 73 | echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)" |
| 74 | git-lfs version |
| 75 | fi |