macOS builds can be created using the Meson buildsystem, compiled using the Clang or GCC compilers, and provided with dependencies using the Homebrew or MacPorts package managers.
We recommend using Homebrew and Clang because Apple's Core SDKs can be used only with Apple's fork of the Clang compiler.
Before installing either Homebrew or MacPorts, Apple's Xcode Command Line Tools need to be installed and the license agreed to.
-
Install the command line tools:
xcode-select --install
and accept the license agreement -
Install software updates: Apple menu > System Preferences > Software Update > "Updates are available: command line tools for Xcode". Click Update Now to proceed.
-
Install build dependencies using either Homebrew or MacPorts.
-
Install Homebrew: https://brew.sh.
-
Install the minimum set of dependencies and related tools:
brew install cmake ccache meson sdl2 sdl2_net opusfile \ pkg-config python3
-
Add
brew
to your shell path:echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME"/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"
-
Install MacPorts: https://www.macports.org/install.php
-
Install the minimum set of dependencies and related tools:
sudo port -q install cmake ccache meson libsdl2 libsdl2_net opusfile \ pkgconfig python311
Once you have dependencies installed using either environment, clone the repository and enter its directory:
cd
mkdir -p src
cd src
git clone https://github.com/dosbox-staging/dosbox-staging.git
cd dosbox-staging
meson setup build
meson compile -C build
See more build options in BUILD.md.
-
Allow the Terminal app to get keyboard events, which will let you launch DOSBox Staging from the command line.
In System Settings > Privacy > Input Monitoring > Terminal (enable)
-
Launch DOSBox Staging:
cd src/dosbox-staging/ ./build/dosbox