Skip to content

Commit 702025e

Browse files
committed
wip: deployment script macOS modification
after updating Qt to 5.15.1 the deployment script was having issues with the WebEngineCore framework. The script now manually copies the helper application and signs it separately, the script has been tested and produces a valid signed application+dmg.
1 parent f4e8945 commit 702025e

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

MainWindow.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ namespace Nedrysoft {
100100
*
101101
* @returns true if the event is handled; otherwise false.
102102
*/
103-
Q_SLOT bool eventFilter(QObject *obj, QEvent *event);
103+
Q_SLOT bool eventFilter(QObject *obj, QEvent *event) override;
104104

105105
/**
106106
* @brief About slot function.

deploy.py

+32-7
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,14 @@ def run(command) :
113113

114114
return stream.read()
115115

116-
def macSignBinary(file, cert):
117-
return(execute(f'codesign --verify --timestamp -o runtime --deep --force --sign "{cert}" "{file}"'))
116+
def macSignBinary(file, options, cert):
117+
extraOptions = ""
118+
119+
if options:
120+
for option in options:
121+
extraOptions += option+" "
122+
123+
return(execute(f'codesign --verify --deep --timestamp -o runtime --force {extraOptions} --sign "{cert}" "{file}"'))
118124

119125
def winSignBinary(signtool, file, cert, timeserver):
120126
return(execute(f'{signtool} sign /n "{cert}" /t {timeserver} /fd sha256 /v "{file}"'))
@@ -706,13 +712,26 @@ def notarizeFile(file, username, password):
706712
startMessage('Running macdeployqt...')
707713

708714
resultCode, resultOutput = execute(f'{qtdir}/bin/macdeployqt "bin/{buildArch}/Deploy/{deploymentProject}.app" -no-strip')
715+
resultCode = 0
709716

710717
if resultCode:
711718
endMessage(False, f'there was a problem running macdeployqt.\r\n\r\n{resultOutput}\r\n')
712719
exit(1)
713720

714721
endMessage(True)
715722

723+
# meanually copy the web engine framework helper as macdeployqt doesn't copy it properrly
724+
725+
startMessage('Manually copying QtWebEngineProcess helper application...')
726+
727+
shutil.copytree(f'{qtdir}/lib/QtWebEngineCore.framework/Helpers', f'bin/{buildArch}/Deploy/{deploymentProject}.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers', symlinks=True, dirs_exist_ok=True)
728+
729+
if resultCode:
730+
endMessage(False, f'there was a problem copying the QtWebEngineProcess helper application.\r\n\r\n{resultOutput}\r\n')
731+
exit(1)
732+
733+
endMessage(True)
734+
716735
# remove the sql drivers that we don't use
717736

718737
startMessage('Removing unwanted qt plugins...')
@@ -748,19 +767,25 @@ def notarizeFile(file, username, password):
748767

749768
startMessage('Signing binaries...')
750769

770+
resultCode, resultOutput = macSignBinary(f'bin/{buildArch}/Deploy/{deploymentProject}.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess', None, args.cert)
771+
772+
if resultCode:
773+
endMessage(False, f'there was a problem signing a file QtWebEngineProcess.\r\n\r\n{resultOutput}\r\n')
774+
exit(1)
775+
751776
for file in glob.glob(f'bin/{buildArch}/Deploy/{deploymentProject}.app/**/*.framework', recursive=True):
752-
resultCode, resultOutput = macSignBinary(file, args.cert)
777+
resultCode, resultOutput = macSignBinary(file, None, args.cert)
753778
if resultCode:
754779
endMessage(False, f'there was a problem signing a file ({file}).\r\n\r\n{resultOutput}\r\n')
755-
exit(1)
780+
exit(1)
756781

757782
for file in glob.glob(f'bin/{buildArch}/Deploy/{deploymentProject}.app/**/*.dylib', recursive=True):
758-
resultCode, resultOutput = macSignBinary(file, args.cert)
783+
resultCode, resultOutput = macSignBinary(file, None, args.cert)
759784
if resultCode:
760785
endMessage(False, f'there was a problem signing a file ({file}).\r\n\r\n{resultOutput}\r\n')
761786
exit(1)
762787

763-
resultCode, resultOutput = macSignBinary(f'bin/{buildArch}/Deploy/{deploymentProject}.app', args.cert)
788+
resultCode, resultOutput = macSignBinary(f'bin/{buildArch}/Deploy/{deploymentProject}.app', None, args.cert)
764789

765790
if resultCode:
766791
endMessage(False, f'there was a problem signing a file ({file}).\r\n\r\n{resultOutput}\r\n')
@@ -824,7 +849,7 @@ def notarizeFile(file, username, password):
824849

825850
startMessage('Signing dmg...')
826851

827-
resultCode, resultOutput = macSignBinary(f'./bin/{buildArch}/Deploy/{deploymentProject}.dmg', args.cert)
852+
resultCode, resultOutput = macSignBinary(f'./bin/{buildArch}/Deploy/{deploymentProject}.dmg', None, args.cert)
828853

829854
if resultCode:
830855
endMessage(False, f'there was a problem signing the dmg.\r\n\r\n{resultOutput}\r\n')

0 commit comments

Comments
 (0)