Destroyed Building for Linux (markdown)

T2theV
2025-05-27 17:27:10 -05:00
parent da688ae146
commit 36b84430f0

@@ -1,124 +0,0 @@
## Prerequisites
* `git`
* `curl`
* `cmake`, version 3.13 or newer for Dolphin 5.0-16995 and newer.
* C++ compiler such as `gcc`, with C++20 support for Dolphin 5.0-17123 and newer.
## Additional Dependencies Examples
### For Ubuntu (22.04 and up)/Debian with Dolphin versions ~5.0-13001 or newer
Ubuntu **_18.04_** and _**20.04**_ users, please install Qt6 from source or an outside repo. One way to do so is to add [this PPA](https://launchpad.net/~okirby/+archive/ubuntu/qt6-backports) by running `sudo add-apt-repository ppa:okirby/qt6-backports && sudo apt update` before running the next command.
```sh
sudo apt install build-essential git cmake ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libevdev-dev libusb-1.0-0-dev libxrandr-dev libxi-dev libpangocairo-1.0-0 qt6-base-private-dev libqt6svg6-dev libbluetooth-dev libasound2-dev libpulse-dev libgl1-mesa-dev libcurl4-openssl-dev
sudo apt install libudev-dev libsystemd-dev || sudo apt install libeudev-dev #distros without systemd like AntiX must use eudev instead
```
### Fedora:
```sh
sudo dnf install vulkan-loader vulkan-loader-devel cmake git gcc-c++ libXext-devel libgudev qt6-qtbase-devel qt6-qtbase-private-devel qt6-qtsvg-devel systemd-devel openal-soft-devel libevdev-devel libao-devel SOIL-devel libXrandr-devel pulseaudio-libs-devel bluez-libs-devel libusb1-devel libXi-devel
```
### Clear Linux:
```sh
sudo swupd bundle-add devpkg-libgudev devpkg-libevdev devpkg-qt6base devpkg-qt6svg
```
### Arch:
see https://aur.archlinux.org/packages/dolphin-emu-git?all_deps=1#pkgdeps
### (!WIP) Chrome/Chromium OS (via [Chromebrew](https://github.com/chromebrew/chromebrew)):
```sh
crew install binutils wayland cmake gcc buildessential git libx11 pkg-config libxi libxext qtbase qtwayland mesa libxfixes libxxf86vm libusb libdrm libxrandr gettext linuxheaders enet libxshmfence libunwind lm_sensors elfutils patchelf vulkan_icd_loader
#Intel hardware
crew install xorg_intel_driver
#Nvidia hardware
crew install xorg_nouveau_driver
```
## Checkout Dolphin
1. `git clone https://github.com/dolphin-emu/dolphin`
2. `cd dolphin`
## Add necessary submodules and check for new commits
```bash
git -c submodule."Externals/Qt".update=none \
-c submodule."Externals/FFmpeg-bin".update=none \
-c submodule."Externals/libadrenotools".update=none \
submodule update --init --recursive \
&& git pull --recurse-submodules
```
## Building
If your system has an old compiler in its system repos, a higher version can be specified with build flags. For example, Ubuntu 18.04 users should install `gcc-11` from something like [this PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test) and then instead of `cmake ..` type `cmake .. -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11` during the build process.
### Global Build (if unsure, use this option)
```bash
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make install #optional, to install Dolphin
```
### Local Build
```bash
mkdir build && cd build
cmake .. -DLINUX_LOCAL_DEV=true
make -j$(nproc)
ln -s ../../Data/Sys Binaries/
```
### Portable Build
```bash
mkdir build && cd build
cmake .. -DLINUX_LOCAL_DEV=true
make -j$(nproc)
cp -r ../Data/Sys/ Binaries/
touch Binaries/portable.txt
```
### Distributable .deb Package
following the instructions from [the PR where this feature was implemented](https://github.com/dolphin-emu/dolphin/pull/10170):
```bash
sudo apt install dpkg-dev file
mkdir build && cd build
cmake .. -DCPACK_PACKAGE_CONTACT="Your Name Here" .. #you're responsible for what you distribute
make -j$(nproc)
cpack -G DEB
```
## Externally Managed Packages
Dolphin maintains official Flatpak repositories for both [releases](https://flatpak.dolphin-emu.org/releases.flatpakrepo) and [development builds](https://flatpak.dolphin-emu.org/dev.flatpakrepo). Additionally, on some distributions of Linux, package maintainers provide unofficial, unmodified builds of Dolphin. These are listed below:
- [Debian LTS (Bullseye)](https://packages.debian.org/buster/dolphin-emu), [Ubuntu 24.04 LTS (Noble Numbat)](https://packages.ubuntu.com/focal/dolphin-emu), and older **use a highly outdated build from 2016. Do not install Dolphin Emulator from APT on these versions!**
- [Debian Stable (Bookworm)](https://packages.debian.org/search?keywords=dolphin-emu&searchon=names&suite=all&section=all), [Ubuntu 24.10 (Oracular Oriole)](https://packages.ubuntu.com/search?keywords=dolphin-emu&searchon=names), and newer have recent release versions of Dolphin, though they can still become outdated due to software versions being mostly frozen when distribution versions release.
- [Arch Linux](https://archlinux.org/packages/extra/x86_64/dolphin-emu/)
- [Fedora](https://packages.fedoraproject.org/pkgs/dolphin-emu/dolphin-emu/) follows the latest release version but isn't always quite caught up with the most recent.
- [OpenSUSE](https://software.opensuse.org/package/dolphin-emu)
- [Gentoo](https://packages.gentoo.org/packages/games-emulation/dolphin)
- [Flathub](https://flathub.org/apps/details/org.DolphinEmu.dolphin-emu) is updated with the latest release versions. Steam Deck users may recognize this as the version distributed in the desktop mode's Discover store.
## Troubleshooting
- The compiler will normally tell you what's going on if you run into an error. Read the error messages closely and look them up verbatim to see if it's something missing on your system and/or a typo in recent Dolphin commits.
- Qt5 support has been [officially been deprecated](https://dolphin-emu.org/blog/2022/06/09/leaving-a-legend/) by the Dolphin development team. While it's still technically possible to build using Qt5, as of [5.0-17764](https://dolphin-emu.org/download/dev/950e1f94dc73b56309c090d7b04033506b057ae0/) the minimum requirement was raised to 5.15. It's recommended to install the proper Qt6 dependencies instead - by the time you're reading this, it's possible that not even 5.15 works anymore.
- That being said, there _is_ a [known bug](https://bugs.dolphin-emu.org/issues/12913) as of Qt **6.3+** where mouse clicks don't work on Linux. No one's really sure why yet. This can be worked around by setting `QT_XCB_NO_XI2=1`. As an example, you can just run Dolphin using the `QT_XCB_NO_XI2=1 dolphin-emu` command in a terminal. Another easy way to accomplish this would be to install `menulibre` from your package manager, open it and use it to modify Dolphin's desktop file, and change the Command to read something like `env QT_XCB_NO_XI2=1 QT_QPA_PLATFORM=xcb dolphin-emu`. Although it would be more proper to set this as an [environment variable](https://wiki.archlinux.org/title/environment_variables).
- Need more speed? As an alternative to `cmake ..` during the build process, type `cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native` instead. The resulting build will be optimized specifically for YOUR processor! The difference is more noticeable the weaker your computer is. Note that this may result in longer compile times, and the binaries you build will almost certainly be unusable on any computer besides your own. AUR users of `*-git` packages can get a similar effect by following https://wiki.archlinux.org/title/makepkg#Building_optimized_binaries