2022-12-28 21:56:20 +10:00
|
|
|
# Building on macOS
|
|
|
|
|
2021-02-18 14:13:40 +01:00
|
|
|
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.
|
|
|
|
|
2021-10-23 11:45:18 -07:00
|
|
|
We recommend using Homebrew and Clang, because Apple's Core SDKs can be
|
2021-02-18 14:13:40 +01:00
|
|
|
used only with Apple's fork of Clang compiler.
|
|
|
|
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2021-02-18 14:13:40 +01:00
|
|
|
## Install Dependencies under macOS
|
|
|
|
|
|
|
|
Before installing either Homebrew or MacPorts, the Apple's Xcode tools need
|
|
|
|
to be installed and the license agreed to:
|
|
|
|
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2021-02-18 14:13:40 +01:00
|
|
|
## Xcode Installation
|
|
|
|
|
|
|
|
1. Install the command line tools: `xcode-select --install`
|
2021-10-23 11:45:18 -07:00
|
|
|
and accept the license agreement
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2021-10-23 11:45:18 -07:00
|
|
|
2. Install software updates:
|
|
|
|
**Apple menu** >
|
|
|
|
**System Preferences** >
|
|
|
|
**Software Update** >
|
|
|
|
*"Updates are available: command line tools for Xcode"*
|
|
|
|
Click **Update Now** to proceed.
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2021-02-18 14:13:40 +01:00
|
|
|
3. Install build dependencies using either Homebrew or MacPorts.
|
|
|
|
|
|
|
|
### Install dependencies (Homebrew)
|
|
|
|
|
|
|
|
1. Install Homebrew: <https://brew.sh>.
|
2021-10-23 11:45:18 -07:00
|
|
|
2. Install dependencies and related tools:
|
2021-02-18 14:13:40 +01:00
|
|
|
|
|
|
|
``` shell
|
2022-12-14 14:42:44 +10:00
|
|
|
brew install cmake ccache meson libpng sdl2 sdl2_image sdl2_net opusfile \
|
|
|
|
fluid-synth libslirp pkg-config python3 speexdsp
|
2021-10-23 11:45:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
3. Add brew to your shell path:
|
|
|
|
|
|
|
|
``` shell
|
|
|
|
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME"/.zprofile
|
|
|
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
2021-02-18 14:13:40 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
### Install dependencies (MacPorts)
|
|
|
|
|
|
|
|
1. Install MacPorts: <https://www.macports.org/install.php>
|
2021-10-23 11:45:18 -07:00
|
|
|
2. Install dependencies and related tools:
|
2021-02-18 14:13:40 +01:00
|
|
|
|
|
|
|
``` shell
|
2022-12-14 14:42:44 +10:00
|
|
|
sudo port -q install cmake ccache meson libpng libsdl2 \
|
|
|
|
libsdl2_image libsdl2_net opusfile fluidsynth libslirp \
|
|
|
|
pkgconfig python310 speexdsp
|
2021-02-18 14:13:40 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
|
|
|
Once you have depenendcies installed using either environment, clone and
|
|
|
|
enter the repository's directory:
|
|
|
|
|
|
|
|
``` shell
|
2021-10-23 11:45:18 -07:00
|
|
|
cd
|
|
|
|
mkdir -p src
|
|
|
|
cd src
|
2021-10-03 08:58:26 -07:00
|
|
|
git clone https://github.com/dosbox-staging/dosbox-staging.git
|
2021-02-18 14:13:40 +01:00
|
|
|
cd dosbox-staging
|
|
|
|
meson setup build
|
2022-12-14 14:42:44 +10:00
|
|
|
meson compile -C build
|
2021-02-18 14:13:40 +01:00
|
|
|
```
|
|
|
|
|
2021-10-23 11:45:18 -07:00
|
|
|
See more build options in [BUILD.md](/BUILD.md).
|
|
|
|
|
2022-12-14 14:42:44 +10:00
|
|
|
|
2021-10-23 11:45:18 -07:00
|
|
|
## Permissions and Running
|
|
|
|
|
|
|
|
1. Allow the terminal to get keyboard events, which will let you
|
|
|
|
launch dosbox from the command line.
|
2022-05-17 09:23:01 +10:00
|
|
|
|
2021-10-23 11:45:18 -07:00
|
|
|
In System Settings > Privacy > Input Monitoring > Terminal (enable)
|
2022-05-17 09:23:01 +10:00
|
|
|
|
2021-10-23 11:45:18 -07:00
|
|
|
2. Launch DOSBox Staging:
|
|
|
|
|
|
|
|
``` shell
|
|
|
|
cd src/dosbox-staging/
|
|
|
|
./build/dosbox
|
|
|
|
```
|