From 31fc0312674b0eb4b26118783247e1f910aebc43 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 20 Jul 2019 15:23:22 +0200 Subject: [PATCH] Fix missing qt plugins in macOS travis-ci build (#225) --- .travis.yml | 13 +++++++------ cmake/Dmg.cmake | 1 + dist/macos/create-dmg.sh.in | 2 +- dist/macos/macdeploy.py | 26 ++++++++++++++++++-------- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 179e7b97b..ecb798863 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,8 @@ before_install: git pull || travis_terminate 1; brew update || travis_terminate 1; brew unlink python || travis_terminate 1; - brew install glib pkgconfig libffi protobuf protobuf-c qt gettext gnutls fftw sqlite; + brew install glib pkgconfig libffi protobuf protobuf-c qt gettext gnutls fftw sqlite chromaprint; brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav; - brew install chromaprint; brew install libcdio libmtp libimobiledevice libplist; brew install create-dmg; export Qt5_DIR=/usr/local/opt/qt5/lib/cmake; @@ -34,6 +33,7 @@ before_install: export PATH="/usr/local/opt/gettext/bin:$PATH"; export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig/:$PKG_CONFIG_PATH; ls /usr/local/lib/gstreamer-1.0; + ls /usr/local/lib/gio/modules; fi before_script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build cmake -Hstrawberry -Bbuild ; fi @@ -43,14 +43,15 @@ script: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make -j8 || travis_terminate 1; make install || travis_terminate 1; - sudo ../dist/macos/macdeploy.py strawberry.app || travis_terminate 1; - sudo ../dist/macos/create-dmg.sh strawberry.app; + sudo make dmg; fi after_success: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ls -lh strawberry.dmg; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ls -lh strawberry*.dmg; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CC_FOR_BUILD" == "gcc" ]] && [ -f ~/.ssh/id_rsa ]; then - if [[ "$TRAVIS_BRANCH" == "master" ]] || [[ "$TRAVIS_BRANCH" == "macos" ]]; then + if [[ "$TRAVIS_BRANCH" == "master" ]]; then rsync -e "ssh -o StrictHostKeyChecking=no" -va strawberry*.dmg travis@echoes.jkvinge.net:/home/travis/builds/macos; + elif [[ "$TRAVIS_BRANCH" == "macos" ]]; then + rsync -e "ssh -o StrictHostKeyChecking=no" -va strawberry*.dmg travis@echoes.jkvinge.net:/home/travis/builds/macos-test; fi fi diff --git a/cmake/Dmg.cmake b/cmake/Dmg.cmake index 3e5d8a77e..cf886fe54 100644 --- a/cmake/Dmg.cmake +++ b/cmake/Dmg.cmake @@ -1,4 +1,5 @@ add_custom_target(dmg + COMMAND sudo /usr/local/opt/qt5/bin/macdeployqt strawberry.app COMMAND sudo ${CMAKE_SOURCE_DIR}/dist/macos/macdeploy.py strawberry.app COMMAND sudo ${CMAKE_SOURCE_DIR}/dist/macos/create-dmg.sh strawberry.app WORKING_DIRECTORY ${CMAKE_BINARY_DIR} diff --git a/dist/macos/create-dmg.sh.in b/dist/macos/create-dmg.sh.in index c4ef5d674..b0479bb70 100755 --- a/dist/macos/create-dmg.sh.in +++ b/dist/macos/create-dmg.sh.in @@ -21,4 +21,4 @@ rm -f "$output_file" mkdir -p "$temp_dir" -create-dmg --volname "$name" --background ../dist/macos/dmg_background.png --app-drop-link 450 218 --icon $bundle_dir 150 218 --window-size 600 450 $output_file $bundle_dir +/usr/local/bin/create-dmg --volname "$name" --background "@CMAKE_SOURCE_DIR@/dist/macos/dmg_background.png" --app-drop-link 450 218 --icon $bundle_dir 150 218 --window-size 600 450 $output_file $bundle_dir diff --git a/dist/macos/macdeploy.py b/dist/macos/macdeploy.py index 5b5ad1ea0..f55afe594 100755 --- a/dist/macos/macdeploy.py +++ b/dist/macos/macdeploy.py @@ -36,13 +36,23 @@ FRAMEWORK_SEARCH_PATH = [ QT_PLUGINS = [ 'platforms/libqcocoa.dylib', + 'platforminputcontexts/libqtvirtualkeyboardplugin.dylib', + 'styles/libqmacstyle.dylib', 'sqldrivers/libqsqlite.dylib', + 'bearer/libqgenericbearer.dylib' + 'iconengines/libqsvgicon.dylib' 'imageformats/libqgif.dylib', 'imageformats/libqicns.dylib', 'imageformats/libqico.dylib', 'imageformats/libqjpeg.dylib', 'imageformats/libqsvg.dylib', 'imageformats/libqtiff.dylib', + 'printsupport/libcocoaprintersupport.dylib', + 'virtualkeyboard/libqtvirtualkeyboard_hangul.dylib', + 'virtualkeyboard/libqtvirtualkeyboard_openwnn.dylib', + 'virtualkeyboard/libqtvirtualkeyboard_pinyin.dylib', + 'virtualkeyboard/libqtvirtualkeyboard_tcime.dylib', + 'virtualkeyboard/libqtvirtualkeyboard_thai.dylib', ] QT_PLUGINS_SEARCH_PATH = [ @@ -458,7 +468,12 @@ def FindGioModule(name): def main(): logging.basicConfig(filename='macdeploy.log', level=logging.DEBUG, format='%(asctime)s %(levelname)-8s %(message)s') - FixBinary(binary) + #FixBinary(binary) + + try: + FixPlugin('strawberry-tagreader', '.') + except: + print 'Failed to find blob: %s' % traceback.format_exc() for plugin in GSTREAMER_PLUGINS: FixPlugin(FindGstreamerPlugin(plugin), 'gstreamer') @@ -467,13 +482,8 @@ def main(): FixPlugin(FindGioModule('libgiognutls.so'), 'gio-modules') #FixPlugin(FindGioModule('libgiognomeproxy.so'), 'gio-modules') - try: - FixPlugin('strawberry-tagreader', '.') - except: - print 'Failed to find blob: %s' % traceback.format_exc() - - for plugin in QT_PLUGINS: - FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin)) + #for plugin in QT_PLUGINS: + #FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin)) if len(sys.argv) <= 2: print 'Would run %d commands:' % len(commands)