From b43f0b0295953c8d5d16c5b9eccaddb5ec214bab Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Wed, 29 Jun 2022 13:35:01 +0200 Subject: [PATCH] allow to specify a macOS provisioning profile having one is one of the prerequisites of using TestFlight Change-Id: I9e20eb99905071fade4179dfbe2da5b7e5dd1c24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136618 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- Makefile.in | 4 +++- config_host.mk.in | 1 + configure.ac | 19 +++++++++++++++++++ lo.xcent.in | 1 + 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 29208d2765cc..beae106e3ede 100644 --- a/Makefile.in +++ b/Makefile.in @@ -387,7 +387,9 @@ ifneq ($(ENABLE_MACOSX_SANDBOX),) rm $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/MacOS/unopkg rm $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/MacOS/unoinfo endif -# +ifneq ($(MACOSX_PROVISIONING_PROFILE),) + cp "$(MACOSX_PROVISIONING_PROFILE)" $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/embedded.provisionprofile +endif ifneq ($(MACOSX_CODESIGNING_IDENTITY),) # Then use the macosx-codesign-app-bundle script @$(SRCDIR)/solenv/bin/macosx-codesign-app-bundle $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app diff --git a/config_host.mk.in b/config_host.mk.in index c924c13c4832..0fd1bc7753f5 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -450,6 +450,7 @@ export MACOSX_BUNDLE_IDENTIFIER=@MACOSX_BUNDLE_IDENTIFIER@ export MACOSX_CODESIGNING_IDENTITY=@MACOSX_CODESIGNING_IDENTITY@ export MACOSX_DEPLOYMENT_TARGET=@MACOSX_DEPLOYMENT_TARGET@ export MACOSX_PACKAGE_SIGNING_IDENTITY=@MACOSX_PACKAGE_SIGNING_IDENTITY@ +export MACOSX_PROVISIONING_PROFILE=@MACOSX_PROVISIONING_PROFILE@ export MACOSX_SDK_PATH=@MACOSX_SDK_PATH@ export MAC_OS_X_VERSION_MIN_REQUIRED=@MAC_OS_X_VERSION_MIN_REQUIRED@ export MANDIR=@MANDIR@ diff --git a/configure.ac b/configure.ac index 919c3a8533e0..08395ac66677 100644 --- a/configure.ac +++ b/configure.ac @@ -1899,6 +1899,11 @@ AC_ARG_WITH(macosx-bundle-identifier, org.libreoffice.script ("script", huh?).]), ,with_macosx_bundle_identifier=org.libreoffice.script) +AC_ARG_WITH(macosx-provisioning-profile, + AS_HELP_STRING([--with-macosx-provisioning-profile=/path/to/mac.provisionprofile], + [Specify the path to a provisioning profile to use]), +,) + AC_ARG_WITH(product-name, AS_HELP_STRING([--with-product-name='My Own Office Suite'], [Define the product name. Default is AC_PACKAGE_NAME.]), @@ -3615,6 +3620,18 @@ if test $_os = Darwin; then AC_MSG_CHECKING([what macOS app bundle identifier to use]) MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER]) + + if test -n "$with_macosx_provisioning_profile" ; then + if test ! -f "$with_macosx_provisioning_profile"; then + AC_MSG_ERROR([provisioning profile not found at $with_macosx_provisioning_profile]) + else + MACOSX_PROVISIONING_PROFILE=$with_macosx_provisioning_profile + MACOSX_PROVISIONING_INFO=$([security cms -D -i "$MACOSX_PROVISIONING_PROFILE" | \ + xmllint --xpath "//key[.='com.apple.application-identifier' or .='com.apple.developer.team-identifier'] \ + | //key[.='com.apple.application-identifier' or .='com.apple.developer.team-identifier']/following-sibling::string[1]" - | \ + sed -e 's#><#>\n\t<#g' -e 's#^#\t#']) + fi + fi fi AC_SUBST(MACOSX_SDK_PATH) AC_SUBST(MACOSX_DEPLOYMENT_TARGET) @@ -3625,6 +3642,8 @@ AC_SUBST(MACOSX_CODESIGNING_IDENTITY) AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY) AC_SUBST(ENABLE_MACOSX_SANDBOX) AC_SUBST(MACOSX_BUNDLE_IDENTIFIER) +AC_SUBST(MACOSX_PROVISIONING_INFO) +AC_SUBST(MACOSX_PROVISIONING_PROFILE) dnl =================================================================== dnl Check iOS SDK and compiler diff --git a/lo.xcent.in b/lo.xcent.in index 9a0838fbc388..4b7303876e6b 100644 --- a/lo.xcent.in +++ b/lo.xcent.in @@ -22,5 +22,6 @@ com.apple.security.personal-information.addressbook @SDREMOTE_ENTITLEMENT@ +@MACOSX_PROVISIONING_INFO@ -- 2.11.4.GIT