-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: support universal macOS binary [skip appveyor]
- Loading branch information
Showing
6 changed files
with
153 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
set -ev | ||
|
||
RIME_ROOT="$(cd "$(dirname "$0")"; pwd)" | ||
|
||
boost_version="${boost_version=1.75.0}" | ||
boost_x_y_z="${boost_version//./_}" | ||
|
||
BOOST_ROOT="${BOOST_ROOT=${RIME_ROOT}/thirdparty/src/boost_${boost_x_y_z}}" | ||
|
||
boost_tarball="boost_${boost_x_y_z}.tar.bz2" | ||
download_url="https://dl.bintray.com/boostorg/release/${boost_version}/source/${boost_tarball}" | ||
boost_tarball_sha256sum_1_75_0='953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb boost_1_75_0.tar.bz2' | ||
boost_tarball_sha256sum="${boost_tarball_sha256sum=${boost_tarball_sha256sum_1_75_0}}" | ||
|
||
download_boost_source() { | ||
cd "${RIME_ROOT}/thirdparty/src" | ||
if ! [[ -f "${boost_tarball}" ]]; then | ||
curl -LO "${download_url}" | ||
fi | ||
echo "${boost_tarball_sha256sum}" | shasum -a 256 -c | ||
tar --bzip2 -xf "${boost_tarball}" | ||
[[ -f "${BOOST_ROOT}/bootstrap.sh" ]] | ||
} | ||
|
||
boost_libs="${boost_libs=filesystem,regex,system}" | ||
boost_cxxflags='-arch arm64 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' | ||
|
||
build_boost_macos() { | ||
cd "${BOOST_ROOT}" | ||
./bootstrap.sh --with-libraries="${boost_libs}" | ||
./b2 -q -a toolset=darwin link=static cxxflags="${boost_cxxflags}" stage | ||
} | ||
|
||
if [[ "$OSTYPE" =~ 'darwin' ]]; then | ||
if ! [[ -f "${BOOST_ROOT}/bootstrap.sh" ]]; then | ||
download_boost_source | ||
fi | ||
build_boost_macos | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#!/bin/bash | ||
|
||
if [[ -n "$BOOST_ROOT" ]]; then | ||
make xcode/thirdparty/boost | ||
fi | ||
make xcode/thirdparty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters