Skip to content

Commit e0cac75

Browse files
authored
Add macOS signing changes (#1856)
* Add short version to the Info.plist * Add entitlements and work into the qmake project * Add signing details to macdeployqt call * Add some more entitlements * Add app category for apple * Fix up entitlements for signing / notarization for non-app store deployment * Put signing of mac os behind a -s flag in the deploy_mac.sh script * Split out the client / server entitlements Remove hard-coded certificate name * Minimise entitlements and enable sandboxing of the app / server * Remove windows-only resource reference from mac build; add icon to xcode project * Add missing components to Info.plist; sync them up. Put back required RC_FILE (used in deploy_mac.sh) * Add minimum required macOS version as required by app store * Remove whitespace for PR review; remove unneeded team / provisioning profile IDs (only used in xcode project not signing) * Add a changelog entry * Update for consistency with rest of change log
1 parent b09cd68 commit e0cac75

6 files changed

Lines changed: 104 additions & 36 deletions

File tree

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
### 3.8.0dev <- NOTE: the release version number will be 3.8.1 ###
33

4+
- Internal: mac/deploy_mac.sh now takes an optional parameter to a certificate name to sign the build with.
5+
(contributed by @emlynmac)
6+
47
- CLI: Jamulus now shows a link to the Website for translated content (#1759).
58
(contributed by @henkdegroot)
69

Jamulus.entitlements

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.device.audio-input</key>
8+
<true/>
9+
<key>com.apple.security.network.client</key>
10+
<true/>
11+
<key>com.apple.security.network.server</key>
12+
<true/>
13+
</dict>
14+
</plist>

Jamulus.pro

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ win32 {
128128

129129
DEFINES += SERVER_BUNDLE
130130
TARGET = $${TARGET}Server
131-
MACOSX_BUNDLE_ICON_FILE = jamulus-server-icon-2020.icns
131+
MACOSX_BUNDLE_ICON.files = mac/jamulus-server-icon-2020.icns
132132
RC_FILE = mac/jamulus-server-icon-2020.icns
133133
} else {
134-
MACOSX_BUNDLE_ICON_FILE = mainicon.icns
134+
MACOSX_BUNDLE_ICON.files = mac/mainicon.icns
135135
RC_FILE = mac/mainicon.icns
136136
}
137137

@@ -141,11 +141,20 @@ win32 {
141141
HEADERS += mac/activity.h
142142
OBJECTIVE_SOURCES += mac/activity.mm
143143
CONFIG += x86
144-
QMAKE_TARGET_BUNDLE_PREFIX = net.sourceforge.llcon
144+
QMAKE_TARGET_BUNDLE_PREFIX = io.jamulus
145145
QMAKE_APPLICATION_BUNDLE_NAME. = $$TARGET
146146

147+
OSX_ENTITLEMENTS.files = Jamulus.entitlements
148+
OSX_ENTITLEMENTS.path = Contents/Resources
149+
QMAKE_BUNDLE_DATA += OSX_ENTITLEMENTS
150+
147151
macx-xcode {
148152
QMAKE_INFO_PLIST = mac/Info-xcode.plist
153+
XCODE_ENTITLEMENTS.name = CODE_SIGN_ENTITLEMENTS
154+
XCODE_ENTITLEMENTS.value = Jamulus.entitlements
155+
QMAKE_MAC_XCODE_SETTINGS += XCODE_ENTITLEMENTS
156+
MACOSX_BUNDLE_ICON.path = Contents/Resources
157+
QMAKE_BUNDLE_DATA += MACOSX_BUNDLE_ICON
149158
} else {
150159
QMAKE_INFO_PLIST = mac/Info-make.plist
151160
}
@@ -184,7 +193,7 @@ win32 {
184193
HEADERS += ios/ios_app_delegate.h
185194
HEADERS += ios/sound.h
186195
OBJECTIVE_SOURCES += ios/sound.mm
187-
QMAKE_TARGET_BUNDLE_PREFIX = com.jamulussoftware.jamulus
196+
QMAKE_TARGET_BUNDLE_PREFIX = io.jamulus
188197
QMAKE_APPLICATION_BUNDLE_NAME. = $$TARGET
189198
LIBS += -framework CoreFoundation \
190199
-framework CoreServices \

mac/Info-make.plist

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@
1212
<string>APPL</string>
1313
<key>CFBundleVersion</key>
1414
<string>@FULL_VERSION@</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>@SHORT_VERSION@</string>
17+
<key>CFBundleSupportedPlatforms</key>
18+
<array>
19+
<string>MacOSX</string>
20+
</array>
21+
<key>LSApplicationCategoryType</key>
22+
<string>public.app-category.music</string>
23+
<key>LSMinimumSystemVersion</key>
24+
<string>10.13.0</string>
1525
<key>CFBundleExecutable</key>
1626
<string>@EXECUTABLE@</string>
1727
<key>CFBundleDevelopmentRegion</key>
1828
<string>en</string>
1929
<key>CFBundleIconFile</key>
2030
<string>@ICON@</string>
2131
<key>CFBundleGetInfoString</key>
22-
<string>Created by Qt/QMake</string>
23-
32+
<string>Jamulus - Created with QT</string>
2433
<key>NSPrincipalClass</key>
2534
<string>NSApplication</string>
2635
<key>NSMicrophoneUsageDescription</key>

mac/Info-xcode.plist

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>CFBundleName</key>
6-
<string>${EXECUTABLE_NAME}</string>
7-
<key>CFBundleDisplayName</key>
8-
<string>${EXECUTABLE_NAME}</string>
9-
<key>CFBundleIdentifier</key>
10-
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
11-
<key>CFBundlePackageType</key>
12-
<string>APPL</string>
13-
<key>CFBundleVersion</key>
14-
<string>${QMAKE_FULL_VERSION}</string>
15-
<key>CFBundleExecutable</key>
16-
<string>${EXECUTABLE_NAME}</string>
17-
<key>CFBundleDevelopmentRegion</key>
18-
<string>en</string>
19-
<key>CFBundleIconFile</key>
20-
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
21-
<key>CFBundleGetInfoString</key>
22-
<string>Created by Qt/QMake</string>
23-
24-
<key>NSPrincipalClass</key>
25-
<string>NSApplication</string>
26-
<key>NSMicrophoneUsageDescription</key>
27-
<string>Jamulus needs access to the microphone to record and stream your music to other musicians</string>
28-
<!-- Temporarily opt out of Dark Mode as Qt 5.9 does not support it well, see https://bugreports.qt.io/browse/QTBUG-68891 -->
29-
<key>NSRequiresAquaSystemAppearance</key>
30-
<string>true</string>
31-
</dict>
4+
<dict>
5+
<key>CFBundleName</key>
6+
<string>${EXECUTABLE_NAME}</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>${EXECUTABLE_NAME}</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
11+
<key>CFBundlePackageType</key>
12+
<string>APPL</string>
13+
<key>CFBundleVersion</key>
14+
<string>${QMAKE_FULL_VERSION}</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>${QMAKE_SHORT_VERSION}</string>
17+
<key>CFBundleSupportedPlatforms</key>
18+
<array>
19+
<string>MacOSX</string>
20+
</array>
21+
<key>LSApplicationCategoryType</key>
22+
<string>public.app-category.music</string>
23+
<key>LSMinimumSystemVersion</key>
24+
<string>10.13.0</string>
25+
<key>CFBundleExecutable</key>
26+
<string>${EXECUTABLE_NAME}</string>
27+
<key>CFBundleDevelopmentRegion</key>
28+
<string>en</string>
29+
<key>CFBundleIconFile</key>
30+
<string>mainicon.icns</string>
31+
<key>CFBundleGetInfoString</key>
32+
<string>Jamulus - Created with QT</string>
33+
<key>NSPrincipalClass</key>
34+
<string>NSApplication</string>
35+
<key>NSMicrophoneUsageDescription</key>
36+
<string>Jamulus needs access to the microphone to record and stream your music to other musicians</string>
37+
<key>NSRequiresAquaSystemAppearance</key>
38+
<string>true</string>
39+
</dict>
3240
</plist>

mac/deploy_mac.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,28 @@ macdeploy_path="${root_path}/mac"
77
resources_path="${root_path}/src/res"
88
build_path="${root_path}/build"
99
deploy_path="${root_path}/deploy"
10-
10+
cert_name=""
11+
12+
13+
while getopts 'hs:' flag; do
14+
case "${flag}" in
15+
s)
16+
cert_name=$OPTARG
17+
if [[ -z "$cert_name" ]]; then
18+
echo "Please add the name of the certificate to use: -s \"<name>\""
19+
fi
20+
# shift 2
21+
;;
22+
h)
23+
echo "Usage: -s <cert name> for signing mac build"
24+
exit 0
25+
;;
26+
*)
27+
exit 1
28+
;;
29+
30+
esac
31+
done
1132

1233
cleanup()
1334
{
@@ -29,7 +50,11 @@ build_app()
2950
make -f "${build_path}/Makefile" -C "${build_path}" -j "${job_count}"
3051

3152
# Add Qt deployment dependencies
32-
macdeployqt "${build_path}/${target_name}.app" -verbose=2 -always-overwrite
53+
if [[ -z "$cert_name" ]]; then
54+
macdeployqt "${build_path}/${target_name}.app" -verbose=2 -always-overwrite
55+
else
56+
macdeployqt "${build_path}/${target_name}.app" -verbose=2 -always-overwrite -hardened-runtime -timestamp -appstore-compliant -sign-for-notarization="${cert_name}"
57+
fi
3358
mv "${build_path}/${target_name}.app" "${deploy_path}"
3459

3560
# Cleanup

0 commit comments

Comments
 (0)