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)

253
dist/macos/Info.mas.plist.in vendored Normal file
View File

@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>strawberry</string>
<key>CFBundleGetInfoString</key>
<string>Strawberry ${STRAWBERRY_VERSION_DISPLAY}</string>
<key>CFBundleIconFile</key>
<string>strawberry.icns</string>
<key>CFBundleIdentifier</key>
<string>@MACOS_BUNDLE_ID@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${STRAWBERRY_VERSION_DISPLAY}</string>
<key>CFBundleName</key>
<string>Strawberry</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${STRAWBERRY_VERSION_DISPLAY}</string>
<key>CFBundleVersion</key>
<string>${STRAWBERRY_VERSION_PACKAGE}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.music</string>
<key>LSMinimumSystemVersion</key>
<string>@LSMinimumSystemVersion@</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>@MACOS_BUNDLE_ID@</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tidal</string>
</array>
</dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
<string>fold</string>
<string>disk</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>xspf</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>Generic.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/xspf+xml</string>
</array>
<key>CFBundleTypeName</key>
<string>XSPF Playlist</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>wav</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>audio/x-wav</string>
</array>
<key>CFBundleTypeName</key>
<string>WAVE Audio File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pls</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>pls.icns</string>
<key>CFBundleTypeName</key>
<string>Shoutcast playlist</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>m3u</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>m3u.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>audio/x-mpegurl</string>
</array>
<key>CFBundleTypeName</key>
<string>Playlist file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>aac</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>mpeg4.icns</string>
<key>CFBundleTypeName</key>
<string>AAC file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ogg</string>
<string>ogx</string>
<string>ogm</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>ogg.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>audio/ogg</string>
</array>
<key>CFBundleTypeName</key>
<string>Ogg Vorbis File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>oga</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>ogg.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>audio/ogg</string>
</array>
<key>CFBundleTypeName</key>
<string>Ogg Audio File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>wma</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>wma.icns</string>
<key>CFBundleTypeName</key>
<string>WIndows Media Audio</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mp3</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>mp3.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>audio/mpeg</string>
</array>
<key>CFBundleTypeName</key>
<string>MPEG Audio Layer 3</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>3gp</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>3GPP File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>m4a</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>mpeg4.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-4 Audio File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mpc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>generic.icns</string>
<key>CFBundleTypeName</key>
<string>Musepack Audio File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>flac</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>generic.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>audio/flac</string>
</array>
<key>CFBundleTypeName</key>
<string>FLAC Audio File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
</dict>
</plist>

View File

@@ -13,7 +13,7 @@
<key>CFBundleIconFile</key>
<string>strawberry.icns</string>
<key>CFBundleIdentifier</key>
<string>org.strawberrymusicplayer.strawberry</string>
<string>@MACOS_BUNDLE_ID@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
@@ -34,6 +34,8 @@
<string>public.app-category.music</string>
<key>LSMinimumSystemVersion</key>
<string>@LSMinimumSystemVersion@</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>SUFeedURL</key>
<string>@SPARKLE_FEED_URL@</string>
<key>SUPublicEDKey</key>
@@ -44,7 +46,7 @@
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>org.strawberrymusicplayer.strawberry</string>
<string>@MACOS_BUNDLE_ID@</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tidal</string>

20
dist/macos/entitlements.mas.plist vendored Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Enable the App Sandbox (required for Mac App Store). -->
<key>com.apple.security.app-sandbox</key>
<true/>
<!-- Strawberry is a client app that needs outbound network access (streaming/scrobbling/etc). -->
<key>com.apple.security.network.client</key>
<true/>
<!-- Allow access to user-selected music folders/files (via NSOpenPanel security-scoped bookmarks). -->
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<!-- If iPod classic / other device access is rejected, we'll adjust entitlements after App Review feedback. -->
</dict>
</plist>