From d6e4ba296e9018835b8150cc0bb2a80bd0720bc8 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 17 Sep 2018 15:58:19 -0700 Subject: [PATCH] Mac: codesign app and dmg Gets the cached CODESIGNID value via cmake and signs the app and dmg with it. --- tools/osx/macosx_bundle.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 591699cbb..e5c9d0bd3 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -199,8 +199,11 @@ s|@arch@|${arch}|" \ "${CONTENTS}/Info.plist" plutil -convert binary1 "${CONTENTS}/Info.plist" - - +# Sign the app +CODESIGNID="$(cmake .. -LA -N | grep "CODESIGNID" | cut -d "=" -f2)" +codesign --deep --force -v -s "${CODESIGNID}" "${APP}" +spctl -a -vvvv "${APP}" + function CreateDmg { local srcDir="$(mktemp -dt $$)" @@ -227,6 +230,9 @@ function CreateDmg { msg "Creating disk image:" hdiutil create -format UDBZ -srcdir "${srcDir}" -volname "${PROJECT_NAME}_${PROJECT_FULL_VERSION}" "${dmg_name}.dmg" + # Sign disk image + codesign --deep --force -v -s "${CODESIGNID}" "${dmg_name}.dmg" + # Zip disk image for redistribution zip "${dmg_name}.zip" "${dmg_name}.dmg" AboutThisBuild.txt rm "${dmg_name}.dmg"