From 240821c26396b067346d915e1da760ded5557b28 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Mon, 7 Sep 2015 13:52:50 +0200 Subject: Remove Qt bearer plugins from Swift bundle in installation package This is a workaround for QTBUG-34641. The Qt bearer API for detecting network changes will poll for available wireless networks every 30 seconds or so, resulting in needless CPU load. This patch removes the plugins for this API from the installation package, which will disable the constant polling for available wireless networks. Test-Information: Verified that the plugins are removed from the application bundle in the final installation DMG. Change-Id: If46d03ca5623885879ecc10e06a29cec96e7caa4 diff --git a/Swift/Packaging/MacOSX/package.sh b/Swift/Packaging/MacOSX/package.sh index d7a31d2..4c7157f 100755 --- a/Swift/Packaging/MacOSX/package.sh +++ b/Swift/Packaging/MacOSX/package.sh @@ -21,6 +21,10 @@ mkdir -p $WC_DIR hdiutil attach "$WC_DMG" -noautoopen -quiet -mountpoint "$WC_DIR" ditto -rsrc "$APP" "$WC_DIR"/`basename $APP` $QTDIR/bin/macdeployqt "$WC_DIR"/`basename $APP` -no-strip +# The bearer plugins of Qt5 cannot be disabled by an application. +# They will constantly ask the OS to scan for available wireless networks, unrelated to actual API calls. +# This results in unnessecary resource load, so we remove the plugins from our packages. +rm "$WC_DIR"/`basename $APP`/Contents/PlugIns/bearer/*.dylib hdiutil detach "$WC_DIR" -quiet -force rm -f $TARGET hdiutil convert "$WC_DMG" -quiet -format UDZO -imagekey zlib-level=9 -o "$TARGET" -- cgit v0.10.2-6-g49f6