diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 73892c3..3fa53b5 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -55,12 +55,11 @@ jobs: git clone http://oauth2:$GITHUB_TOKEN@git.such.software:3000/${{ github.repository }}.git . git submodule update --init --recursive - # --- SURGICAL PATCH (Linux/Windows) --- - # Removes 'final' only from rest_server::handler_loop to satisfy Boost 1.90 + # --- FIX 1: Robust 'final' removal using Perl (Handles whitespace better than sed) --- - name: Patch Source Code run: | echo "Patching src/rest_server.cpp..." - sed -i 's/struct rest_server::handler_loop final/struct rest_server::handler_loop/g' src/rest_server.cpp + perl -pi -e 's/struct rest_server::handler_loop final/struct rest_server::handler_loop/g' src/rest_server.cpp - name: Download Static SDK run: | @@ -76,6 +75,16 @@ jobs: mkdir -p /opt/wownero-sdk tar -xf sdk.tar.gz -C /opt/wownero-sdk + # --- FIX 2: Normalize SDK Libraries (Fixes missing libhidapi.a) --- + - name: Fix SDK Libraries + run: | + echo "Fixing missing library names..." + # If libhidapi-libusb.a exists but libhidapi.a doesn't, copy it. + if [ -f /opt/wownero-sdk/lib/libhidapi-libusb.a ] && [ ! -f /opt/wownero-sdk/lib/libhidapi.a ]; then + echo "Found libhidapi-libusb.a, creating libhidapi.a alias..." + cp /opt/wownero-sdk/lib/libhidapi-libusb.a /opt/wownero-sdk/lib/libhidapi.a + fi + - name: Install Modern CMake run: | echo "Installing CMake 3.28.1..." @@ -90,10 +99,7 @@ jobs: PLATFORM_FLAGS="" if [ "${{ matrix.target }}" == "x86_64-w64-mingw32" ]; then - # WINDOWS FIX: - # 1. -static: Force static linking - # 2. --allow-multiple-definition: Fixes the Boost duplicate symbol errors - # 3. -L...: Tells linker specifically where to find -lzstd and -levent + # WINDOWS: Force static, allow duplicates, fix lib paths PLATFORM_FLAGS="-DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ @@ -112,16 +118,11 @@ jobs: -DCMAKE_LINKER=/usr/bin/aarch64-linux-gnu-ld" elif [ "${{ matrix.target }}" == "riscv64-linux-gnu" ]; then - # RISC-V Fix: Check for libhidapi variants - HIDAPI_LIB="$SDK_DIR/lib/libhidapi.a" - if [ ! -f "$HIDAPI_LIB" ]; then HIDAPI_LIB="$SDK_DIR/lib/libhidapi-libusb.a"; fi - PLATFORM_FLAGS="-DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=riscv64 \ -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \ -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++ \ - -DCMAKE_LINKER=/usr/bin/riscv64-linux-gnu-ld \ - -DHIDAPI_LIBRARY=$HIDAPI_LIB" + -DCMAKE_LINKER=/usr/bin/riscv64-linux-gnu-ld" fi cmake .. $PLATFORM_FLAGS \ @@ -175,7 +176,6 @@ jobs: - target: x86_64-apple-darwin11 arch: x86_64 platform: macos-x64 - # macOS ARM64 might still fail due to Core SDK issues, but this is the best we can do for now - target: aarch64-apple-darwin11 arch: arm64 platform: macos-arm64 @@ -191,12 +191,11 @@ jobs: find . -name "CMakeLists.txt" -print0 | xargs -0 perl -pi -e 's/\brt\b//g' - # --- SURGICAL PATCH (macOS) --- - # Note: sed on macOS requires empty string for -i backup extension + # --- FIX 1: Robust 'final' removal using Perl on macOS too --- - name: Patch Source Code run: | echo "Patching src/rest_server.cpp..." - sed -i '' 's/struct rest_server::handler_loop final/struct rest_server::handler_loop/g' src/rest_server.cpp + perl -pi -e 's/struct rest_server::handler_loop final/struct rest_server::handler_loop/g' src/rest_server.cpp - name: Install CMake Only run: brew install cmake