From 634fd3231ca97d7890ecf1e0ff0be396bdcdd5ef Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 5 Nov 2022 22:25:59 +0100 Subject: [PATCH] CI/cmake: Update Sparkle to 2.3.2 --- .github/workflows/main.yml | 6 ++++-- CI/macos/02_build_obs.sh | 5 +++++ cmake/Modules/ObsDefaults_macOS.cmake | 5 ++++- cmake/Modules/ObsHelpers_macOS.cmake | 14 ++------------ cmake/bundle/macOS/bundleutils.cmake | 15 --------------- 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d9bf9518..8b3e73c35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,8 +92,10 @@ jobs: env: MACOSX_DEPLOYMENT_TARGET_X86_64: '10.15' MACOSX_DEPLOYMENT_TARGET_ARM64: '11.0' - SPARKLE_VERSION: '1.26.0' - SPARKLE_HASH: '8312cbf7528297a49f1b97692c33cb8d33254c396dc51be394e9484e4b6833a0' + SPARKLE_VERSION: '2.3.2' + SPARKLE_HASH: '2b3fe6918ca20a83729aad34f8f693a678b714a17d33b5f13ca2d25edfa7eed3' + SPARKLE_APPCAST_URL: 'https://obsproject.com/osx_update/updates_${{ matrix.arch }}_v2.xml' + SPARKLE_PUBLIC_KEY: 'HQ5/Ba9VHOuEWaM0jtVjZzgHKFJX9YTl+HNVpgNF0iM=' BLOCKED_FORMULAS: 'speexdsp curl php composer' CODESIGN_IDENT: '-' HAVE_CODESIGN_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY != '' && secrets.MACOS_SIGNING_CERT != '' }} diff --git a/CI/macos/02_build_obs.sh b/CI/macos/02_build_obs.sh index 073faa332..23c347ec3 100755 --- a/CI/macos/02_build_obs.sh +++ b/CI/macos/02_build_obs.sh @@ -69,6 +69,10 @@ _configure_obs() { UNITTEST_OPTIONS="-DENABLE_UNIT_TESTS=ON" fi + if [ "${SPARKLE_APPCAST_URL}" -a "${SPARKLE_PUBLIC_KEY}" ]; then + SPARKLE_OPTIONS="-DSPARKLE_APPCAST_URL=\"${SPARKLE_APPCAST_URL}\" -DSPARKLE_PUBLIC_KEY=\"${SPARKLE_PUBLIC_KEY}\"" + fi + cmake -S . -B ${BUILD_DIR} -G ${GENERATOR} \ -DCEF_ROOT_DIR="${DEPS_BUILD_DIR}/cef_binary_${MACOS_CEF_BUILD_VERSION:-${CI_MACOS_CEF_VERSION}}_macos_${ARCH:-x86_64}" \ -DENABLE_BROWSER=ON \ @@ -86,6 +90,7 @@ _configure_obs() { ${TWITCH_OPTIONS} \ ${RESTREAM_OPTIONS} \ ${UNITTEST_OPTIONS} \ + ${SPARKLE_OPTIONS} \ ${CI:+-DBUILD_FOR_DISTRIBUTION=${BUILD_FOR_DISTRIBUTION} -DOBS_BUILD_NUMBER=${GITHUB_RUN_ID}} \ ${QUIET:+-Wno-deprecated -Wno-dev --log-level=ERROR} } diff --git a/cmake/Modules/ObsDefaults_macOS.cmake b/cmake/Modules/ObsDefaults_macOS.cmake index 376413559..2822d6f85 100644 --- a/cmake/Modules/ObsDefaults_macOS.cmake +++ b/cmake/Modules/ObsDefaults_macOS.cmake @@ -138,10 +138,13 @@ macro(setup_obs_project) endif() if(BUILD_FOR_DISTRIBUTION OR DEFINED ENV{CI}) - set_option(ENABLE_SPARKLE_UPDATER ON) set_option(ENABLE_RTMPS ON) endif() + if(DEFINED SPARKLE_APPCAST_URL AND DEFINED SPARKLE_PUBLIC_KEY) + set_option(ENABLE_SPARKLE_UPDATER ON) + endif() + set(CPACK_PACKAGE_NAME "OBS") set(CPACK_PACKAGE_VENDOR "${OBS_WEBSITE}") set(CPACK_GENERATOR "DragNDrop") diff --git a/cmake/Modules/ObsHelpers_macOS.cmake b/cmake/Modules/ObsHelpers_macOS.cmake index 8e7f4c8b5..fb64515ec 100644 --- a/cmake/Modules/ObsHelpers_macOS.cmake +++ b/cmake/Modules/ObsHelpers_macOS.cmake @@ -360,7 +360,7 @@ function(setup_obs_bundle target) POST_BUILD COMMAND /bin/sh -c - "plutil -replace SUFeedURL -string https://obsproject.com/osx_update/stable/updates_${CMAKE_OSX_ARCHITECTURES}.xml \"$/Info.plist\"" + "plutil -replace SUFeedURL -string ${SPARKLE_APPCAST_URL} \"$/Info.plist\"" VERBATIM) add_custom_command( @@ -368,19 +368,9 @@ function(setup_obs_bundle target) POST_BUILD COMMAND /bin/sh -c - "plutil -replace SUPublicDSAKeyFile -string OBSPublicDSAKey.pem \"$/Info.plist\"" + "plutil -replace SUPublicEDKey -string \"${SPARKLE_PUBLIC_KEY}\" \"$/Info.plist\"" VERBATIM) - target_sources( - ${target} - PRIVATE "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/OBSPublicDSAKey.pem") - set_source_files_properties( - "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/OBSPublicDSAKey.pem" - PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - source_group( - "Resources" - FILES "${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/OBSPublicDSAKey.pem") - install( DIRECTORY ${SPARKLE} DESTINATION $.app/Contents/Frameworks diff --git a/cmake/bundle/macOS/bundleutils.cmake b/cmake/bundle/macOS/bundleutils.cmake index 895c8cb5b..780506d7d 100644 --- a/cmake/bundle/macOS/bundleutils.cmake +++ b/cmake/bundle/macOS/bundleutils.cmake @@ -111,21 +111,6 @@ endif() # Codesign all binaries inside-out message(STATUS "OBS: Codesign dependencies") -if(EXISTS - "${CMAKE_INSTALL_PREFIX}/${_BUNDLENAME}/Contents/Frameworks/Sparkle.framework" -) - execute_process( - COMMAND - /usr/bin/codesign --remove-signature - "${CMAKE_INSTALL_PREFIX}/${_BUNDLENAME}/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app" - ${_VERBOSE_FLAG} ${_QUIET_FLAG}) - execute_process( - COMMAND - /usr/bin/codesign --force --sign "${_CODESIGN_IDENTITY}" --deep --options - runtime - "${CMAKE_INSTALL_PREFIX}/${_BUNDLENAME}/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app" - ${_VERBOSE_FLAG} ${_QUIET_FLAG}) -endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/${_BUNDLENAME}/Contents/Frameworks/Chromium Embedded Framework.framework" )