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 ()
4343        echo  " Homebrew is not installed (http://brew.sh). You will need to manually ensure the following tools are installed:" 
4444        echo  "   $REQUIRED_TOOLS " 
4545        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  :" 
4747        echo  "   lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h" 
4848        exit  $result 
4949    fi 
@@ -70,7 +70,13 @@ check_deps ()
7070    done 
7171
7272    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 
7480
7581    if  [ " $brew_prefix "   !=  " $expected_prefix "   ]
7682    then 
Original file line number Diff line number Diff line change 22
33set  -e
44
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- 
105cd  " External/libgit2" 
116
127if  [ -d  " build"   ];  then 
@@ -17,10 +12,22 @@ mkdir build
1712cd  build
1813
1914#  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 " 
2128
2229cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
23-     -DLIBSSH2_INCLUDE_DIRS:PATH=/usr/local /include/ \
30+     -DLIBSSH2_INCLUDE_DIRS:PATH=$ARCH_PREFIX /include/ \
2431    -DBUILD_CLAR:BOOL=OFF \
2532    -DTHREADSAFE:BOOL=ON \
2633    ..
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments