-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch macOS multi-arch to x86_64+arm64
The previous CI attemtped to use Homebrew for builds, but unfortunately Homebrew has dropped support for universal packages aka multiarch (fat) binaries. This means that in order to build an arm64 + x86_64 package, macports has to be used instead of homebrew. Unlike Homebrew, MacPorts is not installed by default on the GitHub Actions runners, so we need to install it ourselves. This means managing our own instance of the cache, which itself produces challenges as the `gtar` binary run by the action doesn't have enough permissions to restore the MacPorts checkout. So we have to shim gtar with a sudo wrapper. With this commit, we produce a Mosh package that works on macOS 11.0 and newer, on both arm64 and x86_64 architectures. The protobuf library is statically linked, but all other libraries are provided by the system.
- Loading branch information
Showing
4 changed files
with
85 additions
and
16 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,2 @@ | ||
#!/bin/sh | ||
exec sudo /usr/local/bin/gtar.orig "$@" |
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,16 @@ | ||
describe() { | ||
/opt/local/bin/port version > port-version.txt | ||
/opt/local/bin/port -v -q installed > port-packages.txt | ||
} | ||
|
||
deps() { | ||
# Set up macports to respect the deployment target before building universal packages | ||
echo "macosx_deployment_target 11.0" | sudo tee -a /opt/local/etc/macports/macports.conf | ||
sudo /opt/local/bin/port install protobuf3-cpp +universal | ||
sudo /opt/local/bin/port install ncurses +universal | ||
sudo /opt/local/bin/port install pkgconfig | ||
sudo /opt/local/bin/port install autoconf automake | ||
} | ||
|
||
set -e | ||
"$@" |