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
/r21.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
>/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
40 sudo apt-get
-q update
41 sudo apt-get
-q -y install \
42 language-pack-is libsvn-perl apache2 cvs cvsps git gnupg subversion \
43 make libssl-dev libcurl4-openssl-dev libexpat-dev wget sudo default-jre \
44 tcl tk
gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl \
45 libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl libdbd-sqlite3-perl libcgi-pm-perl \
46 ${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE
48 mkdir
--parents "$CUSTOM_PATH"
49 wget
--quiet --directory-prefix="$CUSTOM_PATH" \
50 "$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
51 chmod a
+x
"$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
53 wget
--quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
54 tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
55 -C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
56 rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
58 wget
--quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit"
59 chmod a
+x
"$CUSTOM_PATH/jgit"
62 sudo linux32
--32bit i386 sh
-c '
63 apt update >/dev/null &&
64 apt install -y build-essential libcurl4-openssl-dev \
65 libssl-dev libexpat-dev gettext python >/dev/null
69 export HOMEBREW_NO_AUTO_UPDATE
=1 HOMEBREW_NO_INSTALL_CLEANUP
=1
70 # Uncomment this if you want to run perf tests:
71 # brew install gnu-time
72 brew link
--force gettext
74 mkdir
-p "$CUSTOM_PATH"
75 wget
-q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
76 tar -xf helix-core-server.tgz
-C "$CUSTOM_PATH" p4 p4d
&&
77 sudo xattr
-d com.apple.quarantine
"$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev
/null || true
78 rm helix-core-server.tgz
80 if test -n "$CC_PACKAGE"
82 BREW_PACKAGE
=${CC_PACKAGE/-/@}
83 brew
install "$BREW_PACKAGE"
84 brew link
"$BREW_PACKAGE"
91 sudo apt-get
-q update
92 sudo apt-get
-q -y install coccinelle libcurl4-openssl-dev libssl-dev \
93 libexpat-dev
gettext make
96 sudo apt-get
-q update
-q
97 sudo apt-get
-q -y install libssl-dev libcurl4-openssl-dev \
98 libexpat-dev
gettext zlib1g-dev
101 sudo apt-get
-q update
102 sudo apt-get
-q -y install asciidoc xmlto docbook-xsl-ns
make
104 test -n "$ALREADY_HAVE_ASCIIDOCTOR" ||
105 sudo gem
install --version 1.5.8 asciidoctor
109 if type p4d
>/dev
/null
2>&1 && type p4
>/dev
/null
2>&1
111 echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
113 echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
116 echo >&2 "WARNING: perforce wasn't installed, see above for clues why"
119 if type git-lfs
>/dev
/null
2>&1
121 echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
124 echo >&2 "WARNING: git-lfs wasn't installed, see above for clues why"
127 if type jgit
>/dev
/null
2>&1
129 echo "$(tput setaf 6)JGit Version$(tput sgr0)"
132 echo >&2 "WARNING: JGit wasn't installed, see above for clues why"
135 end_group
"Install dependencies"