mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 05:17:40 -07:00
5e8beb3ab7
Some checks are pending
macOS / ${{ matrix.arch }} (arm64) (push) Waiting to run
macOS / ${{ matrix.arch }} (x86_64) (push) Waiting to run
macOS / Universal binary (push) Blocked by required conditions
Ubuntu / x86_64 (push) Waiting to run
Ubuntu / aarch64 (push) Waiting to run
Windows / build (push) Waiting to run
3.7 KiB
3.7 KiB
Building melonDS
Linux
- Install dependencies:
- Ubuntu:
- All versions:
sudo apt install cmake extra-cmake-modules libcurl4-gnutls-dev libpcap0.8-dev libsdl2-dev libarchive-dev libenet-dev libzstd-dev
- 24.04:
sudo apt install qt6-{base,base-private,multimedia,svg}-dev
- 22.04:
sudo apt install qtbase6-dev qtbase6-private-dev qtmultimedia6-dev libqt6svg6-dev
- Older versions:
sudo apt install qtbase5-dev qtbase5-private-dev qtmultimedia5-dev libqt5svg5-dev
Also add-DUSE_QT6=OFF
to the first CMake command below.
- All versions:
- Fedora:
sudo dnf install gcc-c++ cmake extra-cmake-modules SDL2-devel libarchive-devel enet-devel libzstd-devel qt6-{qtbase,qtbase-private,qtmultimedia,qtsvg}-devel wayland-devel
- Arch Linux:
sudo pacman -S base-devel cmake extra-cmake-modules git libpcap sdl2 qt6-{base,multimedia,svg} libarchive enet zstd
- Ubuntu:
- Download the melonDS repository and prepare:
git clone https://github.com/melonDS-emu/melonDS cd melonDS
- Compile:
cmake -B build cmake --build build -j$(nproc --all)
Windows
- Install MSYS2
- Open the MSYS2 terminal from the Start menu:
- For x64 systems (most common), use MSYS2 UCRT64
- For ARM64 systems, use MSYS2 CLANGARM64
- Update the packages using
pacman -Syu
and reopen the same terminal if it asks you to - Install git and clone the repository
pacman -S git git clone https://github.com/melonDS-emu/melonDS cd melonDS
- Install dependencies:
Replace<prefix>
below withmingw-w64-ucrt-x86_64
on x64 systems, ormingw-w64-clang-aarch64
on ARM64 systems.pacman -S <prefix>-{toolchain,cmake,SDL2,libarchive,enet,zstd}
- Install Qt and configure the build directory
- Dynamic builds (with DLLs)
- Install Qt:
pacman -S <prefix>-{qt6-base,qt6-svg,qt6-multimedia,qt6-svg,qt6-tools}
- Set up the build directory with
cmake -B build
- Install Qt:
- Static builds (without DLLs, standalone executable)
- Install Qt:
pacman -S <prefix>-qt5-static
(Note: As of writing, theqt6-static
package does not work.) - Set up the build directory with
cmake -B build -DBUILD_STATIC=ON -DUSE_QT6=OFF -DCMAKE_PREFIX_PATH=$MSYSTEM_PREFIX/qt5-static
- Install Qt:
- Dynamic builds (with DLLs)
- Compile:
cmake --build build
If everything went well, melonDS should now be in the build
folder. For dynamic builds, you may need to run melonDS from the MSYS2 terminal in order for it to find the required DLLs.
macOS
- Install the Homebrew Package Manager
- Install dependencies:
brew install git pkg-config cmake sdl2 qt@6 libarchive enet zstd
- Download the melonDS repository and prepare:
git clone https://github.com/melonDS-emu/melonDS cd melonDS
- Compile:
cmake -B build -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6);$(brew --prefix libarchive)" cmake --build build -j$(sysctl -n hw.logicalcpu)
If everything went well, melonDS.app should now be in the build
directory.
Self-contained app bundle
If you want an app bundle that can be distributed to other computers without needing to install dependencies through Homebrew, you can additionally run ../tools/mac-libs.rb .
after the build is completed, or add -DMACOS_BUNDLE_LIBS=ON
to the first CMake command.
Nix (macOS/Linux)
melonDS provides a Nix flake with support for both macOS and Linux. The Nix package manager needs to be installed to use it.
- To run melonDS, just type
nix run github:melonDS-emu/melonDS
. - To get a shell for development, clone the melonDS repository and type
nix develop
in its directory.