diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 0533a80119..e89dc88c52 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -12,45 +12,6 @@ concurrency: cancel-in-progress: true jobs: - build_qt6_only: - # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md - runs-on: macos-11 - timeout-minutes: 90 - - steps: - - name: checkout - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Set up Python - uses: actions/setup-python@v4 - with: - cache: 'pip' - python-version: '3.9' - - - name: Install pip dependencies - working-directory: ./src - run: | - python3 -m pip install requests - - name: Try to restore update_deps cache - uses: actions/cache@v3 - with: - path: src/third_party_cache - key: update_deps-${{ runner.os }}-${{ hashFiles('src/build_tools/update_deps.py') }} - - - name: Install dependencies - working-directory: ./src - # This command uses src/third_party_cache as the download cache. - run: | - python3 build_tools/update_deps.py - - - name: Build Qt - working-directory: ./src - run: | - python3 build_tools/build_qt.py --release --confirm_license --qt_archive=third_party_cache/qtbase-everywhere-src-6.5.2.tar.xz - echo "MOZC_QT_PATH=${PWD}/third_party/qt" >> $GITHUB_ENV - build: # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md runs-on: macos-11 diff --git a/docs/build_mozc_in_osx.md b/docs/build_mozc_in_osx.md index 490065738a..e329b7fece 100644 --- a/docs/build_mozc_in_osx.md +++ b/docs/build_mozc_in_osx.md @@ -66,7 +66,7 @@ python build_tools/update_deps.py In this step, additional build dependencies will be downloaded. * [Ninja 1.11.0](https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-mac.zip) - * [Qt 5.15.10](https://download.qt.io/archive/qt/5.15/5.15.10/submodules/qtbase-everywhere-opensource-src-5.15.10.tar.xz) + * [Qt 6.5.2](https://download.qt.io/archive/qt/6.5/6.5.2/submodules/qtbase-everywhere-src-6.5.2.tar.xz) * [git submodules](../.gitmodules) You can specify `--noqt` option if you would like to use your own Qt binaries. diff --git a/src/bazel/BUILD.qt.bazel b/src/bazel/BUILD.qt.bazel index 0df5292575..5a23782315 100644 --- a/src/bazel/BUILD.qt.bazel +++ b/src/bazel/BUILD.qt.bazel @@ -58,7 +58,7 @@ apple_dynamic_framework_import( name = "QtCore_mac", framework_imports = glob( include = [ - "lib/QtCore.framework/Versions/5/QtCore", + "lib/QtCore.framework/Versions/A/QtCore", "lib/QtCore.framework/QtCore", "lib/QtCore.framework/Resoures/**", ], @@ -69,7 +69,7 @@ apple_dynamic_framework_import( name = "QtGui_mac", framework_imports = glob( include = [ - "lib/QtGui.framework/Versions/5/QtGui", + "lib/QtGui.framework/Versions/A/QtGui", "lib/QtGui.framework/QtGui", "lib/QtGui.framework/Resoures/**", ], @@ -80,7 +80,7 @@ apple_dynamic_framework_import( name = "QtPrintSupport_mac", framework_imports = glob( include = [ - "lib/QtPrintSupport.framework/Versions/5/QtPrintSupport", + "lib/QtPrintSupport.framework/Versions/A/QtPrintSupport", "lib/QtPrintSupport.framework/QtPrintSupport", "lib/QtPrintSupport.framework/Resoures/**", ], @@ -91,7 +91,7 @@ apple_dynamic_framework_import( name = "QtWidgets_mac", framework_imports = glob( include = [ - "lib/QtWidgets.framework/Versions/5/QtWidgets", + "lib/QtWidgets.framework/Versions/A/QtWidgets", "lib/QtWidgets.framework/QtWidgets", "lib/QtWidgets.framework/Resoures/**", ], @@ -103,4 +103,4 @@ filegroup( srcs = ["plugins/platforms/libqcocoa.dylib"], ) -exports_files(glob(["bin/*"])) +exports_files(glob(["libexec/*"])) diff --git a/src/bazel/qt.bzl b/src/bazel/qt.bzl index 6a20cc1df1..2f5c7c581a 100644 --- a/src/bazel/qt.bzl +++ b/src/bazel/qt.bzl @@ -83,12 +83,12 @@ def mozc_qt_moc(name, srcs, outs): cmd = mozc_select( default = "$(location //third_party/qt:moc) -p $$(dirname $<) -o $@ $(SRCS)", oss_linux = "$(location @qt_linux//:libexec/moc) -p $$(dirname $<) -o $@ $(SRCS)", - oss_macos = "$(location @qt_mac//:bin/moc) -p $$(dirname $<) -o $@ $(SRCS)", + oss_macos = "$(location @qt_mac//:libexec/moc) -p $$(dirname $<) -o $@ $(SRCS)", ), tools = mozc_select( default = ["//third_party/qt:moc"], oss_linux = ["@qt_linux//:libexec/moc"], - oss_macos = ["@qt_mac//:bin/moc"], + oss_macos = ["@qt_mac//:libexec/moc"], ), ) @@ -100,12 +100,12 @@ def mozc_qt_uic(name, srcs, outs): cmd = mozc_select( default = "$(location //third_party/qt:uic) -o $@ $(SRCS)", oss_linux = "$(location @qt_linux//:libexec/uic) -o $@ $(SRCS)", - oss_macos = "$(location @qt_mac//:bin/uic) -o $@ $(SRCS)", + oss_macos = "$(location @qt_mac//:libexec/uic) -o $@ $(SRCS)", ), tools = mozc_select( default = ["//third_party/qt:uic"], oss_linux = ["@qt_linux//:libexec/uic"], - oss_macos = ["@qt_mac//:bin/uic"], + oss_macos = ["@qt_mac//:libexec/uic"], ), ) @@ -117,12 +117,12 @@ def mozc_qt_rcc(name, qrc_name, qrc_file, srcs, outs): cmd = mozc_select( default = "$(location //third_party/qt:rcc) -o $@ -name " + qrc_name + " " + qrc_file, oss_linux = "$(location @qt_linux//:libexec/rcc) -o $@ -name " + qrc_name + " $(location " + qrc_file + ")", - oss_macos = "$(location @qt_mac//:bin/rcc) -o $@ -name " + qrc_name + " $(location " + qrc_file + ")", + oss_macos = "$(location @qt_mac//:libexec/rcc) -o $@ -name " + qrc_name + " $(location " + qrc_file + ")", ), tools = mozc_select( default = ["//third_party/qt:rcc"], oss_linux = ["@qt_linux//:libexec/rcc"], - oss_macos = ["@qt_mac//:bin/rcc"], + oss_macos = ["@qt_mac//:libexec/rcc"], ), ) diff --git a/src/bazel/qt_mac_repository.bzl b/src/bazel/qt_mac_repository.bzl index 2ac338920c..21f81e26be 100644 --- a/src/bazel/qt_mac_repository.bzl +++ b/src/bazel/qt_mac_repository.bzl @@ -36,8 +36,8 @@ def _qt_mac_repository_impl(repo_ctx): return qt_path = repo_ctx.path(repo_ctx.os.environ.get("MOZC_QT_PATH", repo_ctx.attr.default_path)) - repo_ctx.symlink(qt_path.get_child("bin"), "bin") repo_ctx.symlink(qt_path.get_child("lib"), "lib") + repo_ctx.symlink(qt_path.get_child("libexec"), "libexec") repo_ctx.symlink(qt_path.get_child("plugins"), "plugins") repo_ctx.template("BUILD.bazel", repo_ctx.path(Label("@//bazel:BUILD.qt.bazel"))) diff --git a/src/build_tools/build_qt.py b/src/build_tools/build_qt.py index 39f8dc4d08..b66708d353 100755 --- a/src/build_tools/build_qt.py +++ b/src/build_tools/build_qt.py @@ -334,12 +334,8 @@ def parse_args() -> argparse.Namespace: help='make release build') parser.add_argument('--qt_src_dir', help='qt src directory', type=str, default=str(ABS_QT_SRC_DIR)) - if is_windows(): - qt_archive_path_default = ABS_QT6_ARCHIVE_PATH - else: - qt_archive_path_default = ABS_QT5_ARCHIVE_PATH parser.add_argument('--qt_archive_path', help='qtbase archive path', type=str, - default=str(qt_archive_path_default)) + default=str(ABS_QT6_ARCHIVE_PATH)) parser.add_argument('--jom_archive_path', help='qtbase archive path', type=str, default=str(ABS_JOM_ARCHIVE_PATH)) parser.add_argument('--qt_dest_dir', help='qt dest directory', type=str, diff --git a/src/config.bzl b/src/config.bzl index 5028799fc1..db619712e9 100644 --- a/src/config.bzl +++ b/src/config.bzl @@ -47,12 +47,12 @@ EMACS_MOZC_CLIENT_DIR = "/usr/share/emacs/site-lisp/emacs-mozc" EMACS_MOZC_HELPER_DIR = "/usr/bin" MACOS_BUNDLE_ID_PREFIX = "org.mozc.inputmethod.Japanese" -MACOS_MIN_OS_VER = "10.13" +MACOS_MIN_OS_VER = "11.0" ## Qt path for macOS -# The paths are the default paths of Qt 5.15.2 installed by "make install". +# The paths are the default paths of Qt 6.5.2 installed by "make install". # # If MOZC_QT_PATH env var is specified, it is used for MACOS_QT_PATH instead. # # For Linux, Qt paths are managed by pkg_config_repository in WORKSPACE.bazel. -MACOS_QT_PATH = "/usr/local/Qt-5.15.2" +MACOS_QT_PATH = "/usr/local/Qt-6.5.2" diff --git a/src/mac/tweak_installer_files.py b/src/mac/tweak_installer_files.py index e81470e91c..88eb9c3b7b 100644 --- a/src/mac/tweak_installer_files.py +++ b/src/mac/tweak_installer_files.py @@ -65,7 +65,7 @@ def RemoveQtFrameworks(app_dir: str, app_name: str) -> None: cmd = [ 'install_name_tool', '-change', - f'@rpath/{framework}.framework/Versions/5/{framework}', + f'@rpath/{framework}.framework/Versions/A/{framework}', f'{host_dir}/{framework}.framework/{framework}', app_file, ] @@ -77,14 +77,14 @@ def SymlinkQtFrameworks(app_dir: str) -> None: frameworks = ['QtCore', 'QtGui', 'QtPrintSupport', 'QtWidgets'] for framework in frameworks: # Creates the following symbolic links. - # QtCore.framwwork/QtCore@ -> Versions/5/QtCore - # QtCore.framwwork/Resources@ -> Versions/5/Resources - # QtCore.framework/Versions/Current@ -> 5 + # QtCore.framwwork/QtCore@ -> Versions/A/QtCore + # QtCore.framwwork/Resources@ -> Versions/A/Resources + # QtCore.framework/Versions/Current@ -> A framework_dir = os.path.join(app_dir, f'Contents/Frameworks/{framework}.framework/') - # ln -s 5 {app_dir}/QtCore.framework/Versions/Current - os.symlink('5', framework_dir + 'Versions/Current') + # ln -s A {app_dir}/QtCore.framework/Versions/Current + os.symlink('A', framework_dir + 'Versions/Current') # rm {app_dir}/QtCore.framework/QtCore os.remove(framework_dir + framework)