diff --git a/nymea-app.pro b/nymea-app.pro
index 10a6c844..788d4c10 100644
--- a/nymea-app.pro
+++ b/nymea-app.pro
@@ -53,9 +53,10 @@ QMAKE_EXTRA_TARGETS += wininstaller
# Install XCode and Qt clang64, add qmake directory to PATH
# run "make osxbundle"
osxbundle.depends = nymea-app
-osxbundle.commands += cd nymea-app && rm -f nymea-app.dmg nymea-app_writable.dmg nymea-app-osx-bundle*.dmg || true &&
+osxbundle.commands += cd nymea-app && rm -f ../*.dmg ../*pkg *.dmg || true &&
osxbundle.commands += hdiutil eject /Volumes/nymea-app || true &&
-osxbundle.commands += macdeployqt nymea-app.app -qmldir=$$top_srcdir/nymea-app/ui -dmg &&
+osxbundle.commands += macdeployqt nymea-app.app -appstore-compliant -qmldir=$$top_srcdir/nymea-app/ui -dmg &&
+osxbundle.commands += codesign -s \"3rd Party Mac Developer Application\" --entitlements $$top_srcdir/packaging/osx/nymea-app.entitlements --deep nymea-app.app &&
osxbundle.commands += hdiutil convert nymea-app.dmg -format UDRW -o nymea-app_writable.dmg &&
osxbundle.commands += hdiutil attach -readwrite -noverify nymea-app_writable.dmg && sleep 2 &&
osxbundle.commands += mv /Volumes/nymea-app/nymea-app.app /Volumes/nymea-app/nymea\:app.app &&
@@ -65,6 +66,15 @@ osxbundle.commands += hdiutil convert nymea-app_writable.dmg -format UDRO -o ../
osxbundle.commands += rm nymea-app.dmg nymea-app_writable.dmg
QMAKE_EXTRA_TARGETS += osxbundle
+# Create a .pkg osx installer. We're dropping the QtWebEngineCore framework as that's not app store compliant
+# and we're using the WebView instead anyways. (IMHO a bug that macdeployqt -appstore-compliant even adds it)
+osxinstaller.depends = osxbundle
+osxinstaller.commands += cd nymea-app &&
+osxinstaller.commands += rm -r nymea-app.app/Contents/Frameworks/QtWebEngineCore.framework &&
+osxinstaller.commands += productbuild --component nymea-app.app /Applications ../nymea-app-$${APP_VERSION}.pkg && cd .. &&
+osxinstaller.commands += productsign -s \"3rd Party Mac Developer Installer\" nymea-app-$${APP_VERSION}.pkg nymea-app-signed-$${APP_VERSION}.pkg
+QMAKE_EXTRA_TARGETS += osxinstaller
+
# Generic linux desktop
linux:!android: {
desktopfile.files = packaging/linux-common/nymea-app.desktop
diff --git a/nymea-app/main.cpp b/nymea-app/main.cpp
index 7c394a40..f096dd03 100644
--- a/nymea-app/main.cpp
+++ b/nymea-app/main.cpp
@@ -60,6 +60,10 @@ QObject *platformHelperProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
int main(int argc, char *argv[])
{
+#ifdef Q_OS_OSX
+ qputenv("QT_WEBVIEW_PLUGIN", "native");
+#endif
+
QLoggingCategory::setFilterRules("RemoteProxyClientJsonRpcTraffic.debug=false\n"
"RemoteProxyClientJsonRpc.debug=false\n"
"RemoteProxyClientWebSocket.debug=false\n"
diff --git a/nymea-app/nymea-app.pro b/nymea-app/nymea-app.pro
index ed2116d8..4404c5fa 100644
--- a/nymea-app/nymea-app.pro
+++ b/nymea-app/nymea-app.pro
@@ -86,12 +86,22 @@ android {
macx: {
QT += webview
PRODUCT_NAME=$$TARGET
+
+ QMAKE_TARGET_BUNDLE_PREFIX = io.nymea
+ QMAKE_BUNDLE = nymeaApp.mac
+
plist.input = ../packaging/osx/Info.plist.in
plist.output = $$OUT_PWD/Info.plist
QMAKE_SUBSTITUTES += plist
QMAKE_INFO_PLIST = $$OUT_PWD/Info.plist
- OTHER_FILES += ../packaging/osx/Info.plist.in
- ICON = ../packaging/osx/icon.icns
+ OTHER_FILES += ../packaging/osx/Info.plist.in \
+ ../packaging/osx/nymea-app.entitlements
+
+ ICON = ../packaging/osx/AppIcon.icns
+
+ OSX_ENTITLEMENTS.name = CODE_SIGN_ENTITLEMENTS
+ OSX_ENTITLEMENTS.value = $$files($$PWD/../packaging/ios/nymea-app.entitlements)
+ QMAKE_MAC_XCODE_SETTINGS += OSX_ENTITLEMENTS
}
ios: {
diff --git a/packaging/osx/AppIcon.icns b/packaging/osx/AppIcon.icns
new file mode 100644
index 00000000..4869c74c
Binary files /dev/null and b/packaging/osx/AppIcon.icns differ
diff --git a/packaging/osx/AppIcon.iconset/icon_128x128.png b/packaging/osx/AppIcon.iconset/icon_128x128.png
new file mode 100644
index 00000000..35fe47c3
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_128x128.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_128x128@2x.png b/packaging/osx/AppIcon.iconset/icon_128x128@2x.png
new file mode 100644
index 00000000..ac23c898
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_128x128@2x.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_16x16.png b/packaging/osx/AppIcon.iconset/icon_16x16.png
new file mode 100644
index 00000000..9e79c3e8
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_16x16.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_16x16@2x.png b/packaging/osx/AppIcon.iconset/icon_16x16@2x.png
new file mode 100644
index 00000000..c9d58f38
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_16x16@2x.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_256x256.png b/packaging/osx/AppIcon.iconset/icon_256x256.png
new file mode 100644
index 00000000..ac23c898
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_256x256.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_256x256@2x.png b/packaging/osx/AppIcon.iconset/icon_256x256@2x.png
new file mode 100644
index 00000000..f3648833
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_256x256@2x.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_32x32.png b/packaging/osx/AppIcon.iconset/icon_32x32.png
new file mode 100644
index 00000000..c9d58f38
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_32x32.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_32x32@2x.png b/packaging/osx/AppIcon.iconset/icon_32x32@2x.png
new file mode 100644
index 00000000..ed91aa0a
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_32x32@2x.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_512x512.png b/packaging/osx/AppIcon.iconset/icon_512x512.png
new file mode 100644
index 00000000..f3648833
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_512x512.png differ
diff --git a/packaging/osx/AppIcon.iconset/icon_512x512@2x.png b/packaging/osx/AppIcon.iconset/icon_512x512@2x.png
new file mode 100644
index 00000000..2af97a3c
Binary files /dev/null and b/packaging/osx/AppIcon.iconset/icon_512x512@2x.png differ
diff --git a/packaging/osx/AppIcon.svg b/packaging/osx/AppIcon.svg
new file mode 100644
index 00000000..301ab05e
--- /dev/null
+++ b/packaging/osx/AppIcon.svg
@@ -0,0 +1,603 @@
+
+
+
+
diff --git a/packaging/osx/Info.plist.in b/packaging/osx/Info.plist.in
index ea104fc5..3211c8d3 100644
--- a/packaging/osx/Info.plist.in
+++ b/packaging/osx/Info.plist.in
@@ -8,14 +8,18 @@
nymea:app
CFBundleExecutable
nymea-app
- CFBundleGetInfoString
- Created by Qt/QMake
CFBundleIconFile
- icon.icns
+ AppIcon.icns
CFBundleIdentifier
- io.guh.nymea-app
+ io.nymea.nymeaApp.mac
+ CFBundleVersion
+ $$APP_REVISION
+ CFBundleShortVersionString
+ $$APP_VERSION
CFBundlePackageType
APPL
+ LSApplicationCategoryType
+ public.app-category.utilities
CFBundleSignature
????
LSMinimumSystemVersion
diff --git a/packaging/osx/exportappicons.sh b/packaging/osx/exportappicons.sh
new file mode 100755
index 00000000..88635f45
--- /dev/null
+++ b/packaging/osx/exportappicons.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+function exportImage() {
+ mkdir AppIcon.iconset
+ size=$1
+ scaleFactor=$2
+ echo Exporting AppIcon with size $size and scale factor $scaleFactor
+ if [ ${scaleFactor} -ne 1 ]; then
+ finalSize=$((size * scaleFactor))
+ echo final size is ${finalSize}
+ inkscape AppIcon.svg -e AppIcon.iconset/icon_${size}x${size}@${scaleFactor}x.png -C -w $finalSize -h $finalSize
+ else
+ inkscape AppIcon.svg -e AppIcon.iconset/icon_${size}x${size}.png -C -w ${size} -h ${size}
+ fi
+}
+
+SIZES=(
+ "16:1"
+ "16:2"
+ "32:1"
+ "32:2"
+ "128:1"
+ "128:2"
+ "256:1"
+ "256:2"
+ "512:1"
+ "512:2"
+)
+
+for size in "${SIZES[@]}" ; do
+ pixels="${size%%:*}"
+ scale="${size##*:}"
+ exportImage $pixels $scale
+done
diff --git a/packaging/osx/icon.icns b/packaging/osx/icon.icns
deleted file mode 100644
index fe532714..00000000
Binary files a/packaging/osx/icon.icns and /dev/null differ
diff --git a/packaging/osx/nymea-app.entitlements b/packaging/osx/nymea-app.entitlements
new file mode 100644
index 00000000..23a02ca2
--- /dev/null
+++ b/packaging/osx/nymea-app.entitlements
@@ -0,0 +1,12 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.network.client
+
+ com.apple.security.device.bluetooth
+
+
+