ci: drop duplicate package installation for "linux-gcc-default"
[alt-git.git] / ci / install-dependencies.sh
blobfad53aac96961f7acca455d56ffec4d6e32b5f81
1 #!/usr/bin/env bash
3 # Install dependencies required to build and test Git on Linux and macOS
6 . ${0%/*}/lib.sh
8 P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
9 LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
11 # Make sudo a no-op and execute the command directly when running as root.
12 # While using sudo would be fine on most platforms when we are root already,
13 # some platforms like e.g. Alpine Linux do not have sudo available by default
14 # and would thus break.
15 if test "$(id -u)" -eq 0
16 then
17 sudo () {
18 "$@"
22 case "$distro" in
23 ubuntu-*)
24 sudo apt-get -q update
25 sudo apt-get -q -y install \
26 language-pack-is libsvn-perl apache2 \
27 make libssl-dev libcurl4-openssl-dev libexpat-dev \
28 tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl \
29 libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl \
30 $CC_PACKAGE $PYTHON_PACKAGE
32 mkdir --parents "$P4_PATH"
33 pushd "$P4_PATH"
34 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
35 wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
36 chmod u+x p4d
37 chmod u+x p4
38 popd
40 mkdir --parents "$GIT_LFS_PATH"
41 pushd "$GIT_LFS_PATH"
42 wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
43 tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
44 cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
45 popd
47 macos-*)
48 export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
49 # Uncomment this if you want to run perf tests:
50 # brew install gnu-time
51 test -z "$BREW_INSTALL_PACKAGES" ||
52 brew install $BREW_INSTALL_PACKAGES
53 brew link --force gettext
55 mkdir -p "$P4_PATH"
56 pushd "$P4_PATH"
57 wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
58 tar -xf helix-core-server.tgz &&
59 sudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true
60 popd
62 if test -n "$CC_PACKAGE"
63 then
64 BREW_PACKAGE=${CC_PACKAGE/-/@}
65 brew install "$BREW_PACKAGE"
66 brew link "$BREW_PACKAGE"
69 esac
71 case "$jobname" in
72 StaticAnalysis)
73 sudo apt-get -q update
74 sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
75 libexpat-dev gettext make
77 sparse)
78 sudo apt-get -q update -q
79 sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \
80 libexpat-dev gettext zlib1g-dev
82 Documentation)
83 sudo apt-get -q update
84 sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns make
86 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
87 sudo gem install --version 1.5.8 asciidoctor
89 esac
91 if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1
92 then
93 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
94 p4d -V
95 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
96 p4 -V
97 else
98 echo >&2 "WARNING: perforce wasn't installed, see above for clues why"
100 if type git-lfs >/dev/null 2>&1
101 then
102 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
103 git-lfs version
104 else
105 echo >&2 "WARNING: git-lfs wasn't installed, see above for clues why"