From 9d6fa842de968bc4875d15e225e48b2da2284db5 Mon Sep 17 00:00:00 2001 From: Dextinfire <> Date: Sat, 7 Sep 2024 19:56:08 -0700 Subject: [PATCH] Try to fix linux --- .github/workflows/pipeline.yml | 31 +++++++++------- CMakeLists.txt | 9 +++-- CMakePresets.json | 4 +-- modules/FindOgg.cmake | 35 ++++++++++++++++++ modules/FindOggVorbis.cmake | 65 ---------------------------------- modules/FindVorbis.cmake | 49 +++++++++++++++++++++++++ 6 files changed, 110 insertions(+), 83 deletions(-) create mode 100644 modules/FindOgg.cmake delete mode 100644 modules/FindOggVorbis.cmake create mode 100644 modules/FindVorbis.cmake diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 19db9eb2..bb98af09 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -37,6 +37,8 @@ jobs: triplet: x64-osx-release env: VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} + VCPKG_TARGET_TRIPLET: ${{ matrix.triplet }} + VCPKG_HOST_TRIPLET: ${{ matrix.triplet }} vcpkgCommitId: '0f88ecb8528605f91980b90a2c5bad88e3cb565f' steps: @@ -65,7 +67,9 @@ jobs: if: matrix.os =='macos-latest' || matrix.os == 'ubuntu-latest' run: |- pushd vendor - git clone https://github.com/Thealexbarney/LibAtrac9.git --depth 1 + if [ ! -d "LibAtrac9" ]; then + git clone https://github.com/Thealexbarney/LibAtrac9.git --depth 1 + fi cd LibAtrac9/C if [ "${{ matrix.os_name }}" == 'macos' ]; then sed -i '' -e 's/,--version-script=libatrac9.version//g' Makefile @@ -76,9 +80,9 @@ jobs: cp bin/libatrac9.a ../libs/ cp src/libatrac9.h ../include/libatrac9/ popd - echo "LIBATRAC9DIR=vendor/LibAtrac9" >> $GITHUB_ENV + echo "LIBATRAC9DIR=${{ github.workspace }}/vendor/LibAtrac9" >> $GITHUB_ENV - name: Install Dependencies Linux - run: sudo apt-get install nasm libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libxrandr-dev libvorbis-dev libogg-dev + run: sudo apt-get install nasm libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libxrandr-dev if: matrix.os_name == 'linux' - name: Install Dependencies Mac run: brew install nasm @@ -89,6 +93,7 @@ jobs: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' configurePreset: ci-release buildPreset: CI-Build + configurePresetAdditionalArgs: "['--debug-find']" - name: Copy docs run: | @@ -141,11 +146,11 @@ jobs: - uses: tsickert/discord-webhook@v5.3.0 with: - channelid: ${{ secrets.discordChannelId }} + webhook-id: ${{ secrets.discordChannelId }} webhook-url: ${{ secrets.discordWebhookKey }} - name: IMPACTO - avatar: https://cdn.discordapp.com/emojis/766988033127481344.png - embed-title : "${{ github.actor }}" + username: IMPACTO + avatar-url: https://cdn.discordapp.com/emojis/766988033127481344.png + embed-title : "${{ github.event.commits[0].author.name }}" embed-color: 3659647 embed-timestamp: ${{ env.NOW }} embed-description: > @@ -162,7 +167,7 @@ jobs: needs: - job-matrix - if: ${{needs.*.result}} == "failure" || ${{needs.*.result}} == "cancelled" + if: always() && contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') steps: - uses: actions/checkout@v2 - name: 'Get Jobs Status' @@ -172,7 +177,7 @@ jobs: json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \ "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs") - name_conclusion_array=($(echo "$json_data" | jq -r '.jobs[] | select(.name | startswith("jobs-matrix")) | "\(.name).\(.conclusion)"')) + name_conclusion_array=($(echo "$json_data" | jq -r '.jobs[] | select(.name | startswith("job-matrix")) | "\(.name).\(.conclusion)"')) for item in "${name_conclusion_array[@]}"; do IFS='.' read -r name conclusion <<< "$item" @@ -185,11 +190,11 @@ jobs: - uses: tsickert/discord-webhook@v5.3.0 with: - channelid: ${{ secrets.discordChannelId }} + webhook-id: ${{ secrets.discordChannelId }} webhook-url: ${{ secrets.discordWebhookKey }} - name: IMPACTO - avatar: https://cdn.discordapp.com/emojis/766988033127481344.png - embed-title : "${{ github.actor }}" + username: IMPACTO + avatar-url: https://cdn.discordapp.com/emojis/766988033127481344.png + embed-title : "${{ github.event.commits[0].author.name }}" embed-color: 16711680 embed-timestamp: ${{ steps.date.outputs.NOW }} embed-description: > diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d3d95d6..a00d1c6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -774,10 +774,12 @@ if (EMSCRIPTEN) else () find_package(SDL2 REQUIRED) find_package(ZLIB REQUIRED) - find_package(OggVorbis REQUIRED) + find_package(Ogg REQUIRED) + find_package(Vorbis REQUIRED) find_package(WebP REQUIRED) - include_directories(${OGGVORBIS_INCLUDE_DIRS}) + include_directories(${OGG_INCLUDE_DIR}) + include_directories(${VORBIS_INCLUDE_DIRS}) if (NX) list(APPEND Impacto_Libs @@ -807,7 +809,8 @@ else () list(APPEND Impacto_Libs ${SDL2_LIBRARIES} ZLIB::ZLIB - ${OGGVORBIS_LIBRARIES} + ${OGG_LIBRARY} + ${VORBIS_LIBRARIES} ${WebP_LIBRARIES} ) diff --git a/CMakePresets.json b/CMakePresets.json index 93f33f11..3b246a81 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,8 +1,8 @@ { - "version": 8, + "version": 4, "cmakeMinimumRequired": { "major": 3, - "minor": 14 + "minor": 23 }, "configurePresets": [ { diff --git a/modules/FindOgg.cmake b/modules/FindOgg.cmake new file mode 100644 index 00000000..09aae8bd --- /dev/null +++ b/modules/FindOgg.cmake @@ -0,0 +1,35 @@ +set(_LIBOGG_SEARCH + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + /usr + /usr/local +) + +foreach(search ${_LIBOGG_SEARCH}) + +find_path(OGG_INCLUDE_DIR ogg/ogg.h + HINTS + ENV OGGDIR + PATH_SUFFIXES include +) + +find_library(OGG_LIBRARY + NAMES ogg + HINTS + ENV OGGDIR + PATH_SUFFIXES libx32 lib64 lib libs64 libs +) + +endforeach() + +unset(_LIBOGG_SEARCH) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ogg DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR) + +mark_as_advanced(OGG_LIBRARY OGG_INCLUDE_DIR) \ No newline at end of file diff --git a/modules/FindOggVorbis.cmake b/modules/FindOggVorbis.cmake deleted file mode 100644 index 469e45e6..00000000 --- a/modules/FindOggVorbis.cmake +++ /dev/null @@ -1,65 +0,0 @@ -set(_OGGVORBIS_SEARCH - PATHS - ~/Library/Frameworks - /Library/Frameworks - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt -) - -foreach(search ${_OGGVORBIS_SEARCH}) - -find_path(OGG_INCLUDE_DIR ogg/ogg.h - HINTS - ENV OGGDIR - PATH_SUFFIXES include -) - -find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h - HINTS - ENV VORBISDIR - PATH_SUFFIXES include - -) - -find_library(OGG_LIBRARY - NAMES ogg - HINTS - ENV OGGDIR - PATH_SUFFIXES libx32 lib64 lib libs64 libs -) - -find_library(VORBIS_LIBRARY - NAMES vorbis - HINTS - ENV VORBISDIR - PATH_SUFFIXES libx32 lib64 lib libs64 libs -) - -find_library(VORBISFILE_LIBRARY - NAMES vorbisfile - HINTS - ENV VORBISDIR - PATH_SUFFIXES libx32 lib64 lib libs64 libs -) - -endforeach() - -unset(_OGGVORBIS_SEARCH) - -set(OGGVORBIS_LIBRARIES - ${OGG_LIBRARY} - ${VORBIS_LIBRARY} - ${VORBISFILE_LIBRARY} -) - -set(OGGVORBIS_INCLUDE_DIRS - ${OGG_INCLUDE_DIR} - ${VORBIS_INCLUDE_DIR} -) - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OggVorbis DEFAULT_MSG OGGVORBIS_LIBRARIES OGGVORBIS_INCLUDE_DIRS) - -mark_as_advanced(OGGVORBIS_LIBRARIES OGGVORBIS_INCLUDE_DIRS) \ No newline at end of file diff --git a/modules/FindVorbis.cmake b/modules/FindVorbis.cmake new file mode 100644 index 00000000..fe6a1b71 --- /dev/null +++ b/modules/FindVorbis.cmake @@ -0,0 +1,49 @@ + +set(_LIBVORBIS_SEARCH + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + /usr + /usr/local +) + +foreach(search ${_LIBVORBIS_SEARCH}) + +find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h + HINTS + ENV VORBISDIR + PATH_SUFFIXES include + +) + +find_library(VORBIS_LIBRARY + NAMES vorbis + HINTS + ENV VORBISDIR + PATH_SUFFIXES libx32 lib64 lib libs64 libs +) + +find_library(VORBISFILE_LIBRARY + NAMES vorbisfile Vorbis::vorbisFile + HINTS + ENV VORBISDIR + PATH_SUFFIXES libx32 lib64 lib libs64 libs +) + +endforeach() + +unset(_LIBVORBIS_SEARCH) + +set(VORBIS_LIBRARIES + ${VORBIS_LIBRARY} + ${VORBISFILE_LIBRARY} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Vorbis DEFAULT_MSG VORBIS_LIBRARIES VORBIS_INCLUDE_DIR) + +mark_as_advanced(VORBIS_LIBRARIES VORBIS_INCLUDE_DIR) \ No newline at end of file