Skip to content

Commit 0cd0576

Browse files
committed
Remove libssh2 build for macos
1 parent 290b507 commit 0cd0576

1 file changed

Lines changed: 1 addition & 47 deletions

File tree

build.libgit2.sh

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ OS=`uname`
88
ARCH=`uname -m`
99
PACKAGEPATH="nuget.package/runtimes"
1010
OSXARCHITECTURE=$ARCH
11-
LIBSSH2_VERSION="1.11.1"
12-
LIBSSH2_SHA256="d9ec76cbe34db98eec3539fe2c899d26b0c837cb3eb466a56b0f109cabf658f7"
1311

1412
EXTRA_CMAKE_FLAGS=""
1513

@@ -20,32 +18,6 @@ if [[ $OS == "Darwin" ]]; then
2018
elif [[ $RID == "osx-x64" ]]; then
2119
OSXARCHITECTURE="x86_64"
2220
fi
23-
24-
# Build libssh2 from source with SecureTransport backend
25-
echo "Building libssh2 ${LIBSSH2_VERSION} from source with SecureTransport..."
26-
LIBSSH2_SRC="libssh2-${LIBSSH2_VERSION}"
27-
if [[ ! -d "$LIBSSH2_SRC" ]]; then
28-
curl -L -o libssh2.tar.gz \
29-
"https://github.com/libssh2/libssh2/releases/download/libssh2-${LIBSSH2_VERSION}/libssh2-${LIBSSH2_VERSION}.tar.gz"
30-
echo "${LIBSSH2_SHA256} libssh2.tar.gz" | shasum -a 256 --check
31-
tar xzf libssh2.tar.gz
32-
fi
33-
LIBSSH2_INSTALL="$PWD/libssh2-install"
34-
rm -rf "$LIBSSH2_SRC/build-dir" "$LIBSSH2_INSTALL"
35-
mkdir -p "$LIBSSH2_SRC/build-dir"
36-
pushd "$LIBSSH2_SRC/build-dir"
37-
cmake -DCMAKE_BUILD_TYPE=Release \
38-
-DCRYPTO_BACKEND=SecureTransport \
39-
-DBUILD_SHARED_LIBS=ON \
40-
-DBUILD_EXAMPLES=OFF \
41-
-DBUILD_TESTING=OFF \
42-
-DCMAKE_OSX_ARCHITECTURES=$OSXARCHITECTURE \
43-
-DCMAKE_INSTALL_PREFIX="$LIBSSH2_INSTALL" \
44-
..
45-
cmake --build . --target install
46-
popd
47-
48-
EXTRA_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=$LIBSSH2_INSTALL"
4921
else
5022
USEHTTPS="OpenSSL-Dynamic"
5123
fi
@@ -89,25 +61,7 @@ cp libgit2/build/libgit2-$SHORTSHA.$LIBEXT $PACKAGEPATH/$RID/native
8961
LIBGIT2_PATH="$PACKAGEPATH/$RID/native/libgit2-$SHORTSHA.$LIBEXT"
9062

9163
if [[ $OS == "Darwin" ]]; then
92-
# Find the libssh2 dylib linked by libgit2
93-
LIBSSH2_REF=$(otool -L "$LIBGIT2_PATH" | grep libssh2 | awk '{print $1}')
94-
if [[ -z "$LIBSSH2_REF" ]]; then
95-
echo "ERROR: libgit2 does not appear to link against libssh2"
96-
exit 1
97-
fi
98-
99-
# The reference may be to the install prefix; resolve the actual file
100-
LIBSSH2_REALPATH=$(python3 -c "import os; print(os.path.realpath('$LIBSSH2_REF'))")
101-
LIBSSH2_BASENAME=$(basename "$LIBSSH2_REALPATH")
102-
103-
echo "Bundling $LIBSSH2_BASENAME from $LIBSSH2_REALPATH"
104-
cp "$LIBSSH2_REALPATH" "$PACKAGEPATH/$RID/native/$LIBSSH2_BASENAME"
105-
106-
# Rewrite libgit2's reference to use @loader_path
107-
install_name_tool -change "$LIBSSH2_REF" "@loader_path/$LIBSSH2_BASENAME" "$LIBGIT2_PATH"
108-
109-
# Set libssh2's own install name
110-
install_name_tool -id "@loader_path/$LIBSSH2_BASENAME" "$PACKAGEPATH/$RID/native/$LIBSSH2_BASENAME"
64+
echo "macOS: libssh2 sourced from global installation"
11165
else
11266
# Linux: find libssh2 via ldd
11367
LIBSSH2_PATH=$(ldd "$LIBGIT2_PATH" | grep libssh2 | awk '{print $3}')

0 commit comments

Comments
 (0)