Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #58 from github/fix10.12
Browse files Browse the repository at this point in the history
Build with macosx10.12 SDK
  • Loading branch information
mastahyeti authored Sep 26, 2018
2 parents 9031092 + d96b61f commit 71ec3f3
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 18 deletions.
22 changes: 13 additions & 9 deletions SoftU2F.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = VEKTX9H2N7;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
SystemCapabilities = {
com.apple.Keychain = {
enabled = 1;
Expand Down Expand Up @@ -1131,8 +1131,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SoftU2FTool/SoftU2FTool.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = VEKTX9H2N7;
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/inc/**";
Expand All @@ -1141,7 +1141,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.github.SoftU2FToolApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = SoftU2FTool;
SWIFT_OBJC_BRIDGING_HEADER = "SoftU2FTool/SoftU2F-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
Expand All @@ -1156,8 +1156,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SoftU2FTool/SoftU2FTool.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = VEKTX9H2N7;
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/inc/**";
Expand All @@ -1166,7 +1166,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.github.SoftU2FToolApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = SoftU2FTool;
SWIFT_OBJC_BRIDGING_HEADER = "SoftU2FTool/SoftU2F-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
Expand Down Expand Up @@ -1224,17 +1224,19 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.0.0d1;
DEVELOPMENT_TEAM = VEKTX9H2N7;
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/inc";
INFOPLIST_FILE = SoftU2FDriver/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MODULE_NAME = com.github.SoftU2FDriver;
MODULE_VERSION = 1.0.0d1;
PRODUCT_BUNDLE_IDENTIFIER = com.github.SoftU2FDriver;
PRODUCT_NAME = softu2f;
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx10.12;
WRAPPER_EXTENSION = kext;
};
name = Debug;
Expand All @@ -1243,17 +1245,19 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.0.0d1;
DEVELOPMENT_TEAM = VEKTX9H2N7;
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/inc";
INFOPLIST_FILE = SoftU2FDriver/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MODULE_NAME = com.github.SoftU2FDriver;
MODULE_VERSION = 1.0.0d1;
PRODUCT_BUNDLE_IDENTIFIER = com.github.SoftU2FDriver;
PRODUCT_NAME = softu2f;
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx10.12;
WRAPPER_EXTENSION = kext;
};
name = Release;
Expand Down
32 changes: 32 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
5 changes: 1 addition & 4 deletions script/build
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash

set -e

REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
BUILD_DIR=$REPO_DIR/build
KEXT_PATH=$BUILD_DIR/Debug/softu2f.kext
source $REPO_DIR/script/bootstrap

if [ -d $KEXT_PATH ] && [ ! -w $KEXT_PATH ]; then
echo "softu2f.kext owned by root. Removing before build."
Expand Down
8 changes: 3 additions & 5 deletions script/package
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash

set -e

REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
BUILD_DIR=$REPO_DIR/build
source $REPO_DIR/script/bootstrap

sudo rm -rf $BUILD_DIR
mkdir $BUILD_DIR
sudo rm -rf $BUILD_DIR/bundles
mkdir -p $BUILD_DIR

xcodebuild -scheme SoftU2F install DSTROOT=$BUILD_DIR/bundles

Expand Down

0 comments on commit 71ec3f3

Please sign in to comment.