#!/bin/sh -ex DIR="$1" case $(uname -s) in Darwin) CURLDIR="$(brew --prefix curl)";; Linux) export DEBIAN_FRONTEND=noninteractive if test -f /etc/apt/sources.list.d/ubuntu.sources; then # Ubuntu 24.04 sed -e 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources | sudo tee /etc/apt/sources.list.d/ubuntu.sources else # Ubuntu 22.04 and earlier sed -e 's/^deb/deb-src/' /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/src.list fi sudo apt-get update sudo apt-get install build-essential sudo apt-get -y build-dep git;; esac GIT_INSTALL_PATH="${GIT_INSTALL_DIR:-"/usr/local"}" cd "$DIR" # Hide macros defined in Git v2.33.x and earlier which now conflict with # macros defined by curl since v8.13.0. if grep -q "CURLOPT_USE_SSL" http.h; then cat < config.mak if test -n "$CURLDIR"; then printf "%s\n" \ "CURLDIR=$CURLDIR" \ >> config.mak fi make -j4 sudo make install echo "Git version:" git --version --build-options echo "Git library dependencies:" case $(uname -s) in Darwin) otool -L "$(git --exec-path)/git-http-fetch";; Linux) ldd "$(git --exec-path)/git-http-fetch";; esac