File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ check_deps ()
43
43
echo " Homebrew is not installed (http://brew.sh). You will need to manually ensure the following tools are installed:"
44
44
echo " $REQUIRED_TOOLS "
45
45
echo
46
- echo " Additionally, the following libssh2 files must be symlinked under /usr/local:"
46
+ echo " Additionally, the following libssh2 files must be symlinked under /usr/local or /opt/homebrew :"
47
47
echo " lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h"
48
48
exit $result
49
49
fi
@@ -70,7 +70,13 @@ check_deps ()
70
70
done
71
71
72
72
brew_prefix=` brew --prefix`
73
- expected_prefix=/usr/local
73
+ if [[ ` uname -m` == ' arm64' ]]; then
74
+ echo " Running on a Apple Silicon M1"
75
+ export expected_prefix=/opt/homebrew
76
+ else
77
+ echo " Running on a Apple x86"
78
+ export expected_prefix=/usr/local
79
+ fi
74
80
75
81
if [ " $brew_prefix " != " $expected_prefix " ]
76
82
then
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- # augment path to help it find cmake installed in /usr/local/bin,
6
- # e.g. via brew. Xcode's Run Script phase doesn't seem to honor
7
- # ~/.MacOSX/environment.plist
8
- PATH=" /usr/local/bin:$PATH "
9
-
10
5
cd " External/libgit2"
11
6
12
7
if [ -d " build" ]; then
@@ -17,10 +12,22 @@ mkdir build
17
12
cd build
18
13
19
14
# OpenSSL is keg-only, so add its pkgconfig location manually
20
- export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
15
+ if [[ ` uname -m` == ' arm64' ]]; then
16
+ echo " Running on a Apple Silicon M1"
17
+ export ARCH_PREFIX=/opt/homebrew
18
+ else
19
+ echo " Running on a Apple x86"
20
+ export ARCH_PREFIX=/usr/local
21
+ fi
22
+ export PKG_CONFIG_PATH=$ARCH_PREFIX /opt/openssl/lib/pkgconfig
23
+
24
+ # augment path to help it find cmake installed in /usr/local/bin,
25
+ # e.g. via brew. Xcode's Run Script phase doesn't seem to honor
26
+ # ~/.MacOSX/environment.plist
27
+ PATH=" $ARCH_PREFIX /bin:$PATH "
21
28
22
29
cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
23
- -DLIBSSH2_INCLUDE_DIRS:PATH=/usr/local /include/ \
30
+ -DLIBSSH2_INCLUDE_DIRS:PATH=$ARCH_PREFIX /include/ \
24
31
-DBUILD_CLAR:BOOL=OFF \
25
32
-DTHREADSAFE:BOOL=ON \
26
33
..
You can’t perform that action at this time.
0 commit comments