diff --git a/.gitignore b/.gitignore index fbadb208b..27da9903d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,12 @@ [Bb]uild*/ doc-build/ +# AppImageBuilder directory and torzu.AppImage +AppImageBuilder/build/ +AppImageBuilder/appimagetool.AppImage +AppImageBuilder/torzu.AppImage +torzu.AppImage + # Generated source files src/common/scm_rev.cpp dist/english_plurals/generated_en.ts diff --git a/AppImage-build.sh b/AppImage-build.sh new file mode 100755 index 000000000..5abb17d8e --- /dev/null +++ b/AppImage-build.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +FILE=build/bin/yuzu +if test -f "$FILE"; then + # remove any previously made AppImage in the base torzu git folder + rm ./torzu.AppImage + + # enter AppImage utility folder + cd AppImageBuilder + + # run the build script to create the AppImage + # (usage) ./build.sh [source torzu build folder] [destination .AppImage file] + ./build.sh ../build ./torzu.AppImage + + FILE=./torzu.AppImage + if test -f "$FILE"; then + # move the AppImage to the main torzu folder + mv torzu.AppImage .. + # return to main torzu folder + cd .. + # show contents of current folder + echo + ls + # show AppImages specifically + echo + ls *.AppImage + echo + echo "'torzu.AppImage' is now located in the current folder." + echo + else + cd .. + echo "AppImage was not built." + fi +else + echo + echo "$FILE does not exist." + echo + echo "No yuzu executable found in the /torzu/build/bin folder!" + echo + echo "You must first build a native linux version of torzu before running this script!" + echo +fi diff --git a/AppImageBuilder/assets/bwrap b/AppImageBuilder/assets/bwrap new file mode 100755 index 000000000..a5dd85cc1 Binary files /dev/null and b/AppImageBuilder/assets/bwrap differ diff --git a/AppImageBuilder/assets/bwrap-info.txt b/AppImageBuilder/assets/bwrap-info.txt new file mode 100644 index 000000000..0178b387d --- /dev/null +++ b/AppImageBuilder/assets/bwrap-info.txt @@ -0,0 +1 @@ +This is a statically compiled bubblewrap 0.9.0 executable. diff --git a/AppImageBuilder/assets/torzu.desktop b/AppImageBuilder/assets/torzu.desktop new file mode 100644 index 000000000..f84750393 --- /dev/null +++ b/AppImageBuilder/assets/torzu.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Application +Name=torzu +Icon=torzu +Exec=AppRun +Categories=Game; diff --git a/AppImageBuilder/assets/torzu.svg b/AppImageBuilder/assets/torzu.svg new file mode 100644 index 000000000..de6443128 --- /dev/null +++ b/AppImageBuilder/assets/torzu.svg @@ -0,0 +1,2 @@ + + diff --git a/AppImageBuilder/assets_aarch64/AppRun b/AppImageBuilder/assets_aarch64/AppRun new file mode 100755 index 000000000..829f33ba7 --- /dev/null +++ b/AppImageBuilder/assets_aarch64/AppRun @@ -0,0 +1,13 @@ +#! /bin/bash + +cd "$APPDIR" + +if [ -d /usr/lib/aarch64-linux-gnu/qt5 ]; then + exec ./yuzu-bwrap.sh +else + if [ -d /usr/lib/aarch64-linux-gnu/qt6 ]; then + exec ./yuzu-bwrap.sh + else + exec ./yuzu.sh + fi +fi diff --git a/AppImageBuilder/assets_aarch64/yuzu-bwrap.sh b/AppImageBuilder/assets_aarch64/yuzu-bwrap.sh new file mode 100755 index 000000000..d3c234cdb --- /dev/null +++ b/AppImageBuilder/assets_aarch64/yuzu-bwrap.sh @@ -0,0 +1,8 @@ +#! /bin/sh +if [ -d /usr/lib/aarch64-linux-gnu/qt5 ]; then + exec ./bwrap --dev-bind / / --tmpfs /usr/lib/aarch64-linux-gnu/qt5 ./yuzu.sh +else + if [ -d /usr/lib/aarch64-linux-gnu/qt6 ]; then + exec ./bwrap --dev-bind / / --tmpfs /usr/lib/aarch64-linux-gnu/qt6 ./yuzu.sh + fi +fi diff --git a/AppImageBuilder/assets_aarch64/yuzu.sh b/AppImageBuilder/assets_aarch64/yuzu.sh new file mode 100755 index 000000000..561ae269c --- /dev/null +++ b/AppImageBuilder/assets_aarch64/yuzu.sh @@ -0,0 +1,6 @@ +#! /bin/sh + +# NOTE: the `ld-linux-aarch64.so.1` filename came from a pi debian 11 installation, +# this may be incorrect for a different or more up-to-date system. +# Can find out the correct filename using command "ldd yuzu" on the non-AppImage app +QT_QPA_PLATFORM=xcb QT_PLUGIN_PATH=. exec ./ld-linux-aarch64.so.1 --library-path . ./yuzu diff --git a/AppImageBuilder/assets_x86_64/AppRun b/AppImageBuilder/assets_x86_64/AppRun new file mode 100755 index 000000000..524559c15 --- /dev/null +++ b/AppImageBuilder/assets_x86_64/AppRun @@ -0,0 +1,25 @@ +#! /bin/bash + +cd "$APPDIR" + +# default qt5 location +if [ -d /usr/lib/x86_64-linux-gnu/qt5 ]; then + exec ./yuzu-bwrap.sh +else + # qt5 on Steam Deck (as qt) + if [ -d /usr/lib/qt ]; then + exec ./yuzu-bwrap.sh + else + # default qt6 location + if [ -d /usr/lib/x86_64-linux-gnu/qt6 ]; then + exec ./yuzu-bwrap.sh + else + # qt6 on Steam Deck + if [ -d /usr/lib/qt6 ]; then + exec ./yuzu-bwrap.sh + else + exec ./yuzu.sh + fi + fi + fi +fi diff --git a/AppImageBuilder/assets_x86_64/yuzu-bwrap.sh b/AppImageBuilder/assets_x86_64/yuzu-bwrap.sh new file mode 100755 index 000000000..9757f5bea --- /dev/null +++ b/AppImageBuilder/assets_x86_64/yuzu-bwrap.sh @@ -0,0 +1,21 @@ +#! /bin/sh + +# default qt5 location +if [ -d /usr/lib/x86_64-linux-gnu/qt5 ]; then + exec ./bwrap --dev-bind / / --tmpfs /usr/lib/x86_64-linux-gnu/qt5 ./yuzu.sh +else + # qt5 on Steam Deck (as qt) + if [ -d /usr/lib/qt ]; then + exec ./bwrap --dev-bind / / --tmpfs /usr/lib/qt ./yuzu.sh + else + # default qt6 location + if [ -d /usr/lib/x86_64-linux-gnu/qt6 ]; then + exec ./bwrap --dev-bind / / --tmpfs /usr/lib/x86_64-linux-gnu/qt6 ./yuzu.sh + else + # qt6 on Steam Deck + if [ -d /usr/lib/qt6 ]; then + exec ./bwrap --dev-bind / / --tmpfs /usr/lib/qt6 ./yuzu.sh + fi + fi + fi +fi diff --git a/AppImageBuilder/assets_x86_64/yuzu.sh b/AppImageBuilder/assets_x86_64/yuzu.sh new file mode 100755 index 000000000..a0e3672fd --- /dev/null +++ b/AppImageBuilder/assets_x86_64/yuzu.sh @@ -0,0 +1,2 @@ +#! /bin/sh +QT_QPA_PLATFORM=xcb QT_PLUGIN_PATH=. exec ./ld-linux-x86-64.so.2 --library-path . ./yuzu diff --git a/AppImageBuilder/build.sh b/AppImageBuilder/build.sh new file mode 100755 index 000000000..b74bc6268 --- /dev/null +++ b/AppImageBuilder/build.sh @@ -0,0 +1,136 @@ +#! /bin/bash +set -e + +# Check arguments +if [[ $# != 2 ]]; then + >&2 echo "Bad usage!" + echo "Usage: $0 " + exit 1 +fi + +# Get paths +ARCH="$(uname -m)" +SYSTEM_LIBS="/usr/lib" +YUZU_BIN="${1}/bin" +YUZU_BIN_GUI="${YUZU_BIN}/yuzu" + +# Make sure executable exists +if [[ $(file -b --mime-type "$YUZU_BIN_GUI") != application/x-pie-executable ]]; then + >&2 echo "Invalid yuzu executable!" +fi + +# Clean up build dir +rm -rf build +mkdir build + +# NOTE: some of these aren't used now, but can be reordered in priority when torzu is converted to QT6 +# Find QT folder (Steam Deck fix), check for default qt5 first +QTFOUND="true" +QTDIR="$SYSTEM_LIBS"/${ARCH}-linux-gnu/qt5/plugins +if [ ! -d "$QTDIR" ]; then + # default qt5 folder not found, check for Steam Deck qt (qt5) folder + QTDIR="$SYSTEM_LIBS"/qt/plugins + if [ ! -d "$QTDIR" ]; then + # Steam Deck qt (qt5) folder not found, check for regular qt6 folder + QTDIR="$SYSTEM_LIBS"/${ARCH}-linux-gnu/qt6/plugins + if [ ! -d "$QTDIR" ]; then + # regular qt6 folder not found, check for Steam Deck qt6 folder + QTDIR="$SYSTEM_LIBS"/qt6/plugins + if [ ! -d "$QTDIR" ]; then + QTFOUND="false" + fi + fi + fi +fi +if [ $QTFOUND == "true" ]; then + echo "QT plugins from $QTDIR will be used." + + # Copy system dependencies used to build and required by the yuzu binary + # includes: + # - '/lib64/ld-linux-x86-64.so.2' or `/lib/ld-linux-aarch64.so.1` file per architecture + # - required files from `/usr/lib/x86_64-linux-gnu` or `/usr/lib/aarch64-linux-gnu` + # - different for SteamDeck, but still does it automatically + for lib in $(ldd "$YUZU_BIN_GUI"); do + (cp -v "$lib" ./build/ 2> /dev/null) || true + done + + # Copy QT dependency folders, path determined above + cp -rv "$QTDIR"/{imageformats,platforms,platformthemes,xcbglintegrations} ./build/ + + # Copy executable + cp -v "$YUZU_BIN_GUI" ./build/ + + # Copy assets for the appropriate arch + cp -v ./assets_"${ARCH}"/* ./build/ + # Copy common assets + cp -v ./assets/* ./build/ + + # Strip all libraries and executables + for file in $(find ./build -type f); do + (strip -v "$file" 2> /dev/null) || true + done + + PASSED_CHECKSUM="false" + FILE=appimagetool.AppImage + # total number of times to try downloading if a checksum doesn't match + DL_TRIES=3 + while [ $PASSED_CHECKSUM == "false" ] && [ "$DL_TRIES" -gt 0 ]; do + case $ARCH in + x86_64) + # Static copy from the 'ext-linux-bin' repo. + # Checksum will need to be changed when/if this file in the repo is updated. + if ! test -f "$FILE"; then + echo "Downloading appimagetool for architecture '$ARCH'" + wget -O appimagetool.AppImage https://github.com/litucks/ext-linux-bin/raw/refs/heads/main/appimage/appimagetool-x86_64.AppImage + fi + if [ $(shasum -a 256 appimagetool.AppImage | cut -d' ' -f1) = "110751478abece165a18460acbd7fd1398701f74a9405ad8ac053427d937bd5d" ] ; then + PASSED_CHECKSUM="true" + fi + # DISABLED TO USE THE ABOVE + # The current continuous release channel option, until a static copy is put in 'ext-linux-bin'. + # The checksum will pass until the continuous release is updated, then a new one needs to be + # generated to update this script. + #if ! test -f "$FILE"; then + # echo "Downloading appimagetool for architecture '$ARCH'" + # wget -O appimagetool.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage + #fi + #if [ $(shasum -a 256 appimagetool.AppImage | cut -d' ' -f1) = "46fdd785094c7f6e545b61afcfb0f3d98d8eab243f644b4b17698c01d06083d1" ] ; then + # PASSED_CHECKSUM="true" + #fi + ;; + aarch64) + # Currently set to the continuous release channel until a static copy is put in 'ext-linux-bin'. + # The checksum will pass until the continuous release is updated, then a new one needs to be + # generated to update this script. + if ! test -f "$FILE"; then + echo "Downloading appimagetool for architecture '$ARCH'" + wget -O appimagetool.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage + fi + if [ $(shasum -a 256 appimagetool.AppImage | cut -d' ' -f1) = "04f45ea45b5aa07bb2b071aed9dbf7a5185d3953b11b47358c1311f11ea94a96" ] ; then + PASSED_CHECKSUM="true" + fi + ;; + *) + PASSED_CHECKSUM="invalid_arch" + ;; + esac + # delete the appimagetool downloaded if the checksum doesn't match. + if [ ! $PASSED_CHECKSUM == "true" ]; then + rm -f appimagetool.AppImage + fi + ((DL_TRIES-=1)) + done + if [ $PASSED_CHECKSUM == "true" ]; then + echo "Checksum passed. Proceeding to build image." + # Build AppImage + chmod a+x appimagetool.AppImage + ./appimagetool.AppImage ./build "$2" + elif [ $PASSED_CHECKSUM == "invalid_arch" ]; then + echo "No download found for architecture '$ARCH'. Building halted." + else + echo "Checksum for appimagetool does not match. Building halted." + echo "If the file to be downloaded has been changed, a new checksum will need to be generated for this script." + fi +else + echo "QT not found, aborting AppImage build." +fi diff --git a/README.md b/README.md index 2d4a599cc..2081d56ff 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ SPDX-License-Identifier: GPL-2.0-or-later


- torzu + torzu
torzu
@@ -57,19 +57,25 @@ A secondary goal is the improvement of usability on low-end systems. This includ All development happens on [Dark Git](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/). It's also where [our central repository](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu) is hosted. -To clone this git repository, you can use these commands given tor is installed and running: +To clone this git repository, use these commands (assuming tor is installed as a service and running): - git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git - cd torzu - git submodule update --init --recursive +```bash +git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git +cd torzu +git submodule update --init --recursive +``` Alternatively, you can clone from the [NotABug mirror repository](https://notabug.org/litucks/torzu): - git clone https://notabug.org/litucks/torzu.git --depth 1 --recursive +```bash +git clone --depth 1 https://notabug.org/litucks/torzu.git +cd torzu +git submodule update --init --recursive +``` Note that above repository may be taken down any time. Do not rely on its existence in production. In case the NotABug mirror goes down, another mirror will be most likely be set up on Bitbucket. -This project incorporates several commits from the [Suyu](https://suyu.dev) and [Sudachi](https://github.com/sudachi-emu/sudachi) forks (but cleaned up due to the typically mediocre code/commit quality from both projects) as well as changes listed in **Changes**. +This project incorporates several commits from the [Suyu](https://suyu.dev) and [Sudachi](https://github.com/sudachi-emu/sudachi) forks, as well as changes listed in **Changes**. ## Move away from Codeberg @@ -83,4 +89,4 @@ As requested by Codeberg staff, **I have removed the Codeberg mirror repository* ## License -yuzu is licensed under the GPLv3 (or any later version). Refer to the [LICENSE.txt](./LICENSE.txt) file. +torzu is licensed under the GPLv3 (or any later version). Refer to the [LICENSE.txt](./LICENSE.txt) file. diff --git a/build-for-linux.md b/build-for-linux.md index e9d08b376..3b230fbbd 100644 --- a/build-for-linux.md +++ b/build-for-linux.md @@ -1,46 +1,83 @@ # Flatpak Build -Install flatpak and flatpak-builder: +**NOTE: Flatpaks are built with a wrapper repo, which downloads everything needed including the main torzu repo.** + +First install `flatpak` and `flatpak-builder` for your specific distro: * Arch / Manjaro: - - `sudo pacman -Syu --needed flatpak flatpak-builder` + ```bash + sudo pacman -Syu --needed flatpak flatpak-builder + ``` * Debian / Ubuntu / Linux Mint: - - `sudo apt-get install flatpak flatpak-builder` + ```bash + sudo apt-get install flatpak flatpak-builder + ``` * Fedora: - - `sudo dnf install flatpak flatpak-builder` + ```bash + sudo dnf install flatpak flatpak-builder + ``` -Install flatpak dependencies: +Then install flatpak dependencies from within flatpak: -``` +```bash flatpak install org.kde.Sdk//5.15-23.08 io.qt.qtwebengine.BaseApp//5.15-23.08 ``` -Clone the torzu-flatpak repo and dependencies: +Clone the torzu-flatpak repo and dependencies **(note: this github repo is the correct one)**: +```bash +git clone --depth 1 --recursive https://github.com/litucks/onion.torzu_emu.torzu.git torzuFlatpak ``` -git clone --depth 1 --recursive https://github.com/litucks/onion.torzu_emu.torzu.git +Enter the cloned directory and run the build script: +```bash +cd torzuFlatpak && ./build.sh ``` -Enter the cloned directory and run build script: -``` -cd onion.torzu_emu.torzu && ./build.sh -``` -Resulting `torzu.flatpak` will be in the same directory as the build script. +The resulting `torzu.flatpak` will be in the same directory as the build script. To install: -``` +```bash flatpak install torzu.flatpak ``` +--- +--- +--- + +# AppImage Build + +The AppImage Builder is included in the main torzu repo. + +First you must build a native linux version from the section below, with the resulting executables in the `torzu/build/bin` folder. Leave everything where it is. + +After that you only have to run the following (assuming you're still in the `build` folder after running `ninja`): +```bash +cd .. && ./AppImage-build.sh +``` +The script enters the `AppImageBuilder` folder and generates the AppImage executable. + +The resulting `torzu.AppImage` file is moved back into the main root `torzu` folder where `AppImage-build.sh` is. + +To run it: +```bash +./torzu.AppImage +``` +***These steps are included as an option in the native build instructions below!*** + +**NOTE: the native binaries will still be in the `torzu/build/bin` folder, so you can archive them to have both versions.** + +--- +--- +--- # Native Builds -### Dependencies (copy/paste commands provided after) +### Dependencies (easy copy/paste commands provided after) -You'll need to download and install the following to build yuzu: +You'll need to download and install the following: * [GCC](https://gcc.gnu.org/) v11+ (for C++20 support) & misc * This page is being updated as we transition to GCC 11 * If GCC 12 is installed, [Clang](https://clang.llvm.org/) v14+ is required for compiling * [CMake](https://www.cmake.org/) 3.15+ -The following are handled by yuzu's externals: +The following are handled by torzu's externals: * [FFmpeg](https://ffmpeg.org/) * [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+ @@ -61,32 +98,38 @@ All other dependencies will be downloaded by [vcpkg](https://vcpkg.io/) if neede * [ZLIB](https://www.zlib.net/) 1.2+ * [zstd](https://facebook.github.io/zstd/) 1.5+ -If an ARM64 build is intended, export `VCPKG_FORCE_SYSTEM_BINARIES=1`. +### Dependencies are listed here as commands that can be copied/pasted. Of course, they should be inspected before being run. -Dependencies are listed here as commands that can be copied/pasted. Of course, they should be inspected before being run. +- All Distros + + - If an ARM64 build is intended, export `VCPKG_FORCE_SYSTEM_BINARIES=1`. - Arch / Manjaro: - - `sudo pacman -Syu --needed base-devel boost catch2 cmake ffmpeg fmt git glslang libzip lz4 mbedtls ninja nlohmann-json openssl opus qt5 sdl2 zlib zstd zip unzip` + ```bash + sudo pacman -Syu --needed base-devel boost catch2 cmake ffmpeg fmt git glslang libzip lz4 mbedtls ninja nlohmann-json openssl opus qt5 sdl2 shasum unzip zip zlib zstd + ``` - Building with QT Web Engine needs to be specified when running CMake with the param `-DCMAKE_CXX_FLAGS="-I/usr/include/qt/QtWebEngineWidgets"` with qt5-webengine installed. - GCC 11 or later is required. - Debian / Ubuntu / Linux Mint: - - `sudo apt-get install autoconf cmake g++-11 gcc-11 git glslang-tools libasound2 libboost-context-dev libglu1-mesa-dev libhidapi-dev libpulse-dev libtool libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 libxxhash-dev mesa-common-dev nasm ninja-build qtbase5-dev qtbase5-private-dev qttools5-dev qtwebengine5-dev qtmultimedia5-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev libva-dev` + ```bash + sudo apt-get install autoconf catch2 cmake g++-11 gcc-11 git glslang-tools libasound2 libavcodec-dev libavfilter-dev libboost-context-dev libfmt-dev libglu1-mesa-dev libhidapi-dev liblz4-dev libmbedtls-dev libpulse-dev libssl-dev libswscale-dev libtool libudev-dev libva-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 libxxhash-dev libzstd-dev mesa-common-dev nasm ninja-build nlohmann-json3-dev qtbase5-dev qtbase5-private-dev qtmultimedia5-dev qttools5-dev qtwebengine5-dev shasum + ``` - Debian 11 (Bullseye), Ubuntu 22.04, Linux Mint 20 or later is required. - Users need to manually specify building with QT Web Engine enabled. This is done using the parameter `-DYUZU_USE_QT_WEB_ENGINE=ON` when running CMake. - Users need to manually specify building with GCC 11. This can be done by adding the parameters `-DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11` when running CMake. i.e. - Users need to manually disable building SDL2 from externals if they intend to use the version provided by their system by adding the parameters `-DYUZU_USE_EXTERNAL_SDL2=OFF` - -``` -git submodule update --init --recursive -cmake .. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -``` - + - ***example cmake without system SDL2 (swap into full build commands below):*** + ```bash + cmake .. -GNinja -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DYUZU_USE_QT_WEB_ENGINE=ON + ``` - Fedora: - - `sudo dnf install autoconf ccache cmake fmt-devel gcc{,-c++} glslang hidapi-devel json-devel libtool libusb1-devel libzstd-devel lz4-devel nasm ninja-build openssl-devel pulseaudio-libs-devel qt5-linguist qt5-qtbase{-private,}-devel qt5-qtwebengine-devel qt5-qtmultimedia-devel speexdsp-devel wayland-devel zlib-devel ffmpeg-devel libXext-devel` + ```bash + sudo dnf install autoconf ccache cmake ffmpeg-devel fmt-devel gcc{,-c++} glslang hidapi-devel json-devel libtool libusb1-devel libXext-devel libzstd-devel lz4-devel nasm ninja-build openssl-devel pulseaudio-libs-devel qt5-linguist qt5-qtbase{-private,}-devel qt5-qtmultimedia-devel qt5-qtwebengine-devel shasum speexdsp-devel wayland-devel zlib-devel + ``` - Fedora 32 or later is required. - Due to GCC 12, Fedora 36 or later users need to install `clang`, and configure CMake to use it via `-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang` - CMake arguments to force system libraries: @@ -97,68 +140,90 @@ cmake .. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 - Gentoo: - **\*\*Disclaimer\*\***: this dependency list was written by a novice Gentoo user who first set it up with a DE, and then based this list off of the Fedora dependency list. This may be missing some requirements, or includes too many. Caveat emptor. - - `emerge --ask app-arch/lz4 dev-libs/boost dev-libs/hidapi dev-libs/libzip dev-libs/openssl dev-qt/linguist dev-qt/qtconcurrent dev-qt/qtcore dev-util/cmake dev-util/glslang dev-vcs/git media-libs/alsa-lib media-libs/opus media-sound/pulseaudio media-video/ffmpeg net-libs/mbedtls sys-libs/zlib x11-libs/libXext` + ```bash + emerge --ask app-arch/lz4 dev-libs/boost dev-libs/hidapi dev-libs/libzip dev-libs/openssl dev-qt/linguist dev-qt/qtconcurrent dev-qt/qtcore dev-util/cmake dev-util/glslang dev-vcs/git media-libs/alsa-lib media-libs/opus media-sound/pulseaudio media-video/ffmpeg net-libs/mbedtls sys-libs/zlib x11-libs/libXext + ``` - GCC 11 or later is required. - Users may need to append `pulseaudio`, `bindist` and `context` to the `USE` flag. -### Cloning yuzu with Git +# Building -**from Codeberg repo (the `--recursive` option automatically clones the required Git submodules):** -``` -git clone --depth 1 --recursive https://notabug.org/litucks/torzu.git -cd torzu +### Clone the source with Git + +**from Codeberg repo:** +```bash +git clone --depth 1 https://notabug.org/litucks/torzu.git ``` -**from Torzu repo (assuming Tor is installed as a service):** -``` +**from Torzu repo (assuming Tor is installed as a service, such as `sudo apt install tor` using default settings):** +```bash git -c http.proxy=socks5h://127.0.0.1:9050 clone --depth 1 http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu.git -cd torzu -git submodule update --init --recursive ``` -### Building yuzu in Release Mode (Optimized) +### Build in Release Mode (Optimized) If you need to run ctests, you can disable `-DYUZU_TESTS=OFF` and install Catch2. +***Be sure to swap your above distro-specific commands into the line starting with*** `cmake` (the options already included below should still be used): + ```bash +cd torzu +git submodule update --init --recursive mkdir build && cd build cmake .. -GNinja -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF ninja +``` +There should now be executable binaries located in the `torzu/build/bin` folder. + +You can choose to (all starting from the `build` folder): + +* **Make an AppImage** (the resulting `torzu.AppImage` will be in the `torzu` folder): +```bash +cd .. && ./AppImage-build.sh +``` + +* **Install the binaries to your system with shortcuts**: +```bash sudo ninja install ``` -Optionally, you can use `cmake-gui ..` to adjust various options (e.g. disable the Qt GUI). - -### Building yuzu in Debug Mode (Slow) - +* **Run them without installing**: +```bash +cd bin +./yuzu +# or +./yuzu-cmd +``` + +* **PORTABLE INSTALL** - use the native binaries (without being installed to the system) and add a `user` folder next to them (does not work with AppImage or Flatpak): +```bash +cd bin +mkdir user +./yuzu +``` +All data usually in the `~/.local/share/yuzu` folder will now be located in the `user` folder instead, so you can easily archive and restore a working install. + +Optionally, you can use `cmake-gui ..` instead to adjust various options (e.g. disable the Qt GUI). + +--- +--- +--- + +### Build in Debug Mode (Slow) + +Same as above, but add `-DCMAKE_BUILD_TYPE=Debug`: ```bash -mkdir build && cd build cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF -ninja ``` -### Building with debug symbols +### Build with debug symbols + +Same as above, but use `-DCMAKE_BUILD_TYPE=RelWithDebInfo`: ```bash -mkdir build && cd build cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF -ninja ``` -### Running without installing - -After building, the binaries `yuzu` and `yuzu-cmd` (depending on your build options) will end up in `build/bin/`. - - ```bash - # SDL - cd build/bin/ - ./yuzu-cmd - - # Qt - cd build/bin/ - ./yuzu - ``` - ### Debugging 1. Enable CPU debugging