Skip to content

Commit

Permalink
Use cpack instead of macdeployqt again
Browse files Browse the repository at this point in the history
Fixes #2661
  • Loading branch information
hluk committed May 15, 2024
1 parent 955dec6 commit a5f7c89
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,15 @@
"configuration": "Release",
"targets": "install"
}
],
"packagePresets": [
{
"name": "macOS-10",
"configurePreset": "macOS-10"
},
{
"name": "macOS-12-m1",
"configurePreset": "macOS-12-m1"
}
]
}
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,7 @@ qt_deploy_runtime_dependencies(
VERBOSE
)")
install(SCRIPT ${deploy_script})

set(CPACK_GENERATOR "DragNDrop")
include(CPack)
endif()
12 changes: 4 additions & 8 deletions utils/github/bundle-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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

0 comments on commit a5f7c89

Please sign in to comment.