diff --git a/mea.pro b/mea.pro index 9c5735eb..fa990daa 100644 --- a/mea.pro +++ b/mea.pro @@ -42,9 +42,25 @@ wininstaller.commands += binarycreator -c $${PACKAGE_DIR}\config\config.xml -p $ message("cmd: $${wininstaller.commands}") QMAKE_EXTRA_TARGETS += wininstaller + +# OS X installer bundle +osxbundle.commands += cd mea && rm -f mea.dmg mea_writable.dmg mea-osx-bundle.dmg || true && +osxbundle.commands += hdiutil eject /Volumes/mea || true && +osxbundle.commands += macdeployqt mea.app -qmldir=$$top_srcdir/mea/ui -dmg && +osxbundle.commands += hdiutil convert mea.dmg -format UDRW -o mea_writable.dmg && +osxbundle.commands += hdiutil attach -readwrite -noverify mea_writable.dmg && +osxbundle.commands += mkdir /Volumes/mea/.background/ && cp $$top_srcdir/packaging/osx/installer.png /Volumes/mea/.background/ && +osxbundle.commands += ln -s /Applications /Volumes/mea/Applications && +osxbundle.commands += osascript $$top_srcdir/packaging/osx/patchinstaller.sctp && +osxbundle.commands += hdiutil eject /Volumes/mea && +osxbundle.commands += hdiutil convert mea_writable.dmg -format UDRO -o mea-osx-bundle.dmg && +osxbundle.commands += rm mea.dmg mea_writable.dmg +QMAKE_EXTRA_TARGETS += osxbundle + + +# Translations support TRANSLATIONS += $$files(mea/translations/*.ts, true) lrelease.commands = lrelease $$_FILE_ lrelease-qmake_all.commands = lrelease $$_FILE_ QMAKE_EXTRA_TARGETS += lrelease lrelease-make_first lrelease-qmake_all lrelease-install_subtargets - mea.depends += lrelease diff --git a/mea/mea.pro b/mea/mea.pro index 5bf0bb8e..afc223ff 100644 --- a/mea/mea.pro +++ b/mea/mea.pro @@ -31,17 +31,27 @@ contains(ANDROID_TARGET_ARCH,armeabi-v7a) { } android { -ANDROID_PACKAGE_SOURCE_DIR = $$PWD/../packaging/android + ANDROID_PACKAGE_SOURCE_DIR = $$PWD/../packaging/android -DISTFILES += \ - $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.jar \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradlew \ - $$ANDROID_PACKAGE_SOURCE_DIR/res/values/libs.xml \ - $$ANDROID_PACKAGE_SOURCE_DIR/build.gradle \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.properties \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradlew.bat \ - $$ANDROID_PACKAGE_SOURCE_DIR/LICENSE + DISTFILES += \ + $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml \ + $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.jar \ + $$ANDROID_PACKAGE_SOURCE_DIR/gradlew \ + $$ANDROID_PACKAGE_SOURCE_DIR/res/values/libs.xml \ + $$ANDROID_PACKAGE_SOURCE_DIR/build.gradle \ + $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.properties \ + $$ANDROID_PACKAGE_SOURCE_DIR/gradlew.bat \ + $$ANDROID_PACKAGE_SOURCE_DIR/LICENSE +} + +macx: { + PRODUCT_NAME=mea + 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 } BR=$$BRANDING @@ -52,9 +62,5 @@ BR=$$BRANDING win32:RCC_ICONS += ../packaging/windows/packages/io.guh.mea/meta/logo.ico } -withavahi: { - LIBS += -lavahi-client -lavahi-common -} - target.path = /usr/bin INSTALLS += target diff --git a/packaging/osx/Info.plist.in b/packaging/osx/Info.plist.in new file mode 100644 index 00000000..f56affb6 --- /dev/null +++ b/packaging/osx/Info.plist.in @@ -0,0 +1,26 @@ + + + + + CFBundleExecutable + mea + CFBundleGetInfoString + Created by Qt/QMake + CFBundleIconFile + icon.icns + CFBundleIdentifier + com.yourcompany.mea + CFBundlePackageType + APPL + CFBundleSignature + ???? + LSMinimumSystemVersion + 10.11 + NOTE + This file was generated by Qt/QMake. + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/packaging/osx/icon.icns b/packaging/osx/icon.icns new file mode 100644 index 00000000..473f32ba Binary files /dev/null and b/packaging/osx/icon.icns differ diff --git a/packaging/osx/installer.png b/packaging/osx/installer.png new file mode 100644 index 00000000..c03b07a0 Binary files /dev/null and b/packaging/osx/installer.png differ diff --git a/packaging/osx/installer.svg b/packaging/osx/installer.svg new file mode 100644 index 00000000..4f27d901 --- /dev/null +++ b/packaging/osx/installer.svg @@ -0,0 +1,673 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mea + + + To install, drag this icon + ...onto this one! + + diff --git a/packaging/osx/patchinstaller.sctp b/packaging/osx/patchinstaller.sctp new file mode 100644 index 00000000..daf52cac --- /dev/null +++ b/packaging/osx/patchinstaller.sctp @@ -0,0 +1,19 @@ +tell app "Finder" + tell disk "mea" + open + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set the bounds of container window to {400, 100, 944, 531} + set viewOptions to the icon view options of container window + set arrangement of viewOptions to not arranged + set icon size of viewOptions to 128 + set background picture of viewOptions to file ".background:installer.png" + set position of item "mea.app" of container window to {140, 220} + set position of item "Applications" of container window to {415, 220} + close + open + update without registering applications + delay 2 + end tell +end tell