From 50aa0f5564992f291ae038af4cfd2d659c571b0d Mon Sep 17 00:00:00 2001 From: jarred wilson <20207921+jardon@users.noreply.github.com> Date: Wed, 19 Feb 2025 05:29:31 -0600 Subject: [PATCH] Update linux build docs (#2474) * fix: update linux build dependencies for libpng - add libpng to linux build docs - add libpng to nix build file * linux docs: reformat code blocks - add code block bash syntax highlighting - format long code blocks to multiline --- documents/building-linux.md | 46 +++++++++++++++++++++++++------------ shell.nix | 1 + 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/documents/building-linux.md b/documents/building-linux.md index 71e26e792..4ca953af6 100644 --- a/documents/building-linux.md +++ b/documents/building-linux.md @@ -13,33 +13,49 @@ First and foremost, Clang 18 is the **recommended compiler** as it is used for o #### Debian & Ubuntu -``` -sudo apt install build-essential clang git cmake libasound2-dev libpulse-dev libopenal-dev libssl-dev zlib1g-dev libedit-dev libudev-dev libevdev-dev libsdl2-dev libjack-dev libsndio-dev qt6-base-dev qt6-tools-dev qt6-multimedia-dev libvulkan-dev vulkan-validationlayers +```bash +sudo apt install build-essential clang git cmake libasound2-dev \ + libpulse-dev libopenal-dev libssl-dev zlib1g-dev libedit-dev \ + libudev-dev libevdev-dev libsdl2-dev libjack-dev libsndio-dev \ + qt6-base-dev qt6-tools-dev qt6-multimedia-dev libvulkan-dev \ + vulkan-validationlayers libpng-dev ``` #### Fedora -``` -sudo dnf install clang git cmake libatomic alsa-lib-devel pipewire-jack-audio-connection-kit-devel openal-devel openssl-devel libevdev-devel libudev-devel libXext-devel qt6-qtbase-devel qt6-qtbase-private-devel qt6-qtmultimedia-devel qt6-qtsvg-devel qt6-qttools-devel vulkan-devel vulkan-validation-layers +```bash +sudo dnf install clang git cmake libatomic alsa-lib-devel \ + pipewire-jack-audio-connection-kit-devel openal-devel \ + openssl-devel libevdev-devel libudev-devel libXext-devel \ + qt6-qtbase-devel qt6-qtbase-private-devel \ + qt6-qtmultimedia-devel qt6-qtsvg-devel qt6-qttools-devel \ + vulkan-devel vulkan-validation-layers libpng-devel ``` #### Arch Linux -``` -sudo pacman -S base-devel clang git cmake sndio jack2 openal qt6-base qt6-declarative qt6-multimedia sdl2 vulkan-validation-layers +```bash +sudo pacman -S base-devel clang git cmake sndio jack2 openal \ + qt6-base qt6-declarative qt6-multimedia sdl2 \ + vulkan-validation-layers libpng ``` **Note**: The `shadps4-git` AUR package is not maintained by any of the developers, and it uses the default compiler, which is often set to GCC. Use at your own discretion. #### OpenSUSE -``` -sudo zypper install clang git cmake libasound2 libpulse-devel libsndio7 libjack-devel openal-soft-devel libopenssl-devel zlib-devel libedit-devel systemd-devel libevdev-devel qt6-base-devel qt6-multimedia-devel qt6-svg-devel qt6-linguist-devel qt6-gui-private-devel vulkan-devel vulkan-validationlayers +```bash +sudo zypper install clang git cmake libasound2 libpulse-devel \ + libsndio7 libjack-devel openal-soft-devel libopenssl-devel \ + zlib-devel libedit-devel systemd-devel libevdev-devel \ + qt6-base-devel qt6-multimedia-devel qt6-svg-devel \ + qt6-linguist-devel qt6-gui-private-devel vulkan-devel \ + vulkan-validationlayers libpng-devel ``` #### NixOS -``` +```bash nix-shell shell.nix ``` @@ -50,7 +66,7 @@ You can try one of two methods: - Search the packages by name and install them with your package manager, or - Install [distrobox](https://distrobox.it/), create a container using any of the distributions cited above as a base, for Arch Linux you'd do: -``` +```bash distrobox create --name archlinux --init --image archlinux:latest ``` @@ -59,7 +75,7 @@ This option is **highly recommended** for distributions with immutable/atomic fi ### Cloning -``` +```bash git clone --recursive https://github.com/shadps4-emu/shadPS4.git cd shadPS4 ``` @@ -72,7 +88,7 @@ There are 3 options you can choose from. Option 1 is **highly recommended**. 1. Generate the build directory in the shadPS4 directory. -``` +```bash cmake -S . -B build/ -DENABLE_QT_GUI=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ``` @@ -80,7 +96,7 @@ To disable the Qt GUI, remove the `-DENABLE_QT_GUI=ON` flag. To change the build 2. Use CMake to build the project: -``` +```bash cmake --build ./build --parallel$(nproc) ``` @@ -88,13 +104,13 @@ If your computer freezes during this step, this could be caused by excessive sys Now run the emulator. If Qt was enabled at configure time: -``` +```bash ./build/shadps4 ``` Otherwise, specify the path to your PKG's boot file: -``` +```bash ./build/shadps4 /"PATH"/"TO"/"GAME"/"FOLDER"/eboot.bin ``` diff --git a/shell.nix b/shell.nix index cc9cc1f82..4eee9fdea 100644 --- a/shell.nix +++ b/shell.nix @@ -46,6 +46,7 @@ pkgs.mkShell { pkgs.stb pkgs.qt6.qtwayland pkgs.wayland-protocols + pkgs.libpng ]; shellHook = ''