3 # Install dependencies required to build and test Git on Linux and macOS
8 begin_group
"Install dependencies"
10 P4WHENCE
=https
://cdist2.perforce.com
/perforce
/r23.2
11 LFSWHENCE
=https
://github.com
/github
/git-lfs
/releases
/download
/v
$LINUX_GIT_LFS_VERSION
12 JGITWHENCE
=https
://repo.eclipse.org
/content
/groups
/releases
//org
/eclipse
/jgit
/org.eclipse.jgit.pgm
/6.8.0.202311291450-r/org.eclipse.jgit.pgm-6.8
.0.202311291450-r.sh
14 # Make sudo a no-op and execute the command directly when running as root.
15 # While using sudo would be fine on most platforms when we are root already,
16 # some platforms like e.g. Alpine Linux do not have sudo available by default
17 # and would thus break.
18 if test "$(id -u)" -eq 0
27 apk add
--update shadow sudo build-base curl-dev openssl-dev expat-dev
gettext \
28 pcre2-dev python3 musl-libintl perl-utils ncurses \
29 apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
30 bash cvs gnupg perl-cgi perl-dbd-sqlite perl-io-tty
>/dev
/null
33 dnf
-yq update
>/dev
/null
&&
34 dnf
-yq install make gcc findutils diffutils perl python3
gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel
>/dev
/null
37 # Required so that apt doesn't wait for user input on certain packages.
38 export DEBIAN_FRONTEND
=noninteractive
42 SVN
='libsvn-perl subversion'
49 sudo apt-get
-q update
50 sudo apt-get
-q -y install \
51 language-pack-is apache2 cvs cvsps git gnupg
$SVN \
52 make libssl-dev libcurl4-openssl-dev libexpat-dev wget sudo default-jre \
53 tcl tk
gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl \
54 libemail-valid-perl libio-pty-perl libio-socket-ssl-perl libnet-smtp-ssl-perl libdbd-sqlite3-perl libcgi-pm-perl \
55 ${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE
59 # Does not support JGit, but we also don't really care about
60 # the others. We rather care whether Git still compiles and
64 mkdir
--parents "$CUSTOM_PATH"
66 wget
--quiet --directory-prefix="$CUSTOM_PATH" \
67 "$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
68 chmod a
+x
"$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
70 wget
--quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
71 tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
72 -C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
73 rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
75 wget
--quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit"
76 chmod a
+x
"$CUSTOM_PATH/jgit"
81 export HOMEBREW_NO_AUTO_UPDATE
=1 HOMEBREW_NO_INSTALL_CLEANUP
=1
82 # Uncomment this if you want to run perf tests:
83 # brew install gnu-time
84 brew link
--force gettext
86 mkdir
-p "$CUSTOM_PATH"
87 wget
-q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
88 tar -xf helix-core-server.tgz
-C "$CUSTOM_PATH" p4 p4d
&&
89 sudo xattr
-d com.apple.quarantine
"$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev
/null || true
90 rm helix-core-server.tgz
92 if test -n "$CC_PACKAGE"
94 BREW_PACKAGE
=${CC_PACKAGE/-/@}
95 brew
install "$BREW_PACKAGE"
96 brew link
"$BREW_PACKAGE"
103 sudo apt-get
-q update
104 sudo apt-get
-q -y install clang-format
107 sudo apt-get
-q update
108 sudo apt-get
-q -y install coccinelle libcurl4-openssl-dev libssl-dev \
109 libexpat-dev
gettext make
112 sudo apt-get
-q update
-q
113 sudo apt-get
-q -y install libssl-dev libcurl4-openssl-dev \
114 libexpat-dev
gettext zlib1g-dev
117 sudo apt-get
-q update
118 sudo apt-get
-q -y install asciidoc xmlto docbook-xsl-ns
make
120 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
121 sudo gem
install --version 1.5.8 asciidoctor
122 sudo gem
install concurrent-ruby
126 if type p4d
>/dev
/null
2>&1 && type p4
>/dev
/null
2>&1
128 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
130 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
133 echo >&2 "WARNING: perforce wasn't installed, see above for clues why"
136 if type git-lfs
>/dev
/null
2>&1
138 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
141 echo >&2 "WARNING: git-lfs wasn't installed, see above for clues why"
144 if type jgit
>/dev
/null
2>&1
146 echo "$(tput setaf 6)JGit Version$(tput sgr0)"
149 echo >&2 "WARNING: JGit wasn't installed, see above for clues why"
152 end_group
"Install dependencies"