forked from github/SoftU2F
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·32 lines (25 loc) · 1.06 KB
/
Copy pathbootstrap
File metadata and controls
executable file
·32 lines (25 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
# SDK for oldest supported macOS version
SDK_VERSION=10.12
SDK_SHA=0628a563de14020c2600beb1d991547c6b492eb82e0cac4b11104d33faaa00e6
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
BUILD_DIR=$REPO_DIR/build
SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$SDK_VERSION.sdk
mkdir -p $BUILD_DIR
# symlink the sdk into the xcode application, but clean up after ourselves
if [ ! -d $SDK_PATH ]; then
LOCAL_SDK_PATH=$BUILD_DIR/MacOSX$SDK_VERSION.sdk
if [ ! -d $LOCAL_SDK_PATH ]; then
echo "Downloading SDK"
SDK_ARCHIVE_PATH=$LOCAL_SDK_PATH.tar.xz
curl -L -s -o $SDK_ARCHIVE_PATH https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX$SDK_VERSION.sdk.tar.xz
shasum -a256 $SDK_ARCHIVE_PATH | grep $SDK_SHA > /dev/null
echo "Extracting SDK"
tar -C $BUILD_DIR -xf $SDK_ARCHIVE_PATH
rm $SDK_ARCHIVE_PATH
fi
# download SDK, if missing
echo "Symlinking SDK into Xcode"
sudo ln -s $LOCAL_SDK_PATH $SDK_PATH
fi