configure.ac | 7 ++++++- solenv/bin/macosx-codesign-app-bundle | 16 +++++++++------- sysui/desktop/macosx/Info.plist.in | 4 ++++ 3 files changed, 19 insertions(+), 8 deletions(-)
New commits: commit 6e6c6f697b019348161648d9d26398bf64de83ef Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> AuthorDate: Tue Oct 18 13:12:29 2022 +0200 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Sun Oct 23 12:11:38 2022 +0200 macOS sandbox: only use com.apple.application-identifier for main package when multiple files are signed with that entitlement, the build will just be listed with "Not Available for Testing" via Testflight Change-Id: I92957f24513ab419ddbc4289b53175932111c198 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141497 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/solenv/bin/macosx-codesign-app-bundle b/solenv/bin/macosx-codesign-app-bundle index a29b339de744..6894329fa406 100755 --- a/solenv/bin/macosx-codesign-app-bundle +++ b/solenv/bin/macosx-codesign-app-bundle @@ -25,11 +25,14 @@ done APP_BUNDLE="$1" entitlements= +application_identifier= if test -n "$ENABLE_MACOSX_SANDBOX"; then # In a sandboxed build executables need the entitlements entitlements="--entitlements $BUILDDIR/lo.xcent" + application_identifier=`/usr/libexec/PlistBuddy -c "print com.apple.application-identifier" $BUILDDIR/lo.xcent` + # remove the key from the entitlement - only use it when signing the whole bundle in the final step + /usr/libexec/PlistBuddy -c "delete com.apple.application-identifier" $BUILDDIR/lo.xcent # All data files are in Resources and included in the app bundle signature - # through that. I think. other_files='' # HACK: remove donate menu entries, need to support apple-pay and be verified # as non profit as a bare minimum to allow asking.... @@ -120,14 +123,13 @@ done # CFBundleExecutable from Info.plist, i.e. soffice, plus the contents # of the Resources tree. # -# At this stage we also attach the entitlements in the sandboxing case -# -# Also omit some files from the Bundle's seal via the resource-rules -# (bootstraprc and similar that the user might adjust and image files) # See also https://developer.apple.com/library/mac/technotes/tn2206/ -id=`echo ${PRODUCTNAME} | tr ' ' '-'` - +if test -n "$ENABLE_MACOSX_SANDBOX" && test -n "$application_identifier"; then + # add back the application-identfier to the entitlements + # testflight/beta-testing won't work if that key is used when signing the other executables + /usr/libexec/PlistBuddy -c "add com.apple.application-identifier string $application_identifier" $BUILDDIR/lo.xcent +fi codesign --force --options=runtime --identifier="${MACOSX_BUNDLE_IDENTIFIER}" --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$APP_BUNDLE" || exit 1 exit 0 commit 3336cb1b3d12e9cd5c2f560c82129dc8ed7527da Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> AuthorDate: Tue Oct 18 12:51:52 2022 +0200 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Sun Oct 23 12:11:29 2022 +0200 macOS: add XCode and SDK buildversions to Info.plist without those submitting a build for external testing via testflight is not possible because appstore thinks you were using a beta version of XCode Change-Id: I6979a9d290c3e67dd9969d6e535625760b639c25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141496 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/configure.ac b/configure.ac index 259001e70b65..a40c08e16b29 100644 --- a/configure.ac +++ b/configure.ac @@ -3428,7 +3428,7 @@ if test $_os = Darwin; then fi AC_MSG_RESULT([macOS SDK $macosx_sdk at $MACOSX_SDK_PATH]) - + MACOSX_SDK_BUILD_VERSION=$(xcodebuild -version -sdk "$MACOSX_SDK_PATH" ProductBuildVersion) case $macosx_sdk in 10.13) MACOSX_SDK_VERSION=101300 @@ -3491,6 +3491,9 @@ if test $_os = Darwin; then AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 12.5]) fi + my_xcode_ver1=$(xcrun xcodebuild -version | tail -n 1) + MACOSX_XCODE_BUILD_VERSION=${my_xcode_ver1#Build version } + case "$with_macosx_version_min_required" in 10.14) MAC_OS_X_VERSION_MIN_REQUIRED="101400" @@ -3661,6 +3664,8 @@ AC_SUBST(ENABLE_MACOSX_SANDBOX) AC_SUBST(MACOSX_BUNDLE_IDENTIFIER) AC_SUBST(MACOSX_PROVISIONING_INFO) AC_SUBST(MACOSX_PROVISIONING_PROFILE) +AC_SUBST(MACOSX_SDK_BUILD_VERSION) +AC_SUBST(MACOSX_XCODE_BUILD_VERSION) dnl =================================================================== dnl Check iOS SDK and compiler diff --git a/sysui/desktop/macosx/Info.plist.in b/sysui/desktop/macosx/Info.plist.in index 6593139019fc..5401687027fa 100644 --- a/sysui/desktop/macosx/Info.plist.in +++ b/sysui/desktop/macosx/Info.plist.in @@ -1961,6 +1961,10 @@ <true/> <key>NSContactsUsageDescription</key> <string>You can add your contacts as a data source for mail merge or similar operations.</string> + <key>DTXcodeBuild</key> + <string>@MACOSX_XCODE_BUILD_VERSION@</string> + <key>DTSDKBuild</key> + <string>@MACOSX_SDK_BUILD_VERSION@</string> </dict> </plist> <!-- vim:set shiftwidth=4 softtabstop=4 expandtab: -->