Skip to content

Commit

Permalink
Draft: macOS: Add M1/arm64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Oct 4, 2023
1 parent a7a891e commit 5feebad
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 235 deletions.
93 changes: 0 additions & 93 deletions .github/workflows/build-linux.yml

This file was deleted.

18 changes: 14 additions & 4 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ jobs:
strategy:
matrix:
include:
- os: macos-11
buildname: macOS 10.15
# - os: macos-11
# buildname: macOS 10.15
# create_bundle: true
# cmake_configure_preset: macOS-10
# bundle_suffix: ''
# qt_package: "qt@5"
- os: macos-12-large
buildname: macOS 12 M1
create_bundle: true
bundle_suffix: '-macos-12-m1'
cmake_configure_preset: macOS-12-m1
qt_package_version: "6"

steps:
- name: Checkout source code
Expand All @@ -37,12 +46,13 @@ jobs:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
COPYQ_QT_PACKAGE_VERSION: '${{ matrix.qt_package_version }}'
run: '${{github.workspace}}/utils/github/install-macos.sh'

- name: Build with CMake
uses: lukka/run-cmake@v10
with:
configurePreset: macOS
configurePreset: '${{ matrix.cmake_configure_preset }}'
buildPreset: macOS

- name: Create gnupg directory for tests
Expand All @@ -57,5 +67,5 @@ jobs:
if: matrix.create_bundle
uses: actions/upload-artifact@v3
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.

18 changes: 17 additions & 1 deletion 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 Down
57 changes: 0 additions & 57 deletions appveyor.yml

This file was deleted.

6 changes: 5 additions & 1 deletion utils/github/homebrew/Formula/extra-cmake-modules.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$qt_version = ENV["COPYQ_QT_PACKAGE_VERSION"]

class ExtraCmakeModules < Formula
desc "Extra modules and scripts for CMake"
homepage "https://api.kde.org/frameworks/extra-cmake-modules/html/index.html"
Expand All @@ -9,10 +11,12 @@ class ExtraCmakeModules < Formula
depends_on "cmake" => [:build, :test]
depends_on "ninja" => :build

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

def install
args = std_cmake_args
args << "-DQT_MAJOR_VERSION=#{$qt_version}"
args << "-DQT_DEFAULT_MAJOR_VERSION=#{$qt_version}"
args << "-DBUILD_HTML_DOCS=OFF"
args << "-DBUILD_MAN_DOCS=OFF"
args << "-DBUILD_QTHELP_DOCS=OFF"
Expand Down
11 changes: 7 additions & 4 deletions utils/github/homebrew/Formula/kf5-kconfig.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$qt_version = ENV["COPYQ_QT_PACKAGE_VERSION"]

class Kf5Kconfig < Formula
desc "Configuration system"
homepage "https://www.kde.org"
Expand All @@ -10,15 +12,16 @@ class Kf5Kconfig < Formula

depends_on "copyq/kde/extra-cmake-modules" => [:build, :test]

depends_on "qt@5"
depends_on "qt"

def install
args = std_cmake_args
args << "-DQT_MAJOR_VERSION=#{$qt_version}"
args << "-DBUILD_TESTING=OFF"
args << "-DBUILD_QCH=OFF"
args << "-DKDE_INSTALL_QMLDIR=lib/qt5/qml"
args << "-DKDE_INSTALL_PLUGINDIR=lib/qt5/plugins"
args << "-DKDE_INSTALL_QTPLUGINDIR=lib/qt5/plugins"
args << "-DKDE_INSTALL_QMLDIR=lib/qt#{$qt_version}/qml"
args << "-DKDE_INSTALL_PLUGINDIR=lib/qt#{$qt_version}/plugins"
args << "-DKDE_INSTALL_QTPLUGINDIR=lib/qt#{$qt_version}/plugins"

args << "-DKCONFIG_USE_GUI=OFF"
args << "-DKCONFIG_USE_DBUS=OFF"
Expand Down
15 changes: 11 additions & 4 deletions utils/github/homebrew/Formula/kf5-kcoreaddons.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$qt_version = ENV["COPYQ_QT_PACKAGE_VERSION"]

class Kf5Kcoreaddons < Formula
desc "Addons to QtCore"
homepage "https://www.kde.org"
Expand All @@ -10,15 +12,20 @@ class Kf5Kcoreaddons < Formula

depends_on "copyq/kde/extra-cmake-modules" => [:build, :test]

depends_on "qt@5"
depends_on "qt"

def install
args = std_cmake_args

args << "-DQT_MAJOR_VERSION=#{$qt_version}"
args << "-DBUILD_WITH_QT6=ON" if $qt_version == "6"
args << "-DEXCLUDE_DEPRECATED_BEFORE_AND_AT=CURRENT"

args << "-DBUILD_TESTING=OFF"
args << "-DBUILD_QCH=OFF"
args << "-DKDE_INSTALL_QMLDIR=lib/qt5/qml"
args << "-DKDE_INSTALL_PLUGINDIR=lib/qt5/plugins"
args << "-DKDE_INSTALL_QTPLUGINDIR=lib/qt5/plugins"
args << "-DKDE_INSTALL_QMLDIR=lib/qt#{$qt_version}/qml"
args << "-DKDE_INSTALL_PLUGINDIR=lib/qt#{$qt_version}/plugins"
args << "-DKDE_INSTALL_QTPLUGINDIR=lib/qt#{$qt_version}/plugins"
args << "-DUPDATE_MIME_DATABASE_EXECUTABLE=OFF"

mkdir "build" do
Expand Down
Loading

0 comments on commit 5feebad

Please sign in to comment.