fix git link: use CURL_LIBCURL for static deps (#66)

This commit is contained in:
Adeeb Shihadeh
2026-03-24 11:20:08 -07:00
committed by GitHub
parent 54dafe6c1b
commit 2f5b981c19
2 changed files with 16 additions and 6 deletions

View File

@@ -103,10 +103,16 @@ fi
git -C git-src fetch --depth 1 origin "v${VERSION}"
git -C git-src checkout --force FETCH_HEAD
# Gather static link flags for curl's dependencies
CURL_LDFLAGS="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz"
# Gather static link flags for curl and openssl dependencies
# CURL_LIBCURL: used by git-remote-http, git-http-fetch, git-http-push
# LIB_4_CRYPTO: used by git-imap-send and other direct openssl consumers
# Both need transitive deps (-ldl, -lpthread) since we link statically
CRYPTO_DEPS="-lpthread"
CURL_EXTRA=""
if [ "$PLATFORM" = "Linux" ]; then
CURL_LDFLAGS="$CURL_LDFLAGS -lpthread -ldl"
CRYPTO_DEPS="$CRYPTO_DEPS -ldl"
elif [ "$PLATFORM" = "Darwin" ]; then
CURL_EXTRA="-framework SystemConfiguration -framework Security -framework CoreFoundation"
fi
cd git-src
@@ -119,7 +125,9 @@ make prefix="$PREFIX" \
NO_EXPAT=YesPlease \
INSTALL_SYMLINKS=1 \
CURLDIR="$PREFIX" \
CURL_LDFLAGS="$CURL_LDFLAGS" \
CURL_LIBCURL="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz $CRYPTO_DEPS $CURL_EXTRA" \
OPENSSL_LIBSSL="-L$PREFIX/lib -lssl" \
LIB_4_CRYPTO="-lcrypto $CRYPTO_DEPS" \
ZLIB_PATH="$PREFIX" \
-j"$NJOBS" \
all
@@ -132,7 +140,9 @@ make prefix="$PREFIX" \
NO_EXPAT=YesPlease \
INSTALL_SYMLINKS=1 \
CURLDIR="$PREFIX" \
CURL_LDFLAGS="$CURL_LDFLAGS" \
CURL_LIBCURL="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz $CRYPTO_DEPS $CURL_EXTRA" \
OPENSSL_LIBSSL="-L$PREFIX/lib -lssl" \
LIB_4_CRYPTO="-lcrypto $CRYPTO_DEPS" \
ZLIB_PATH="$PREFIX" \
install
cd "$DIR"

View File

@@ -15,7 +15,7 @@ run_as_root() {
}
if [ "$(uname)" = "Darwin" ]; then
brew install nasm pkg-config ccache
brew install nasm pkg-config ccache autoconf automake libtool
elif command -v dnf &>/dev/null; then
dnf install -y nasm cmake gcc-c++ pkgconfig git perl-IPC-Cmd ccache autoconf automake libtool
elif command -v apt-get &>/dev/null; then