Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ check_deps ()
echo "Homebrew is not installed (http://brew.sh). You will need to manually ensure the following tools are installed:"
echo " $REQUIRED_TOOLS"
echo
echo "Additionally, the following libssh2 files must be symlinked under /usr/local:"
echo "Additionally, the following libssh2 files must be symlinked under /usr/local or /opt/homebrew :"
echo " lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h"
exit $result
fi
Expand All @@ -70,7 +70,13 @@ check_deps ()
done

brew_prefix=`brew --prefix`
expected_prefix=/usr/local
if [[ `uname -m` == 'arm64' ]]; then
echo "Running on a Apple Silicon M1"
export expected_prefix=/opt/homebrew
else
echo "Running on a Apple x86"
export expected_prefix=/usr/local
fi

if [ "$brew_prefix" != "$expected_prefix" ]
then
Expand Down
21 changes: 14 additions & 7 deletions script/update_libgit2
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -e

# augment path to help it find cmake installed in /usr/local/bin,
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
# ~/.MacOSX/environment.plist
PATH="/usr/local/bin:$PATH"

cd "External/libgit2"

if [ -d "build" ]; then
Expand All @@ -17,10 +12,22 @@ mkdir build
cd build

# OpenSSL is keg-only, so add its pkgconfig location manually
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
if [[ `uname -m` == 'arm64' ]]; then
echo "Running on a Apple Silicon M1"
export ARCH_PREFIX=/opt/homebrew
else
echo "Running on a Apple x86"
export ARCH_PREFIX=/usr/local
fi
export PKG_CONFIG_PATH=$ARCH_PREFIX/opt/openssl/lib/pkgconfig

# augment path to help it find cmake installed in /usr/local/bin,
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
# ~/.MacOSX/environment.plist
PATH="$ARCH_PREFIX/bin:$PATH"

cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
-DLIBSSH2_INCLUDE_DIRS:PATH=/usr/local/include/ \
-DLIBSSH2_INCLUDE_DIRS:PATH=$ARCH_PREFIX/include/ \
-DBUILD_CLAR:BOOL=OFF \
-DTHREADSAFE:BOOL=ON \
..
Expand Down