Skip to content

Commit

Permalink
Draft: macOS: Add M1/arm64 support
Browse files Browse the repository at this point in the history
Closes #1884
  • Loading branch information
hluk committed Feb 5, 2024
1 parent c369875 commit 8a877a4
Show file tree
Hide file tree
Showing 23 changed files with 280 additions and 456 deletions.
97 changes: 0 additions & 97 deletions .github/workflows/build-linux.yml

This file was deleted.

14 changes: 8 additions & 6 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ jobs:
strategy:
matrix:
include:
- os: macos-12
buildname: macOS 10.15
- os: macos-14
buildname: macOS 12 M1
create_bundle: true
bundle_suffix: '-macos-12-m1'
cmake_preset: macOS-12-m1

steps:
- name: Checkout source code
Expand Down Expand Up @@ -42,20 +44,20 @@ jobs:
- name: Build with CMake
uses: lukka/run-cmake@v10
with:
configurePreset: macOS
buildPreset: macOS
configurePreset: '${{ matrix.cmake_preset }}'
buildPreset: '${{ matrix.cmake_preset }}'

- name: Create gnupg directory for tests
run: mkdir -p ~/.gnupg && chmod go-rwx ~/.gnupg

- name: Create macOS bundle
if: matrix.create_bundle
working-directory: '${{runner.workspace}}/build'
working-directory: '${{runner.workspace}}/install'
run: '${{github.workspace}}/utils/github/bundle-macos.sh'

- name: Upload macOS bundle
if: matrix.create_bundle
uses: actions/upload-artifact@v4
with:
name: CopyQ.dmg
name: 'CopyQ${{ matrix.bundle_suffix }}.dmg'
path: '${{runner.workspace}}/build/CopyQ.dmg'
60 changes: 0 additions & 60 deletions .gitlab-ci.yml

This file was deleted.

30 changes: 26 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
}
},
{
"name": "macOS",
"name": "macOS-10",
"generator": "Ninja",
"binaryDir": "${sourceParentDir}/build",
"installDir": "${sourceParentDir}/build",
"installDir": "${sourceParentDir}/install",
"cacheVariables": {
"WITH_TESTS": "TRUE",
"CMAKE_PREFIX_PATH": "/usr/local/opt/qt@5/lib/cmake",
Expand All @@ -26,6 +26,22 @@
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
"CMAKE_CXX_FLAGS": "-Wno-deprecated-declarations"
}
},
{
"name": "macOS-12-m1",
"generator": "Ninja",
"binaryDir": "${sourceParentDir}/build",
"installDir": "${sourceParentDir}/install",
"cacheVariables": {
"WITH_QT6": "TRUE",
"WITH_TESTS": "TRUE",
"CMAKE_PREFIX_PATH": "/usr/local/opt/qt/lib/cmake",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12",
"CMAKE_OSX_ARCHITECTURES": "arm64",
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
"CMAKE_CXX_FLAGS": "-Wno-deprecated-declarations"
}
}
],
"buildPresets": [
Expand All @@ -36,8 +52,14 @@
"targets": "install"
},
{
"name": "macOS",
"configurePreset": "macOS",
"name": "macOS-10",
"configurePreset": "macOS-10",
"configuration": "Release",
"targets": "install"
},
{
"name": "macOS-12-m1",
"configurePreset": "macOS-12-m1",
"configuration": "Release",
"targets": "install"
}
Expand Down
57 changes: 0 additions & 57 deletions appveyor.yml

This file was deleted.

12 changes: 2 additions & 10 deletions docs/build-source-code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,15 @@ On OS X, required Qt 5 libraries and utilities can be easily installed with `Hom
# brew untap --force copyq/kde
# and re-run the above "brew tap" command

brew install qt5 copyq/kde/kf5-knotifications
brew install qt6 copyq/kde/kf6-knotifications copyq/kde/kf6-kstatusnotifieritem

Build with the following commands:

::

cmake -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" .
cmake --build .
cmake --install .
macdeployqt CopyQ.app -dmg -verbose=2 -always-overwrite \
-executable=CopyQ.app/Contents/PlugIns/copyq/libitemfakevim.so \
-executable=CopyQ.app/Contents/PlugIns/copyq/libitemimage.so \
-executable=CopyQ.app/Contents/PlugIns/copyq/libitemnotes.so \
-executable=CopyQ.app/Contents/PlugIns/copyq/libitempinned.so \
-executable=CopyQ.app/Contents/PlugIns/copyq/libitemsync.so \
-executable=CopyQ.app/Contents/PlugIns/copyq/libitemtags.so \
-executable=CopyQ.app/Contents/PlugIns/copyq/libitemtext.so
cpack

This will produce a self-contained application bundle ``CopyQ.app``
which can then be copied or moved into ``/Applications``.
Expand Down
Loading

0 comments on commit 8a877a4

Please sign in to comment.