Skip to content

Commit

Permalink
LibGit2: use OpenSSL
Browse files Browse the repository at this point in the history
Also, disable linking to mbedTLS

Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
  • Loading branch information
fxcoudert and giordano committed Mar 29, 2024
1 parent ff851f4 commit 47f0e55
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions L/LibGit2/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ BUILD_FLAGS=(
-DCMAKE_BUILD_TYPE=Release
-DUSE_THREADS=ON
-DUSE_BUNDLED_ZLIB=ON
-DUSE_HTTPS=OpenSSL
-DUSE_SHA1=CollisionDetection
-DUSE_SSH=ON
-DBUILD_CLI=OFF
"-DCMAKE_INSTALL_PREFIX=${prefix}"
"-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TARGET_TOOLCHAIN}""
# Make sure we don't link to mbedTLS:
# <https://github.com/JuliaPackaging/Yggdrasil/pull/8377#issuecomment-2027370830>.
# TODO: this hack can be removed when we'll link to a newer version of libssh2 which
# doesn't link to mbedTLS.
-DLIBSSH2_LDFLAGS="-L${libdir};-lssh2"
-DLIBSSH2_LIBRARIES="ssh2"
)
if [[ ${bb_full_target} == *-sanitize+memory* ]]; then
Expand All @@ -37,9 +45,11 @@ if [[ ${target} == *-mingw* ]]; then
# For some reason, CMake fails to find libssh2 using pkg-config.
BUILD_FLAGS+=(-Dssh2_RESOLVED=${bindir}/libssh2.dll)
elif [[ ${target} == *linux* ]] || [[ ${target} == *freebsd* ]]; then
# If we're on Linux or FreeBSD, explicitly ask for mbedTLS instead of OpenSSL
BUILD_FLAGS+=(-DUSE_HTTPS=mbedTLS -DUSE_SHA1=CollisionDetection -DCMAKE_INSTALL_RPATH="\$ORIGIN")
fi
# Necessary for cmake to find openssl on Windows
if [[ ${target} == x86_64-*-mingw* ]]; then
export OPENSSL_ROOT_DIR=${prefix}/lib64
fi
mkdir build && cd build
Expand All @@ -63,8 +73,8 @@ llvm_version = v"13.0.1"

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("MbedTLS_jll"; compat="~2.28.0"),
Dependency("LibSSH2_jll"; compat="1.11.0"),
Dependency("OpenSSL_jll"; compat="3.0.8"),
BuildDependency(PackageSpec(name="LLVMCompilerRT_jll", uuid="4e17d02c-6bf5-513e-be62-445f41c75a11", version=llvm_version);
platforms=filter(p -> sanitize(p)=="memory", platforms)),
]
Expand Down

0 comments on commit 47f0e55

Please sign in to comment.