From a5f7c894a6adac2acc6c5eaf450f73d3c5fdc853 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Wed, 15 May 2024 08:51:09 +0200 Subject: [PATCH] Use cpack instead of macdeployqt again Fixes #2661 --- .github/workflows/build-macos.yml | 1 + CMakePresets.json | 10 ++++++++++ src/CMakeLists.txt | 3 +++ utils/github/bundle-macos.sh | 12 ++++-------- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index bddab53006..e0d7f33d99 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -50,6 +50,7 @@ jobs: with: configurePreset: '${{ matrix.cmake_preset }}' buildPreset: '${{ matrix.cmake_preset }}' + packagePreset: '${{ matrix.cmake_preset }}' - name: Create gnupg directory for tests run: mkdir -p ~/.gnupg && chmod go-rwx ~/.gnupg diff --git a/CMakePresets.json b/CMakePresets.json index 1c17f166eb..eb4304266d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -64,5 +64,15 @@ "configuration": "Release", "targets": "install" } + ], + "packagePresets": [ + { + "name": "macOS-10", + "configurePreset": "macOS-10" + }, + { + "name": "macOS-12-m1", + "configurePreset": "macOS-12-m1" + } ] } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5235f9209..c8eea6f1a0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,4 +173,7 @@ qt_deploy_runtime_dependencies( VERBOSE )") install(SCRIPT ${deploy_script}) + + set(CPACK_GENERATOR "DragNDrop") + include(CPack) endif() diff --git a/utils/github/bundle-macos.sh b/utils/github/bundle-macos.sh index b1171a0605..9417f21e47 100755 --- a/utils/github/bundle-macos.sh +++ b/utils/github/bundle-macos.sh @@ -2,16 +2,10 @@ # Creates macOS bundle. set -xeuo pipefail -app_bundle_path="CopyQ.app" +cpack +app_bundle_path="CopyQ.app" executable="${PWD}/${app_bundle_path}/Contents/MacOS/CopyQ" -plugins=("$app_bundle_path/Contents/PlugIns/copyq/"*.so) -qt_bin="$(brew --prefix qt@6)/bin" - -rm -r "$app_bundle_path/Contents/PlugIns/"{networkinformation,imageformats/libqpdf.dylib,platforminputcontexts} - -"$qt_bin/macdeployqt" "$app_bundle_path" -dmg -verbose=2 -always-overwrite -no-plugins \ - "${plugins[@]/#/-executable=}" ls -Rl "$app_bundle_path" @@ -49,3 +43,5 @@ otool -L "$executable" otool -L "$app_bundle_path/Contents/PlugIns/"*/*.dylib otool -L "$app_bundle_path/Contents/PlugIns/copyq/"* otool -L "$app_bundle_path/Contents/Frameworks/"Qt*.framework/Versions/*/Qt* + +mv copyq-*.dmg CopyQ.dmg