Skip to content

Commit 3d19987

Browse files
committed
Disable incompatible features for the Mac App Store version
Signed-off-by: Maxime Gervais <gervais.maxime@gmail.com>
1 parent 9826192 commit 3d19987

File tree

4 files changed

+47
-71
lines changed

4 files changed

+47
-71
lines changed

Project/Mac/Make_xcarchive.sh

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,7 @@ TEAMID=$4
55

66
SIGNATURE="MediaArea.net"
77

8-
DATE=$(date -u +'%s')
8+
cp -r ../QtCreator/qctools-gui/build/$APPNAME.app . || exit 1
99

10-
cp -r ../QtCreator/qctools-gui/$APPNAME.app . || exit 1
11-
12-
macdeployqt $APPNAME.app -no-strip -appstore-compliant
13-
rm -rf $APPNAME.app/Contents/PlugIns/sqldrivers/{libqsqlmysql.dylib,libqsqlodbc.dylib,libqsqlpsql.dylib}
14-
15-
dsymutil $APPNAME.app/Contents/MacOS/$APPNAME -o $APPNAME.app.dSYM
16-
17-
for FRAMEWORK in $(ls $APPNAME.app/Contents/Frameworks | grep framework | sed 's/\.framework//') ; do
18-
pushd $APPNAME.app/Contents/Frameworks/$FRAMEWORK.framework
19-
20-
rm -fr _CodeSignature
21-
rm -fr Versions/5/_CodeSignature
22-
plutil -replace CFBundleIdentifier -string "$BUNDLEID" Resources/Info.plist
23-
popd
24-
25-
# codesign --force --verbose --sign "3rd Party Mac Developer Application: $SIGNATURE" -i $BUNDLEID $APPNAME.app/Contents/Frameworks/$FRAMEWORK.framework/Versions/5/$FRAMEWORK
26-
done
27-
28-
#find $APPNAME.app/Contents/PlugIns -name "*.dylib" -exec codesign --force --verbose --sign "3rd Party Mac Developer Application: $SIGNATURE" -i $BUNDLEID '{}' \;
29-
30-
codesign --deep --force --verbose --sign "3rd Party Mac Developer Application: $SIGNATURE" --entitlements $APPNAME.entitlements $APPNAME.app
31-
32-
productbuild --component $APPNAME.app /Applications --sign "3rd Party Mac Developer Installer: $SIGNATURE" $APPNAME-$VERSION.pkg
33-
34-
rm -fr $APPNAME.xcarchive
35-
mkdir -p $APPNAME.xcarchive{/Products/Applications,/dSYMs}
36-
mv $APPNAME.app.dSYM $APPNAME.xcarchive/dSYMs
37-
mv $APPNAME.app $APPNAME.xcarchive/Products/Applications
38-
39-
cat > $APPNAME.xcarchive/Info.plist <<EOF
40-
<?xml version="1.0" encoding="UTF-8"?>
41-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
42-
<plist version="1.0">
43-
<dict>
44-
<key>ApplicationProperties</key>
45-
<dict>
46-
<key>ApplicationPath</key>
47-
<string>Applications/$APPNAME.app</string>
48-
<key>CFBundleIdentifier</key>
49-
<string>$BUNDLEID</string>
50-
<key>CFBundleShortVersionString</key>
51-
<string>$VERSION</string>
52-
<key>CFBundleVersion</key>
53-
<string>1.4</string>
54-
<key>IconPaths</key>
55-
<array>
56-
<string>Applications/$APPNAME.app/Contents/Resources/Logo.icns</string>
57-
</array>
58-
<key>SigningIdentity</key>
59-
<string>3rd Party Mac Developer Application: $SIGNATURE ($TEAMID)</string>
60-
</dict>
61-
<key>ArchiveVersion</key>
62-
<integer>2</integer>
63-
<key>CreationDate</key>
64-
<date>$(date -u -j -f '%s' +'%Y-%m-%dT%H:%M:%SZ' $DATE)</date>
65-
<key>Name</key>
66-
<string>$APPNAME</string>
67-
<key>SchemeName</key>
68-
<string>$APPNAME</string>
69-
</dict>
70-
</plist>
71-
EOF
72-
73-
mkdir -p $HOME/Library/Developer/Xcode/Archives/$(date -u -j -f '%s' +'%Y-%m-%d' $DATE)
74-
cp -a $APPNAME.xcarchive $HOME/Library/Developer/Xcode/Archives/$(date -u -j -f '%s' +'%Y-%m-%d' $DATE)/"$APPNAME $(date -u -j -f '%s' +'%d-%m-%Y %H.%M' $DATE).xcarchive"
10+
codesign --force --deep --verbose --sign "Apple Distribution: $SIGNATURE" --entitlements "$APPNAME.entitlements" "$APPNAME.app"
11+
productbuild --component "$APPNAME.app" /Applications --sign "3rd Party Mac Developer Installer: $SIGNATURE" "$APPNAME-$VERSION.pkg"

Project/QtCreator/QCTools.pro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ USE_BREW = $$(USE_BREW)
88
DEFINES += USE_BREW
99
}
1010

11+
macx {
12+
contains(MACSTORE, yes|1) {
13+
DEFINES += MACSTORE
14+
}
15+
}
16+
1117
include(ffmpeg.pri)
1218

1319
contains(DEFINES, USE_BREW) {

Source/GUI/mainwindow.cpp

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,14 @@ void MainWindow::on_actionFilesList_triggered()
386386
ui->menuLegacy_outputs->setVisible(false);
387387
if (ui->actionExport_XmlGz_Prompt)
388388
ui->actionExport_XmlGz_Prompt->setVisible(false);
389-
if (ui->actionExport_XmlGz_Sidecar)
390-
ui->actionExport_XmlGz_Sidecar->setVisible(false);
391389
if (ui->actionExport_Mkv_Prompt)
392390
ui->actionExport_Mkv_Prompt->setVisible(false);
391+
#ifndef MACSTORE
392+
if (ui->actionExport_XmlGz_Sidecar)
393+
ui->actionExport_XmlGz_Sidecar->setVisible(false);
393394
if (ui->actionExport_Mkv_Sidecar)
394395
ui->actionExport_Mkv_Sidecar->setVisible(false);
396+
#endif // !MACSTORE
395397
if (ui->actionExport_Mkv_QCvault)
396398
ui->actionExport_Mkv_QCvault->setVisible(false);
397399
if (ui->actionPrint)
@@ -436,12 +438,14 @@ void MainWindow::on_actionGraphsLayout_triggered()
436438
ui->actionGoTo->setVisible(true);
437439
if (ui->actionExport_XmlGz_Prompt)
438440
ui->actionExport_XmlGz_Prompt->setVisible(true);
439-
if (ui->actionExport_XmlGz_Sidecar)
440-
ui->actionExport_XmlGz_Sidecar->setVisible(true);
441441
if (ui->actionExport_Mkv_Prompt)
442442
ui->actionExport_Mkv_Prompt->setVisible(true);
443+
#ifndef MACSTORE
444+
if (ui->actionExport_XmlGz_Sidecar)
445+
ui->actionExport_XmlGz_Sidecar->setVisible(true);
443446
if (ui->actionExport_Mkv_Sidecar)
444447
ui->actionExport_Mkv_Sidecar->setVisible(true);
448+
#endif // !MACSTORE
445449
//if (ui->actionPrint)
446450
// ui->actionPrint->setVisible(true);
447451
if (ui->actionZoomIn)
@@ -823,12 +827,18 @@ void MainWindow::updateExportActions()
823827
exportEnabled = hasStats || parsed;
824828
}
825829
ui->actionExport_XmlGz_Prompt->setEnabled(exportEnabled);
826-
ui->actionExport_XmlGz_Sidecar->setEnabled(exportEnabled);
827830
ui->actionExport_Mkv_Prompt->setEnabled(exportEnabled);
831+
#ifndef MACSTORE
832+
ui->actionExport_XmlGz_Sidecar->setEnabled(exportEnabled);
828833
ui->actionExport_Mkv_Sidecar->setEnabled(exportEnabled);
834+
#endif // !MACSTORE
829835
ui->actionExport_Mkv_QCvault->setEnabled(exportEnabled);
830836

837+
#ifndef MACSTORE
831838
ui->menuLegacy_outputs->setEnabled(ui->actionExport_XmlGz_Prompt->isEnabled() || ui->actionExport_XmlGz_Sidecar->isEnabled() || ui->actionExport_XmlGz_SidecarAll->isEnabled());
839+
#else
840+
ui->menuLegacy_outputs->setEnabled(ui->actionExport_XmlGz_Prompt->isEnabled());
841+
#endif // !MACSTORE
832842
}
833843

834844
void MainWindow::updateExportAllAction()
@@ -842,11 +852,17 @@ void MainWindow::updateExportAllAction()
842852
}
843853
}
844854

855+
#ifndef MACSTORE
845856
ui->actionExport_XmlGz_SidecarAll->setEnabled(allParsedOrHaveStats);
846857
ui->actionExport_Mkv_SidecarAll->setEnabled(allParsedOrHaveStats);
858+
#endif // !MACSTORE
847859
ui->actionExport_Mkv_QCvaultAll->setEnabled(allParsedOrHaveStats);
848860

861+
#ifndef MACSTORE
849862
ui->menuLegacy_outputs->setEnabled(ui->actionExport_XmlGz_Prompt->isEnabled() || ui->actionExport_XmlGz_Sidecar->isEnabled() || ui->actionExport_XmlGz_SidecarAll->isEnabled());
863+
#else
864+
ui->menuLegacy_outputs->setEnabled(ui->actionExport_XmlGz_Prompt->isEnabled());
865+
#endif // !MACSTORE
850866
}
851867

852868
void MainWindow::showPlayer()

Source/GUI/mainwindow_Ui.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ void MainWindow::Ui_Init()
139139
// Drag n drop
140140
setAcceptDrops(true);
141141

142+
#ifdef MACSTORE
143+
if (ui->actionExport_XmlGz_Sidecar)
144+
ui->actionExport_XmlGz_Sidecar->setVisible(false);
145+
if (ui->actionExport_Mkv_Prompt)
146+
ui->actionExport_Mkv_Prompt->setVisible(false);
147+
if (ui->actionExport_Mkv_Sidecar)
148+
ui->actionExport_Mkv_Sidecar->setVisible(false);
149+
if (ui->actionExport_XmlGz_SidecarAll)
150+
ui->actionExport_XmlGz_SidecarAll->setVisible(false);
151+
if (ui->actionExport_Mkv_SidecarAll)
152+
ui->actionExport_Mkv_SidecarAll->setVisible(false);
153+
#endif // MACSTORE
154+
142155
// Icons
143156
ui->actionOpen->setIcon(QIcon(":/icon/document-open.png"));
144157
ui->actionExport_XmlGz_Prompt->setIcon(QIcon(":/icon/export_xml.png"));
@@ -411,7 +424,9 @@ void MainWindow::configureZoom()
411424

412425
ui->actionGoTo->setEnabled(!Files.empty());
413426
ui->actionExport_XmlGz_Prompt->setEnabled(!Files.empty());
427+
#ifndef MACSTORE
414428
ui->actionExport_XmlGz_Sidecar->setEnabled(!Files.empty());
429+
#endif // !MACSTORE
415430
//ui->actionPrint->setEnabled(!Files.empty());
416431
return;
417432
}
@@ -421,7 +436,9 @@ void MainWindow::configureZoom()
421436
ui->actionZoomIn->setEnabled( isPlotZoomable() );
422437
ui->actionGoTo->setEnabled(true);
423438
ui->actionExport_XmlGz_Prompt->setEnabled(true);
439+
#ifndef MACSTORE
424440
ui->actionExport_XmlGz_Sidecar->setEnabled(true);
441+
#endif // !MACSTORE
425442
//ui->actionPrint->setEnabled(true);
426443
}
427444

0 commit comments

Comments
 (0)