Implement Mac App Store build support by introducing the BUILD_FOR_MAC_APP_STORE option. This change disables Sparkle and localhost OAuth redirect server for MAS builds, updates CMake configuration, and modifies build scripts accordingly. Additionally, the macOS bundle identifier is now configurable via CMake.

This commit is contained in:
2026-01-22 19:28:00 +09:00
parent 6a1d8bbc87
commit bd59c19301
11 changed files with 479 additions and 29 deletions

33
dist/CMakeLists.txt vendored
View File

@@ -10,21 +10,26 @@ if(APPLE)
set(LSMinimumSystemVersion 12.0)
endif()
# Sparkle (macOS updates)
# These values are embedded into Info.plist and control where the app checks for updates.
# Downstream builders can override on the CMake command line:
# -DSPARKLE_FEED_URL="https://example.com/appcast.xml"
# -DSPARKLE_PUBLIC_ED25519_KEY="base64=="
#
# Defaults preserve upstream behavior, but are intentionally configurable for third-party builds.
if(NOT DEFINED SPARKLE_FEED_URL)
set(SPARKLE_FEED_URL "https://www.strawberrymusicplayer.org/sparkle-macos-@ARCH@")
endif()
if(NOT DEFINED SPARKLE_PUBLIC_ED25519_KEY)
set(SPARKLE_PUBLIC_ED25519_KEY "/OydhYVfypuO2Mf7G6DUqVZWW9G19eFV74qaDCBTOUk=")
endif()
if(BUILD_FOR_MAC_APP_STORE)
# MAS builds must not embed Sparkle update configuration in Info.plist.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.mas.plist.in ${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist)
else()
# Sparkle (macOS updates)
# These values are embedded into Info.plist and control where the app checks for updates.
# Downstream builders can override on the CMake command line:
# -DSPARKLE_FEED_URL="https://example.com/appcast.xml"
# -DSPARKLE_PUBLIC_ED25519_KEY="base64=="
#
# Defaults preserve upstream behavior, but are intentionally configurable for third-party builds.
if(NOT DEFINED SPARKLE_FEED_URL)
set(SPARKLE_FEED_URL "https://www.strawberrymusicplayer.org/sparkle-macos-@ARCH@")
endif()
if(NOT DEFINED SPARKLE_PUBLIC_ED25519_KEY)
set(SPARKLE_PUBLIC_ED25519_KEY "/OydhYVfypuO2Mf7G6DUqVZWW9G19eFV74qaDCBTOUk=")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist)
endif()
endif()
if(WIN32)