0. Environment
i5 physical machine ubuntu22
1. Install dependencies
$ 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 libbluetooth-dev libasound2-dev libpulse-dev libgl1-mesa-dev
$ sudo apt install libudev-dev libsystemd-dev || sudo apt install libeudev-dev #distros without systemd like AntiX must use eudev instead
Install qt6
$ sudo apt install qt6-base-dev qt6-base-private-dev qt6-multimedia-dev
$ sudo apt install qt6-l10n-tools qt6-tools-dev qt6-tools-dev-tools
$ sudo apt install libgl-dev
2. Get the source code
$ git clone https://github.com/dolphin-emu/dolphin
$ cd dolphin
$ git submodule update --init Externals/mGBA
$ git submodule update --init Externals/spirv_cross
$ git submodule update --init Externals/zlib-ng
$ git submodule update --init Externals/libspng
$ git submodule update --init Externals/VulkanMemoryAllocator
$ git submodule update --init --recursive Externals/cubeb
$ git submodule update --init Externals/implot
$ git submodule update --init Externals/gtest
$ git submodule update --init Externals/rcheevos
$ git pull --recurse-submodules
Compress backup
$ tar -zcvf dolphin_git_src_20230729.tar.gz dolphin/
Note: git clone always prompts curl for some error in the end, so I cloned and downloaded it from the 1C1G1M server I bought.
3. Compile
$ mkdir build && cd build
$ cmake ..
$ make -j8
Problem: Could NOT find Qt6Svg
Method: sudo apt install libgl-dev libqt6opengl6-dev libvulkan-dev ninja-build pkg-config pkg-kde-tools qt6-base-dev qt6-base-private-dev zlib1g-dev libqt6svg6-dev
here You can search for relevant dependencies: https://packages.ubuntu.com/source/kinetic/arm64/qt6-svg
Problem: No SOURCES given to target: usb (if this problem occurs, you need to delete build and re-compile)
sudo apt install libusb-dev
sudo apt install libusb-1.0-0-dev
问题:No SOURCES given to target: curl
sudo apt install libcurl4-gnutls-dev
4. Run the test
xxjianvm@xxjianvm-virtual-machine:~/work/dolphin/build/Binaries$ ./dolphin-emu
Warning: Ignoring WAYLAND_DISPLAY on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
An error occurred.
Condition: icon.availableSizes().size() > 0
File: /home/xxjianvm/work/dolphin/Source/Core/DolphinQt/Resources.cpp
Line: 53
Function: LoadNamedIcon
Ignore and continue?
Illegal instruction (core dumped)
xxjianvm@xxjianvm-virtual-machine:~/work/dolphin/build/Binaries$
This problem is solved after sudo make install in the build directory.
Reference: https://github.com/dolphin-emu/dolphin/wiki/Building-for-Linux