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 5c06368
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 323 deletions.
97 changes: 0 additions & 97 deletions .github/workflows/build-linux.yml

This file was deleted.

12 changes: 7 additions & 5 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,8 +44,8 @@ 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
Expand All @@ -57,5 +59,5 @@ jobs:
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.

28 changes: 25 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
},
{
"name": "macOS",
"name": "macOS-10",
"generator": "Ninja",
"binaryDir": "${sourceParentDir}/build",
"installDir": "${sourceParentDir}/build",
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}/build",
"cacheVariables": {
"WITH_QT6": "TRUE",
"WITH_TESTS": "TRUE",
"CMAKE_PREFIX_PATH": "/usr/local/opt/qt6/lib/cmake",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12",
"CMAKE_OSX_ARCHITECTURES": "x86_64;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.

2 changes: 1 addition & 1 deletion docs/build-source-code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ 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:

Expand Down
4 changes: 3 additions & 1 deletion src/platform/mac/macplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ file(GLOB copyq_SOURCES ${copyq_SOURCES}

set(USE_QXT TRUE)

list(APPEND copyq_qt_modules MacExtras)
if (NOT WITH_QT6)
list(APPEND copyq_qt_modules MacExtras)
endif()
2 changes: 1 addition & 1 deletion utils/appveyor/before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if [[ $WITH_NATIVE_NOTIFICATIONS == ON ]]; then
"$build" extra-cmake-modules
"$build" kconfig "" "" "-DKCONFIG_USE_DBUS=OFF" "-DKCONFIG_USE_GUI=OFF"
"$build" kwindowsystem
"$build" kcoreaddons
"$build" knotifications
"$build" kstatusnotifieritem

# Create and upload dependencies zip file.
7z a "$APP-dependencies.zip" -r "$INSTALL_PREFIX"
Expand Down
4 changes: 2 additions & 2 deletions utils/github/bundle-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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@5)/bin"
qt_bin="$(brew --prefix qt@6)/bin"

rm -rf "$app_bundle_path/Contents/PlugIns/"{platforminputcontexts,printsupport,qmltooling}

Expand All @@ -28,7 +28,7 @@ test "$("$executable" info has-global-shortcuts)" -eq "1"

# Uninstall local Qt to make sure we only use libraries from the bundle
brew remove --ignore-dependencies --force \
qt@5 copyq/kde/kf5-knotifications freetype
qt@6 copyq/kde/kf6-knotifications copyq/kde/kf6-kstatusnotifieritem freetype

(
export LD_LIBRARY_PATH=""
Expand Down
6 changes: 3 additions & 3 deletions utils/github/homebrew/Formula/extra-cmake-modules.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
class ExtraCmakeModules < Formula
desc "Extra modules and scripts for CMake"
homepage "https://api.kde.org/frameworks/extra-cmake-modules/html/index.html"
url "https://download.kde.org/stable/frameworks/5.109/extra-cmake-modules-5.109.0.tar.xz"
sha256 "1526b557cf9718e4d3bf31ff241578178d1ee60bdfb863110c97d43d478b7fb7"
url "https://download.kde.org/unstable/frameworks/5.249.0/extra-cmake-modules-5.249.0.tar.xz"
sha256 "800fbb24496980604886b6f9dbf9c9f44693c73cc924abbe4bab21274ff4379b"
license all_of: ["BSD-2-Clause", "BSD-3-Clause", "MIT"]
head "https://invent.kde.org/frameworks/extra-cmake-modules.git"

depends_on "cmake" => [:build, :test]
depends_on "ninja" => :build

depends_on "qt@5" => :build
depends_on "qt" => :build

def install
args = std_cmake_args
Expand Down
36 changes: 0 additions & 36 deletions utils/github/homebrew/Formula/kf5-kcoreaddons.rb

This file was deleted.

Loading

0 comments on commit 5c06368

Please sign in to comment.