Last active
February 25, 2022 03:22
-
-
Save cfstras/f741087c77a899d5f77eb4664c5b4a70 to your computer and use it in GitHub Desktop.
Script to compile mumble natively on an M1 Mac (using my branch cfstras/mumble:arm-m1-mac)
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
#!/bin/bash | |
# Notes on building Mumble on an M1 mac | |
set -euo pipefail | |
ARM=(arch -arm64) | |
BREW=( | |
/opt/homebrew/bin/brew | |
) | |
BUILD_DIR=build | |
FLAGS=( | |
# add this if you want to build and debug with XCode | |
#-G Xcode | |
-Dice=off | |
# Build with debug or release | |
-DCMAKE_BUILD_TYPE=Release | |
) | |
## If you want error output... | |
#export VERBOSE=1 | |
function install_packages() { | |
function brewUp() { | |
if "${BREW[@]}" ls --versions "$1"; then | |
"${BREW[@]}" upgrade "$1" | |
else | |
"${BREW[@]}" install "$1" | |
fi | |
} | |
"${BREW[@]}" update | |
export HOMEBREW_NO_AUTO_UPDATE=1 | |
brewUp cmake | |
brewUp pkg-config | |
brewUp qt5 | |
brewUp boost | |
brewUp libogg | |
brewUp libvorbis | |
brewUp flac | |
brewUp libsndfile | |
brewUp protobuf | |
brewUp openssl | |
brewUp ice | |
} | |
make_links() { | |
if [[ -f /opt/homebrew/opt/qt5/ ]]; then | |
sudo ln -fs /opt/homebrew/opt /usr/local/opt | |
fi | |
} | |
function clean() { | |
rm -rf $BUILD_DIR | |
} | |
function mkdirs() { | |
mkdir -p $BUILD_DIR | |
cd $BUILD_DIR | |
} | |
function configure() { | |
"${ARM[@]}" cmake "${FLAGS[@]}" .. | |
} | |
function build() { | |
"${ARM[@]}" cmake --build . -j5 | |
} | |
( | |
set -x | |
## You can comment-out individual steps if you don't want to re-run them. | |
install_packages | |
clean | |
mkdirs | |
make_links | |
configure | |
build | |
) | |
echo | |
echo "Done! your app is in $BUILD_DIR/Mumble.app" | |
echo "... (Or, if you built with XCode, in build/Debug/Mumble.app/Contents/MacOS/Mumble)" |
Thanks for the heads-up. I guess will have to wait then. If you need someone for testing just holler.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tristan-k I recommend using the regular amd64 version with rosetta. The native build still has a lot of problems that make it pretty unusable (crashes when switching audio devices, no hotkey support, …)
See „Caveats“ here: mumble-voip/mumble#4765