]> git.ipfire.org Git - thirdparty/git.git/blame - ci/install-dependencies.sh
Merge branch 'ab/detox-gettext-tests'
[thirdparty/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
61432dd6
ĐTCD
10UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
11 tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
12 libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl"
f67242c1 13
bf427a94
SG
14case "$jobname" in
15linux-clang|linux-gcc)
0f0c5118
SG
16 sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
17 sudo apt-get -q update
61432dd6
ĐTCD
18 sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
19 $UBUNTU_COMMON_PKGS
0f0c5118
SG
20 case "$jobname" in
21 linux-gcc)
22 sudo apt-get -q -y install gcc-8
23 ;;
24 esac
25
83d1efe5
SG
26 mkdir --parents "$P4_PATH"
27 pushd "$P4_PATH"
f67242c1
JH
28 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
29 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
30 chmod u+x p4d
31 chmod u+x p4
f67242c1 32 popd
83d1efe5
SG
33 mkdir --parents "$GIT_LFS_PATH"
34 pushd "$GIT_LFS_PATH"
f67242c1
JH
35 wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
36 tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
37 cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
f67242c1 38 popd
657343a6 39 ;;
bf427a94 40osx-clang|osx-gcc)
af8ed047 41 export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
f67242c1
JH
42 # Uncomment this if you want to run perf tests:
43 # brew install gnu-time
b011fabd
JS
44 test -z "$BREW_INSTALL_PACKAGES" ||
45 brew install $BREW_INSTALL_PACKAGES
f67242c1 46 brew link --force gettext
3831132a 47 brew install --cask --no-quarantine perforce || {
0eb3671e 48 # Update the definitions and try again
0dbc4a0e 49 cask_repo="$(brew --repository)"/Library/Taps/homebrew/homebrew-cask &&
3831132a
JH
50 git -C "$cask_repo" pull --no-stat --ff-only &&
51 brew install --cask --no-quarantine perforce
0eb3671e 52 } ||
3831132a 53 brew install homebrew/cask/perforce
2c8921db
SG
54 case "$jobname" in
55 osx-gcc)
176441bf
SG
56 brew install gcc@9
57 # Just in case the image is updated to contain gcc@9
58 # pre-installed but not linked.
59 brew link gcc@9
2c8921db
SG
60 ;;
61 esac
657343a6 62 ;;
0f0c5118
SG
63StaticAnalysis)
64 sudo apt-get -q update
411e4f47 65 sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
61432dd6 66 libexpat-dev gettext make
0f0c5118
SG
67 ;;
68Documentation)
69 sudo apt-get -q update
61432dd6 70 sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns make
f34a1bd9
SG
71
72 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
4fef6321 73 sudo gem install --version 1.5.8 asciidoctor
0f0c5118 74 ;;
6c280b41 75linux-gcc-default|linux-gcc-4.8)
61432dd6
ĐTCD
76 sudo apt-get -q update
77 sudo apt-get -q -y install $UBUNTU_COMMON_PKGS
78 ;;
657343a6
LS
79esac
80
0f0c5118
SG
81if type p4d >/dev/null && type p4 >/dev/null
82then
83 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
84 p4d -V | grep Rev.
85 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
86 p4 -V | grep Rev.
87fi
88if type git-lfs >/dev/null
89then
90 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
91 git-lfs version
92fi