From 93be7c8b8a00a0634712d8273883342a1746abd2 Mon Sep 17 00:00:00 2001 From: uncor3 Date: Mon, 26 Jan 2026 13:34:55 +0300 Subject: [PATCH] fix(build): add libarchive dependency and improve WinFsp installation retries --- .github/workflows/build-windows.yml | 27 ++++++++++++++++++++++++++- CMakeLists.txt | 10 +++++++++- lib/uxplay | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index a23e6f9..d388a31 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -68,6 +68,7 @@ jobs: mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav mingw-w64-x86_64-libheif + mingw-w64-x86_64-libarchive - uses: actions/setup-dotnet@v5 with: @@ -92,7 +93,31 @@ jobs: - name: Install WinFsp shell: pwsh run: | - choco install winfsp -y + $maxRetries = 3 + $retryDelaySeconds = 10 + $attempt = 0 + $success = $false + + while ($attempt -lt $maxRetries -and -not $success) { + $attempt++ + Write-Host "Attempt $attempt to install WinFsp..." + choco install winfsp -y + if ($LASTEXITCODE -eq 0) { + Write-Host "WinFsp installed successfully on attempt $attempt." + $success = $true + } else { + Write-Warning "WinFsp installation failed on attempt $attempt (exit code: $LASTEXITCODE)." + if ($attempt -lt $maxRetries) { + Write-Host "Retrying in $retryDelaySeconds seconds..." + Start-Sleep -Seconds $retryDelaySeconds + } + } + } + + if (-not $success) { + Write-Error "Failed to install WinFsp after $maxRetries attempts." + exit 1 # Explicitly fail the step if all retries fail + } - name: Download and Extract Bonjour SDK run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index b0f5c7f..97ad4eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ cmake_minimum_required(VERSION 3.16) project(iDescriptor VERSION 0.1.2 LANGUAGES CXX) +if(WIN32) + set(PKG_CONFIG_EXECUTABLE "C:/msys64/mingw64/bin/pkg-config.exe" CACHE FILEPATH "" FORCE) +endif() + # Feature options option(ENABLE_RECOVERY_DEVICE_SUPPORT "Enable recovery device support (requires libirecovery)" ON) set(PACKAGE_MANAGER_HINT "" CACHE STRING "Name of package manager(s) used to manage this build (e.g. paru, yay, pamac)") @@ -115,11 +119,14 @@ find_library(TATSU_LIBRARY REQUIRED ) -# Add QR code generation library pkg_check_modules(QRENCODE REQUIRED IMPORTED_TARGET libqrencode) pkg_check_modules(HEIF REQUIRED IMPORTED_TARGET libheif) pkg_check_modules(ZIP REQUIRED IMPORTED_TARGET libzip) +if(WIN32) + pkg_check_modules(LIBARCHIVE REQUIRED IMPORTED_TARGET libarchive) +endif() + # Add FFmpeg libraries for video thumbnail generation pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat) pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec) @@ -304,6 +311,7 @@ if(APPLE) ${CORE_SERVICES_FRAMEWORK}) message(STATUS "Using macOS Bonjour framework for network service discovery") elseif (WIN32) + target_link_libraries(iDescriptor PRIVATE PkgConfig::LIBARCHIVE) find_path(DNSSD_INCLUDE_DIR dns_sd.h HINTS ${BONJOUR_SDK}/Include ) # $<$ fixes winres compiler errors target_include_directories(iDescriptor PRIVATE diff --git a/lib/uxplay b/lib/uxplay index bd5e2de..f8459c2 160000 --- a/lib/uxplay +++ b/lib/uxplay @@ -1 +1 @@ -Subproject commit bd5e2de5c2ff2d9dc1f0905549d145deacf1f86c +Subproject commit f8459c25ec1b119d448297e687223f06a22b324f