Skip to content

Instantly share code, notes, and snippets.

@cfstras
Last active February 25, 2022 03:22
Show Gist options
  • Save cfstras/f741087c77a899d5f77eb4664c5b4a70 to your computer and use it in GitHub Desktop.
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)
#!/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)"
@cfstras
Copy link
Author

cfstras commented Sep 11, 2021

@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

@tristan-k
Copy link

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