Update osxcross to latest version, use pre-built MacOS SDK

This commit is contained in:
Matthew Little
2019-06-04 19:41:22 -04:00
parent fd8fc4a3ba
commit d4f764f6c8
2 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

@@ -68,3 +68,4 @@ Cargo.lock
**/*.rs.bk
node_modules
osxcross

View File

@@ -4,26 +4,34 @@
### This script uses osxcross [https://github.com/tpoechtrager/osxcross] to cross-compile from linux to MacOS.
set -e
cd "$(dirname "$(dirname "$0")")"
apt-get update
apt-get install -y clang
build_sdk () {
apt-get update
apt-get install -y clang cmake
git clone https://github.com/blockstackpbc/osxcross --depth=1
wget -nc https://github.com/blockstackpbc/osxcross/releases/download/v1/MacOSX10.14.sdk.tar.bz2 --directory-prefix=osxcross/tarballs/
UNATTENDED=yes OSX_VERSION_MIN=10.7 ./osxcross/build.sh
BINARYPACKAGE=1 ./package.sh
}
git clone https://github.com/tpoechtrager/osxcross.git --depth=1
### Download a pre-bundled osx-sdk. The official method requires downloading and extracting the
### sdk from a 5.2GB Xcode_7.x.dmg file, which requires an Apple ID to download.
wget -nc https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.11.sdk.tar.xz --directory-prefix=osxcross/tarballs/
UNATTENDED=yes OSX_VERSION_MIN=10.7 ./osxcross/build.sh
fetch_extract_sdk() {
wget -nc "https://github.com/blockstackpbc/osxcross/releases/download/v1/osxcross-e0a1718_xcode-v10.2.1.tar.xz"
echo "Extracting osxcross package..."
tar --checkpoint=1000 -xf "osxcross-e0a1718_xcode-v10.2.1.tar.xz"
}
fetch_extract_sdk
rustup target add x86_64-apple-darwin
PATH="$(pwd)/osxcross/target/bin:$PATH" \
PATH="$(pwd)/osxcross/bin:$PATH" \
CC=o64-clang \
CXX=o64-clang++ \
LIBZ_SYS_STATIC=1 \
CC_x86_64_apple_darwin=x86_64-apple-darwin15-clang \
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=x86_64-apple-darwin15-clang \
CARGO_TARGET_X86_64_APPLE_DARWIN_AR=x86_64-apple-darwin15-ar \
CC_x86_64_apple_darwin=x86_64-apple-darwin18-clang \
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=x86_64-apple-darwin18-clang \
CARGO_TARGET_X86_64_APPLE_DARWIN_AR=x86_64-apple-darwin18-ar \
cargo build --target x86_64-apple-darwin --release