diff options
| author | briaguya <70942617+briaguya-ai@users.noreply.github.com> | 2024-02-15 21:13:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-15 20:13:49 -0600 |
| commit | 1bc15d5bf3042d4fd64e1952eb68c47a7d5d8061 (patch) | |
| tree | 457ee652c4b70ce50a326f8cc548424711075a55 | |
| parent | e05f558ef33a9630a8dea003e5b191521fb5a7c2 (diff) | |
document dependencies per distro (#3933)
* start on arch
* noconfirm
* git
* noconfirm
* just skip cache
* cmake
* ninja
* gcc
* lsb
* sdl2
* png
* sdl net
* boost
* imagemagick and add opensuse
* non interactive
* git
* cmake
* add a bunch
* things
* more
* try to matrix
* soh otr i guess
* needs
* trying to figure out how matrix include works
* make the matrix?
* matrix debug
* install?
* echo?
* yuck
* cannot locate package false
* parens for good measure
* lsb
* libsdl2
* suse
* i forgot opensuse uses gcc-c++ instead of g++ for the package name
* png
* sdl
* more
* suse packages....
* fedora cmake
* 2?
* png
* handle old sdl2 net
* apt
* not sure if this is a problem for both clang and gcc on opensuse or just clang
* devel
* cmake min version
* def don't want this here but it's here for now
* does this do anything
* mantic because cmake version
* libopengl?
* fedora ninja
* fedora g++
* lsb
* fedora sdl
* libpng
* do a build
* clang fix
* give early returns values
* ImageMagick
* Update BUILDING.md
* something
* plain boost instead of devel?
* not packing so we don't need this part
* base?
* don't have it can't need it
* just use boost download on opensuse i guess
* move workflow
* bring back the file
* lus main?
* detach
| -rw-r--r-- | .github/workflows/test-builds-on-distros.yml | 61 | ||||
| -rw-r--r-- | docs/BUILDING.md | 40 | ||||
| -rw-r--r-- | soh/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | soh/src/code/z_camera.c | 4 | ||||
| -rw-r--r-- | soh/src/overlays/actors/ovl_player_actor/z_player.c | 4 |
5 files changed, 112 insertions, 7 deletions
diff --git a/.github/workflows/test-builds-on-distros.yml b/.github/workflows/test-builds-on-distros.yml new file mode 100644 index 000000000..fd8b3c929 --- /dev/null +++ b/.github/workflows/test-builds-on-distros.yml @@ -0,0 +1,61 @@ +name: test-builds-on-distros +on: + workflow_dispatch: # by request +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + build: + strategy: + matrix: + image: ["archlinux:base", "opensuse/tumbleweed:latest", "ubuntu:mantic", "debian:bookworm", "fedora:39"] + cc: ["gcc", "clang"] + include: + - cxx: g++ + cc: gcc + - cxx: clang++ + cc: clang + runs-on: ${{ (vars.LINUX_RUNNER && fromJSON(vars.LINUX_RUNNER)) || 'ubuntu-latest' }} + container: + image: ${{ matrix.image }} + steps: + - name: Install dependencies (pacman) + if: ${{ matrix.image == 'archlinux:base' }} + run: | + echo arch + echo pacman -S ${{ matrix.cc }} git cmake ninja lsb-release sdl2 libpng sdl2_net boost + pacman -Syu --noconfirm + pacman -S --noconfirm ${{ matrix.cc }} git cmake ninja lsb-release sdl2 libpng sdl2_net boost + - name: Install dependencies (dnf) + if: ${{ matrix.image == 'fedora:39' }} + run: | + echo fedora + echo dnf install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} git cmake ninja-build lsb_release SDL2-devel libpng-devel boost-devel + dnf -y upgrade + dnf -y install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} git cmake ninja-build lsb_release SDL2-devel libpng-devel boost-devel + - name: Install dependencies (apt) + if: ${{ matrix.image == 'ubuntu:mantic' || matrix.image == 'debian:bookworm' }} + run: | + echo debian based + echo apt-get install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'g++') || '' }} git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libboost-dev libopengl-dev + apt-get update + apt-get -y full-upgrade + apt-get -y install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'g++') || '' }} git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libboost-dev libopengl-dev + - name: Install dependencies (zypper) + if: ${{ matrix.image == 'opensuse/tumbleweed:latest' }} + run: | + echo openSUSE + echo zypper in ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} ${{ matrix.cc == 'clang' && 'libstdc++-devel' || '' }} git cmake ninja SDL2-devel libpng16-devel + zypper --non-interactive dup + zypper --non-interactive in ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} ${{ matrix.cc == 'clang' && 'libstdc++-devel' || '' }} git cmake ninja SDL2-devel libpng16-devel + - uses: actions/checkout@v3 + with: + submodules: true + - name: Build SoH + run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1 + cmake --build build-cmake --config Release -j3 + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 56ff9718f..eabc18ec8 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -84,17 +84,49 @@ cd "build/x64" ``` ## Linux -Requires `gcc >= 10, x11, curl, python3, sdl2 >= 2.0.22, libpng, glew >= 2.2, ninja, cmake, lld, pulseaudio-libs` +### Install dependencies +#### Debian/Ubuntu +```sh +# using gcc +apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libboost-dev libopengl-dev + +# or using clang +apt-get install clang git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libboost-dev libopengl-dev +``` +#### Arch +```sh +# using gcc +pacman -S gcc git cmake ninja lsb-release sdl2 libpng sdl2_net boost -**Important: For maximum performance make sure you have ninja build tools installed!** +# or using clang +pacman -S clang git cmake ninja lsb-release sdl2 libpng sdl2_net boost +``` +#### Fedora +```sh +# using gcc +dnf install gcc gcc-c++ git cmake ninja-build lsb_release SDL2-devel libpng-devel boost-devel -_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._ +# or using clang +dnf install clang git cmake ninja-build lsb_release SDL2-devel libpng-devel boost-devel +``` +#### openSUSE +```sh +# using gcc +zypper in gcc gcc-c++ git cmake ninja SDL2-devel libpng16-devel boost + +# or using clang +zypper in clang libstdc++-devel git cmake ninja SDL2-devel libpng16-devel boost +``` + +### Build + +_Note: If you're using Visual Studio Code, the [CMake Tools plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._ ```bash # Clone the repo git clone https://github.com/HarbourMasters/Shipwright.git cd Shipwright -# Clone the submodule libultraship +# Clone the submodules git submodule update --init # Copy the baserom to the OTRExporter folder cp <path to your ROM> OTRExporter diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 228303558..f653c5de5 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -356,7 +356,13 @@ set(SDL2-INCLUDE ${SDL2_INCLUDE_DIRS}) if (BUILD_REMOTE_CONTROL) find_package(SDL2_net) - set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS}) + + if(NOT SDL2_net_FOUND) + message(STATUS "SDL2_net not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.") + set(BUILD_REMOTE_CONTROL 0) + else() + set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS}) + endif() endif() target_include_directories(${PROJECT_NAME} PRIVATE assets @@ -623,6 +629,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") -Wno-parentheses -Wno-narrowing -Wno-missing-braces + -Wno-int-conversion + -Wno-implicit-int $<$<COMPILE_LANGUAGE:C>: -Werror-implicit-function-declaration -Wno-incompatible-pointer-types diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index b5a0318f6..90634ea31 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -1679,7 +1679,9 @@ s32 Camera_Normal1(Camera* camera) { if (anim->startSwingTimer <= 0) { // idle camera re-center - if (CVarGetInteger("gA11yDisableIdleCam", 0)) return; + if (CVarGetInteger("gA11yDisableIdleCam", 0)) { + return 1; + } eyeAdjustment.pitch = atEyeNextGeo.pitch; eyeAdjustment.yaw = Camera_LERPCeilS(anim->swingYawTarget, atEyeNextGeo.yaw, 1.0f / camera->yawUpdateRateInv, 0xA); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 0651f900b..71a6c1c22 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6613,7 +6613,9 @@ s32 func_8083E5A8(Player* this, PlayState* play) { if(gSaveContext.pendingIceTrapCount) { gSaveContext.pendingIceTrapCount--; GameInteractor_ExecuteOnItemReceiveHooks(ItemTable_RetrieveEntry(MOD_RANDOMIZER, RG_ICE_TRAP)); - if (CVarGetInteger("gAddTraps.enabled", 0)) return; + if (CVarGetInteger("gAddTraps.enabled", 0)) { + return 1; + } this->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_ITEM_OVER_HEAD); this->actor.colChkInfo.damage = 0; func_80837C0C(play, this, 3, 0.0f, 0.0f, 0, 20); |
