#603

fix(macos): add macOS build support, runtime fixes, and test compatibility

OpenLeeroyDingwants to merge intofrom

Summary

This PR enables building, packaging, running, passing the full test suite, and CI workflows on macOS (Apple Silicon arm64).

Key Changes

  1. Build Configuration & Linker Fixes:

    • cmake/dependencies/ffmpeg.cmake & tests/CMakeLists.txt: Added Apple frameworks (CoreFoundation, CoreMedia, CoreVideo, VideoToolbox, AudioToolbox) required for static FFmpeg linking on macOS.
    • cmake/dependencies/macos.cmake & cmake/compile_definitions/macos.cmake: Linked ZLIB::ZLIB so confighttp log export/compression symbols resolve cleanly on macOS.
    • cmake/targets/web.cmake: Declared Web UI build artifacts as OUTPUT rather than only BYPRODUCTS of add_custom_command to satisfy Unix Makefile generator dependencies.
    • cmake/packaging/macos.cmake: Copied macOS assets (apps.json) to build assets directory unconditionally so they are bundled into local build trees and app packages.
  2. macOS Platform & API Updates:

    • src/platform/macos/misc.mm: Updated Boost Process v2 working directory API from v2::start_dir to v2::process_start_dir matching Boost 1.89 specifications.
    • src/platform/macos/publish.cpp: Passed platf::SERVICE_TYPE.data() (const char*) to DNSServiceRegister instead of std::string_view.
    • src/webrtc_stream.cpp: Declared and reset output_override_lease unconditionally across all platforms.
    • src/main.cpp: Added macOS app bundle resource directory resolution so relative bundle assets (../Resources/assets) resolve regardless of launch working directory.
  3. Compiler & libc++ Compatibility:

    • src/steam_artwork.cpp: Cast time_since_epoch().count() to std::intmax_t to resolve __int128 narrowing errors in struct initialization under Apple Clang.
    • src/steam_auto_sync_policy.cpp, src/provider_scan_protocol.cpp, src/lutris_integration.cpp: Cast last_write_time().time_since_epoch().count() to std::int64_t to resolve ambiguous std::to_string overloads with __int128.
  4. Test Suite Compatibility:

    • tests/unit/test_pyrowave_udp_probe.cpp: Handled stranger socket binding gracefully on platforms like macOS/BSD where only 127.0.0.1 is pre-assigned to lo0.
    • tests/unit/platform/windows/test_frame_limiter_vsync.py & tests/unit/platform/windows/test_virtual_capture_readiness.py: Added libc++ Windows ctype mask definitions when compiling mock -D_WIN32 harnesses with Apple Clang.
  5. CI Workflows & Automation:

    • .github/workflows/ci.yml: Added build-macos job alongside Windows and Arch Linux, ensuring every PR and tag build compiles, tests, and packages macOS.
    • .github/workflows/ci-macos.yml: Added automated test suite execution (ctest), added missing Homebrew dependencies (webp, jpeg-turbo, libpng), and added flexible defaults for workflow inputs.
    • .github/workflows/validate-macos.yml: Added on-demand workflow dispatch for running macOS validation and tests against any branch or commit.
    • scripts/macos_build.sh: Added image dependencies (webp, jpeg-turbo, libpng) to manual build formula list.

Verification

  • Successfully built Vibepollo.app on macOS (arm64, Apple Clang, macOS 15+ SDK).
  • Ran ./build/Vibepollo.app/Contents/MacOS/Vibepollo --version and --help cleanly.
  • Successfully verified running daemon and Web UI service on https://127.0.0.1:47990.
  • ctest --test-dir build --output-on-failure: 100% passed (91 passed, 1 skipped: Windows-only Playnite test skipped on macOS).