pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/inputmethod



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Sat Feb 10 01:17:29 UTC 2024

Modified Files:
        pkgsrc/inputmethod/mozc-elisp: Makefile
        pkgsrc/inputmethod/mozc-renderer: Makefile
        pkgsrc/inputmethod/mozc-server: Makefile Makefile.common distinfo
        pkgsrc/inputmethod/mozc-server/patches: patch-base_cpu__stats.cc
            patch-base_logging.cc patch-base_password__manager.cc
            patch-base_port.h patch-base_process.cc patch-base_system__util.cc
            patch-client_client.cc patch-config.bzl
            patch-config_stats__config__util__test.cc
            patch-gui_config__dialog_config__dialog.cc
            patch-gui_config__dialog_keybinding__editor.cc
            patch-gui_dictionary__tool_dictionary__tool.cc
            patch-gui_word__register__dialog_word__register__dialog.cc
            patch-ipc_ipc__path__manager.cc patch-ipc_unix__ipc.cc
            patch-session_session.cc patch-session_session__test.cc
        pkgsrc/inputmethod/mozc-tool: Makefile
Added Files:
        pkgsrc/inputmethod/mozc-server/patches: patch-WORKSPACE.bazel
            patch-base_file_recursive.cc patch-base_system__util__test.cc
            patch-bazel_pkg__config__repository.bzl
            patch-gui_config__dialog_keymap__editor.cc
            patch-session_session__handler__scenario__test.cc
            patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc
            patch-third__party_protobuf_toolchain_cc__toolchain__config.bzl
Removed Files:
        pkgsrc/inputmethod/mozc-server/patches: patch-base_base.gyp
            patch-base_clock.cc patch-base_mutex.cc patch-base_run__level.cc
            patch-base_thread.cc patch-build__mozc.py
            patch-build__tools_mozc__version.py patch-build__tools_util.py
            patch-gui_qt__libraries.gypi patch-gui_qt__moc.gypi
            patch-gui_qt__rcc.gypi patch-gui_qt__uic.gypi patch-gyp_common.gypi
            patch-gyp_directories.gypi patch-ipc_ipc__path__manager__test.cc
            patch-ipc_named__event.cc patch-protobuf_protobuf.gyp
            patch-renderer_renderer.gyp
            patch-third__party_abseil-cpp_absl_base_config.h
            patch-third__party_protobuf_post__process__dist.sh patch-uim-mozc
            patch-unix_ibus_ibus.gyp patch-unix_ibus_path__util.cc

Log Message:
mozc: Update to 2.29.5268.102

* Convert to use devel/bazel as build automation tool.
* Bazel downloads distfiles during build. It is difficult to avoid
  the downloading because it is performed recursively.

Changelog:
Not Available.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 pkgsrc/inputmethod/mozc-elisp/Makefile
cvs rdiff -u -r1.72 -r1.73 pkgsrc/inputmethod/mozc-renderer/Makefile
cvs rdiff -u -r1.89 -r1.90 pkgsrc/inputmethod/mozc-server/Makefile
cvs rdiff -u -r1.40 -r1.41 pkgsrc/inputmethod/mozc-server/Makefile.common
cvs rdiff -u -r1.28 -r1.29 pkgsrc/inputmethod/mozc-server/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/inputmethod/mozc-server/patches/patch-WORKSPACE.bazel \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_file_recursive.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util__test.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-bazel_pkg__config__repository.bzl \
    pkgsrc/inputmethod/mozc-server/patches/patch-session_session__handler__scenario__test.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-third__party_protobuf_toolchain_cc__toolchain__config.bzl
cvs rdiff -u -r1.7 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_base.gyp \
    pkgsrc/inputmethod/mozc-server/patches/patch-protobuf_protobuf.gyp
cvs rdiff -u -r1.3 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_clock.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-ipc_ipc__path__manager__test.cc
cvs rdiff -u -r1.4 -r1.5 \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_cpu__stats.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-client_client.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-config_stats__config__util__test.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-session_session__test.cc
cvs rdiff -u -r1.6 -r1.7 \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_logging.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_process.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-ipc_ipc__path__manager.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-ipc_unix__ipc.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-session_session.cc
cvs rdiff -u -r1.6 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_mutex.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_run__level.cc
cvs rdiff -u -r1.5 -r1.6 \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_password__manager.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_port.h
cvs rdiff -u -r1.2 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-base_thread.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-gyp_directories.gypi \
    pkgsrc/inputmethod/mozc-server/patches/patch-ipc_named__event.cc \
    pkgsrc/inputmethod/mozc-server/patches/patch-unix_ibus_ibus.gyp
cvs rdiff -u -r1.10 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-build__mozc.py
cvs rdiff -u -r1.4 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-build__tools_mozc__version.py \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_qt__libraries.gypi \
    pkgsrc/inputmethod/mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh
cvs rdiff -u -r1.5 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-build__tools_util.py
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl
cvs rdiff -u -r1.7 -r1.8 \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
cvs rdiff -u -r0 -r1.4 \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keymap__editor.cc
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_qt__moc.gypi \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_qt__rcc.gypi \
    pkgsrc/inputmethod/mozc-server/patches/patch-gui_qt__uic.gypi \
    pkgsrc/inputmethod/mozc-server/patches/patch-renderer_renderer.gyp \
    pkgsrc/inputmethod/mozc-server/patches/patch-third__party_abseil-cpp_absl_base_config.h \
    pkgsrc/inputmethod/mozc-server/patches/patch-uim-mozc \
    pkgsrc/inputmethod/mozc-server/patches/patch-unix_ibus_path__util.cc
cvs rdiff -u -r1.12 -r0 \
    pkgsrc/inputmethod/mozc-server/patches/patch-gyp_common.gypi
cvs rdiff -u -r1.86 -r1.87 pkgsrc/inputmethod/mozc-tool/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/inputmethod/mozc-elisp/Makefile
diff -u pkgsrc/inputmethod/mozc-elisp/Makefile:1.81 pkgsrc/inputmethod/mozc-elisp/Makefile:1.82
--- pkgsrc/inputmethod/mozc-elisp/Makefile:1.81 Mon Jan  1 16:05:23 2024
+++ pkgsrc/inputmethod/mozc-elisp/Makefile      Sat Feb 10 01:17:29 2024
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.81 2024/01/01 16:05:23 ryoon Exp $
+# $NetBSD: Makefile,v 1.82 2024/02/10 01:17:29 ryoon Exp $
 
 PKGNAME=       ${EMACS_PKGNAME_PREFIX}${DISTNAME:S/mozc-/mozc-elisp-/}
-PKGREVISION=   26
 CATEGORIES=    inputmethod editors
 
 EMACS_MODULES= base leim
@@ -10,19 +9,26 @@ EMACS_MODULES=       base leim
 
 INSTALLATION_DIRS=     ${EMACS_LISPPREFIX} bin
 
-pre-configure:
-       ${RM} ${WRKSRC}/unix/uim/uim.gyp
-
 do-build:
        cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
-               ${PYTHONBIN} build_mozc.py build -c Release \
-                       unix/emacs/emacs.gyp:mozc_emacs_helper
-       cd ${WRKSRC}/unix/emacs && \
-               ${EMACS_BIN} -q -batch -no-site-file -no-init-file \
-                       -f batch-byte-compile mozc.el
+               ${PREFIX}/bin/bazel \
+                       --output_user_root=${WRKDIR}/bazel \
+                       --client_debug \
+                       build \
+                       unix/emacs:mozc_emacs_helper \
+                       --host_action_env=CWRAPPERS_CONFIG_DIR=${CWRAPPERS_CONFIG_DIR} \
+                       --action_env=CWRAPPERS_CONFIG_DIR=${CWRAPPERS_CONFIG_DIR} \
+                       --host_action_env=PATH=${PATH} \
+                       --action_env=PATH=${PATH} \
+                       --sandbox_debug \
+                       --verbose_failures \
+                       --subcommands \
+                       --config oss_linux --compilation_mode opt && \
+               ${EMACS_BIN} --no-init-file --no-site-file -batch \
+                       -f batch-byte-compile ${WRKSRC}/unix/emacs/mozc.el
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/out_${OSDEST}/Release/mozc_emacs_helper \
+       ${INSTALL_PROGRAM} ${WRKSRC}/bazel-out/${OSDEST}/bin/unix/emacs/mozc_emacs_helper \
                ${DESTDIR}${PREFIX}/bin
        ${INSTALL_DATA} ${WRKSRC}/unix/emacs/mozc.el \
                ${DESTDIR}${EMACS_LISPPREFIX}

Index: pkgsrc/inputmethod/mozc-renderer/Makefile
diff -u pkgsrc/inputmethod/mozc-renderer/Makefile:1.72 pkgsrc/inputmethod/mozc-renderer/Makefile:1.73
--- pkgsrc/inputmethod/mozc-renderer/Makefile:1.72      Mon Jan  1 16:05:23 2024
+++ pkgsrc/inputmethod/mozc-renderer/Makefile   Sat Feb 10 01:17:29 2024
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.72 2024/01/01 16:05:23 ryoon Exp $
+# $NetBSD: Makefile,v 1.73 2024/02/10 01:17:29 ryoon Exp $
 
 PKGNAME=       ${DISTNAME:S/mozc-/mozc-renderer-/}
-PKGREVISION=   25
 
 CONFLICTS+=    ibus-mozc<=1.13.1651.102
 
@@ -10,16 +9,24 @@ INSTALLATION_DIRS+=  libexec share/icons
 DEPENDS+=      xdg-utils-[0-9]*:../../misc/xdg-utils
 DEPENDS+=      mozc-server-[0-9]*:../../inputmethod/mozc-server
 
-pre-configure:
-       ${RM} ${WRKSRC}/unix/uim/uim.gyp
-
 do-build:
        cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
-               ${PYTHONBIN} build_mozc.py build -c ${MOZC_BUILD_MODE} \
-                       renderer/renderer.gyp:mozc_renderer
+               ${PREFIX}/bin/bazel \
+                       --output_user_root=${WRKDIR}/bazel \
+                       --client_debug \
+                       build \
+                       renderer/qt:mozc_renderer \
+                       --host_action_env=CWRAPPERS_CONFIG_DIR=${CWRAPPERS_CONFIG_DIR} \
+                       --action_env=CWRAPPERS_CONFIG_DIR=${CWRAPPERS_CONFIG_DIR} \
+                       --host_action_env=PATH=${PATH} \
+                       --action_env=PATH=${PATH} \
+                       --sandbox_debug \
+                       --verbose_failures \
+                       --subcommands \
+                       --config oss_linux --compilation_mode opt
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/out_${OSDEST}/${MOZC_BUILD_MODE}/mozc_renderer \
+       ${INSTALL_PROGRAM} ${WRKSRC}/bazel-out/${OSDEST}/bin/renderer/qt/mozc_renderer \
                ${DESTDIR}${PREFIX}/libexec
 .for f in ui-alpha_full ui-alpha_half ui-dictionary ui-direct \
        ui-hiragana ui-katakana_full ui-katakana_half ui-properties ui-tool

Index: pkgsrc/inputmethod/mozc-server/Makefile
diff -u pkgsrc/inputmethod/mozc-server/Makefile:1.89 pkgsrc/inputmethod/mozc-server/Makefile:1.90
--- pkgsrc/inputmethod/mozc-server/Makefile:1.89        Mon Jan  1 16:05:23 2024
+++ pkgsrc/inputmethod/mozc-server/Makefile     Sat Feb 10 01:17:26 2024
@@ -1,22 +1,27 @@
-# $NetBSD: Makefile,v 1.89 2024/01/01 16:05:23 ryoon Exp $
+# $NetBSD: Makefile,v 1.90 2024/02/10 01:17:26 ryoon Exp $
 
 PKGNAME=       ${DISTNAME:S/mozc-/mozc-server-/}
-PKGREVISION=   25
 
 INSTALLATION_DIRS+=    libexec
 
-pre-configure:
-       ${RM} ${WRKSRC}/unix/uim/uim.gyp
-
 do-build:
        cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
-               ${PYTHONBIN} build_mozc.py build \
-               -c ${MOZC_BUILD_MODE} \
-                       dictionary/dictionary_base.gyp:text_dictionary_loader \
-                       server/server.gyp:mozc_server
+               ${PREFIX}/bin/bazel \
+                       --output_user_root=${WRKDIR}/bazel \
+                       --client_debug \
+                       build \
+                       server:mozc_server \
+                       --host_action_env=CWRAPPERS_CONFIG_DIR=${CWRAPPERS_CONFIG_DIR} \
+                       --action_env=CWRAPPERS_CONFIG_DIR=${CWRAPPERS_CONFIG_DIR} \
+                       --host_action_env=PATH=${PATH} \
+                       --action_env=PATH=${PATH} \
+                       --sandbox_debug \
+                       --verbose_failures \
+                       --subcommands \
+                       --config oss_linux --compilation_mode opt
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/out_${OSDEST}/${MOZC_BUILD_MODE}/mozc_server \
+       ${INSTALL_PROGRAM} ${WRKSRC}/bazel-out/${OSDEST}/bin/server/mozc_server \
                ${DESTDIR}${PREFIX}/libexec/mozc_server
 
 .include "../../inputmethod/mozc-server/Makefile.common"

Index: pkgsrc/inputmethod/mozc-server/Makefile.common
diff -u pkgsrc/inputmethod/mozc-server/Makefile.common:1.40 pkgsrc/inputmethod/mozc-server/Makefile.common:1.41
--- pkgsrc/inputmethod/mozc-server/Makefile.common:1.40 Mon Jan  1 16:05:23 2024
+++ pkgsrc/inputmethod/mozc-server/Makefile.common      Sat Feb 10 01:17:26 2024
@@ -1,28 +1,77 @@
-# $NetBSD: Makefile.common,v 1.40 2024/01/01 16:05:23 ryoon Exp $
+# $NetBSD: Makefile.common,v 1.41 2024/02/10 01:17:26 ryoon Exp $
 
 # used by inputmethod/ibus-mozc/Makefile
 # used by inputmethod/mozc-elisp/Makefile
 # used by inputmethod/mozc-server/Makefile
 # used by inputmethod/mozc-tool/Makefile
 # used by inputmethod/mozc-renderer/Makefile
-# used by inputmethod/uim-mozc/Makefile
 
-DISTNAME=      mozc-2.26.4282.100
+DISTNAME=      mozc-2.29.5268.102
 CATEGORIES=    inputmethod
-MASTER_SITES=  ${MASTER_SITE_LOCAL}
-EXTRACT_SUFX=  .tar.xz
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=google/}
+GITHUB_PROJECT=        mozc
+GITHUB_TAG=    ${PKGVERSION_NOREV}
 
 MAINTAINER=    ryoon%NetBSD.org@localhost
 HOMEPAGE=      https://github.com/google/mozc/
 COMMENT=       Japanese inputmethod Mozc engine
 LICENSE=       modified-bsd
 
-UIM_MOZC=      uim-mozc-321.3ea28b1
-DISTFILES+=    ${DISTNAME}${EXTRACT_SUFX} \
-               ${UIM_MOZC}.tar.xz
-SITES.${UIM_MOZC}.tar.xz=      ${MASTER_SITE_SOURCEFORGE:=pnsft-aur/}
+GITHUB_SUBMODULES+=    google breakpad 216cea7bca53fa441a3ee0d0f5fd339a3a894224 third_party/breakpad
+GITHUB_SUBMODULES+=    google googletest 58d77fa8070e8cec2dc1ed015d66b454c8d78850 third_party/gtest
+GITHUB_SUBMODULES+=    chromium gyp 9ecf45e37677743503342ee4c6a76eaee80e4a7f third_party/gyp
+GITHUB_SUBMODULES+=    hiroyuki-komatsu japanese-usage-dictionary e5b3425575734c323e1d947009dd74709437b684 third_party/japanese_usage_dictionary
+GITHUB_SUBMODULES+=    protocolbuffers protobuf 54a2e5caa9d1a0a714fb2aa99753a1444414292a third_party/protobuf
+GITHUB_SUBMODULES+=    abseil abseil-cpp c2435f8342c2d0ed8101cb43adfd605fdc52dca2 third_party/abseil-cpp
+GITHUB_SUBMODULES+=    microsoft wil fc5dbf55989fe20351c71d038a8d12de4b397a6d third_party/wil
+
+DISTFILES+=    ${DEFAULT_DISTFILES}
+
+EXTRACT_ONLY=  ${DEFAULT_DISTFILES} ${_GITHUB_DEFAULT_DISTFILES}
+
+#MOZC_DISTS+=  bazel-skylib-1.4.1.tar.gz
+#SITES.bazel-skylib-1.4.1.tar.gz=      https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/
+#
+#MOZC_DISTS+=  rules_python-0.0.1.tar.gz
+#SITES.rules_python-0.0.1.tar.gz=      https://github.com/bazelbuild/rules_python/releases/download/0.0.1/
+#
+#MOZC_DISTS+=  rules_apple.1.1.3.tar.gz
+#SITES.rules_apple.1.1.3.tar.gz=               https://github.com/bazelbuild/rules_apple/releases/download/1.1.3/
+#
+#MOZC_DISTS+=  44dcd014f4b126f8941c29ff1b25e1584bd3eb26.zip
+#SITES.44dcd014f4b126f8941c29ff1b25e1584bd3eb26.zip=   https://github.com/bazelbuild/rules_android_ndk/archive/
+#
+#MOZC_DISTS+=  8fbaae947b87c1e66c0934493168fc6d583ed889.zip
+#SITES.8fbaae947b87c1e66c0934493168fc6d583ed889.zip=   https://github.com/google/google-toolbox-for-mac/archive/
+#
+#MOZC_DISTS+=  dictionary.png
+#SITES.dictionary.png= -https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/chrome_reader_mode/materialiconsoutlined/48dp/1x/outline_chrome_reader_mode_black_48dp.png
+#
+#MOZC_DISTS+=  dictionary.svg
+#SITES.dictionary.svg= -https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/chrome_reader_mode/materialiconsoutlined/24px.svg
+#
+#MOZC_DISTS+=  properties.png
+#SITES.properties.png= -https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/settings/materialiconsround/48dp/1x/round_settings_black_48dp.png
+#
+#MOZC_DISTS+=  properties.svg
+#SITES.properties.svg= -https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/settings/materialiconsround/24px.svg
+#
+#MOZC_DISTS+=  tool.png
+#SITES.tool.png=       -https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/build/materialicons/48dp/1x/baseline_build_black_48dp.png
+#
+#MOZC_DISTS+=  tool.svg
+#SITES.tool.svg=       -https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/build/materialicons/24px.svg
+#
+#MOZC_DISTS+=  ken_all.zip
+#SITES.ken_all.zip=    https://www.post.japanpost.jp/zipcode/dl/kogaki/zip/
+#
+#MOZC_DISTS+=  jigyosyo.zip
+#SITES.jigyosyo.zip=   https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/
+#
+#.for d in ${MOZC_DISTS}
+#DISTFILES+=   ${d}
+#.endfor
 
-EXTRACT_USING= bsdtar
 WRKSRC=                ${WRKDIR}/${DISTNAME}/src
 
 DISTINFO_FILE= ${.CURDIR}/../../inputmethod/mozc-server/distinfo
@@ -30,66 +79,45 @@ PATCHDIR=   ${.CURDIR}/../../inputmethod/m
 
 PYTHON_VERSIONS_INCOMPATIBLE+= 27
 
-TOOL_DEPENDS+= ${PYPKGPREFIX}-gyp>=0.1pre20200512.caa60026e223fc501e8b337fd5086ece4028b1c6:../../devel/gyp
-TOOL_DEPENDS+= ${PYPKGPREFIX}-six-[0-9]*:../../lang/py-six
-TOOL_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build
-
 USE_LANGUAGES= c c++
-USE_TOOLS+=    gmake pkg-config
-
-USE_CXX_FEATURES+=     c++11
+USE_TOOLS+=    pkg-config
 
-CHECK_PORTABILITY_SKIP+=       third_party/protobuf/src/google/protobuf/compiler/zip_output_unittest.sh
+USE_CXX_FEATURES+=     c++14
 
-OPENSSL_CFLAGS=                -I${BUILDLINK_PREFIX.openssl}/include
-OPENSSL_INC=           -I${BUILDLINK_PREFIX.openssl}/include
-OPENSSL_LDFLAGS=       -L${BUILDLINK_PREFIX.openssl}/lib -lssl -lcrypto
-OPENSSL_LIBS=          -lssl -lcrypto
-
-SUBST_CLASSES+=                gyp
-SUBST_STAGE.gyp=       pre-configure
-SUBST_MESSAGE.gyp=     Fix gyp defaults
-SUBST_FILES.gyp+=      config.bzl
-SUBST_FILES.gyp+=      base/process.cc
-SUBST_FILES.gyp+=      gyp/directories.gypi
-SUBST_FILES.gyp+=      unix/ibus/ibus.gyp
-SUBST_FILES.gyp+=      unix/ibus/path_util.cc
-SUBST_VARS.gyp+=       OPENSSL_CFLAGS OPENSSL_INC OPENSSL_LDFLAGS OPENSSL_LIBS
-SUBST_VARS.gyp+=       PREFIX
+TOOL_DEPENDS+=         bazel-[0-9]*:../../devel/bazel
 
-# To disable flock(1) in link stage.
-ALL_ENV+=      LINK=${CXX}
+SUBST_CLASSES+=                prefix
+SUBST_STAGE.prefix=    pre-configure
+SUBST_MESSAGE.prefix=  Setting PREFIX
+SUBST_FILES.prefix+=   base/process.cc
+SUBST_FILES.prefix+=   base/system_util.cc
+SUBST_FILES.prefix+=   third_party/protobuf/toolchain/cc_toolchain_config.bzl
+SUBST_FILES.prefix+=   config.bzl
+SUBST_VARS.prefix+=    PREFIX
+SUBST_VARS.prefix+=    X11BASE
 
 .include "../../mk/bsd.prefs.mk"
 
 OPSYSVARS+=    OSDEST
-OSDEST.Linux=  linux
-OSDEST.NetBSD= bsd
-
-MOZC_BUILD_MODE=       Release # or Debug
+OSDEST.Linux=  linux-opt
+OSDEST.NetBSD= netbsd-opt
 
-# In file included from src/dictionary/system/system_dictionary.h:43:0,
-#                  from ../../dictionary/system/system_dictionary.cc:47:
-# src/dictionary/system/key_expansion_table.h: In member function 'const mozc::dictionary::ExpandedKey mozc::dictionary::KeyExpansionTable::ExpandKey(char) const':
-# src/dictionary/system/key_expansion_table.h:83:34: error: array subscript has type 'char' [-Werror=char-subscripts]
-#      return ExpandedKey(table_[key]);
-# Maybe fix this later.
-BUILDLINK_TRANSFORM+=  rm:-Werror=char-subscripts
-
-do-configure:
-       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
-               ${PYTHONBIN} build_mozc.py \
-               gyp \
-               --gypdir=${LOCALBASE}/bin
-
-.include "../../devel/glib2/buildlink3.mk"
-#.include "../../devel/protobuf/buildlink3.mk"
-# gmock is not used yet...
-#.include "../../devel/gmock/buildlink3.mk"
-.include "../../inputmethod/zinnia/buildlink3.mk"
-.include "../../www/curl/buildlink3.mk"
-.include "../../x11/gtk2/buildlink3.mk"
-.include "../../x11/qt5-qtbase/buildlink3.mk"
+CHECK_PIE_SUPPORTED=   no
+pre-configure:
+       ${MKDIR} ${WRKSRC}/dist
+.for d in ${MOZC_DISTS}
+       ${LN} -s ${DISTDIR}/${d} ${WRKSRC}/dist/${d}
+.endfor
+       ${RM} -r ${WRKDIR}/.cwrapper
+
+.if empty(PKGPATH:Minputmethod/mozc-server)
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../x11/qt6-qtbase/buildlink3.mk"
+.endif
+
+# devel/bazel can use clang only for C/C++ projects.
+BUILDLINK_DEPMETHOD.clang=     build
+.include "../../lang/clang/buildlink3.mk"
 
 .include "../../lang/python/tool.mk"
 .include "../../mk/atomic64.mk"

Index: pkgsrc/inputmethod/mozc-server/distinfo
diff -u pkgsrc/inputmethod/mozc-server/distinfo:1.28 pkgsrc/inputmethod/mozc-server/distinfo:1.29
--- pkgsrc/inputmethod/mozc-server/distinfo:1.28        Tue Oct 26 10:49:37 2021
+++ pkgsrc/inputmethod/mozc-server/distinfo     Sat Feb 10 01:17:26 2024
@@ -1,48 +1,51 @@
-$NetBSD: distinfo,v 1.28 2021/10/26 10:49:37 nia Exp $
+$NetBSD: distinfo,v 1.29 2024/02/10 01:17:26 ryoon Exp $
 
-BLAKE2s (mozc-2.26.4282.100.tar.xz) = 0d6239653ece7577159c7dc23ead2e2a42239496f0b7c3d30db472634689d12e
-SHA512 (mozc-2.26.4282.100.tar.xz) = 236ec8ece076aea04480cb9aee30076699a30db88356c8bd9eb0694d86716a89748a6d33d66f5ba831e95bd0d16260e3111a9c75fded9e34df35e1785980cf12
-Size (mozc-2.26.4282.100.tar.xz) = 38346468 bytes
-BLAKE2s (uim-mozc-321.3ea28b1.tar.xz) = 56a29c64bd2a2a309f3c7ffd248d21a404f3e00d2058da2d4b3b356d0184cad5
-SHA512 (uim-mozc-321.3ea28b1.tar.xz) = b28f4d207a52c208694371dbc550ac5022a29c5870b8d856bca8052106d8be88ab8d066bdc6d895ac6fa9f350ce6be16d638603e46058f9528691f97cb86d054
-Size (uim-mozc-321.3ea28b1.tar.xz) = 24400 bytes
-SHA1 (patch-base_base.gyp) = d8d9abc0da196f0573ad645937812710c7c67746
-SHA1 (patch-base_clock.cc) = bac420650fed0450cf82b5071703a1c60e974a93
-SHA1 (patch-base_cpu__stats.cc) = 9c18fb2543f352951969822e0095f01f0e8d3bcd
-SHA1 (patch-base_logging.cc) = 65938bf4f4d414a0c3bcaffe9615d976dcab2254
-SHA1 (patch-base_mutex.cc) = c52761be5ef60af35685a4de18ef18a083b1d0b9
-SHA1 (patch-base_password__manager.cc) = 6b669b7c2cf15b1a85e648265dfca0f34e86d00d
-SHA1 (patch-base_port.h) = 73b76a61759e32dcb7edcbb70b5cff6ad091a15c
-SHA1 (patch-base_process.cc) = 9b838e6178d7dd64012c94b9c55a201d096e4680
-SHA1 (patch-base_run__level.cc) = b26b0c8a457b9feb9a4de0abd7d5aae5bcd9e491
-SHA1 (patch-base_system__util.cc) = bdd468c5a22fe8ecc3de57168162944afd0bb20d
-SHA1 (patch-base_thread.cc) = 5e62c41beedc57dec004d100753bae4c77289762
-SHA1 (patch-build__mozc.py) = c0ef43010c0f048550ed4a5e9bb7b29c8a24ac77
-SHA1 (patch-build__tools_mozc__version.py) = 133f6b17d9dc811284901513e4e4ae3711710082
-SHA1 (patch-build__tools_util.py) = 5ca614adf2453fcc33c18cda74c0d9b2e4f6bc21
-SHA1 (patch-client_client.cc) = c11341d48ce55af0aea440800da4a53a62a436c1
-SHA1 (patch-config.bzl) = 5f959d46741f2f3fbf0fbbe38aa8fa1baafadb27
-SHA1 (patch-config_stats__config__util__test.cc) = f1af7403f8e06faadc5c46267d2d8b26a60c8f8d
-SHA1 (patch-gui_config__dialog_config__dialog.cc) = f3349d6ed2bee63f7bb92bc71f9d8a8ab1316b74
-SHA1 (patch-gui_config__dialog_keybinding__editor.cc) = 09c03f57031306b5cca8f1e546719db936159e2d
-SHA1 (patch-gui_dictionary__tool_dictionary__tool.cc) = cae617cc8e324b0f93adc1e76632a018530cd2c7
-SHA1 (patch-gui_qt__libraries.gypi) = ceb8d5b15d4cd5b2d907406f02413290bd4ab652
-SHA1 (patch-gui_qt__moc.gypi) = e3d42e61b35012cda10da13aa03cee67786e171c
-SHA1 (patch-gui_qt__rcc.gypi) = d38a849fe8e81672eb441a41936f454d8e45ff5c
-SHA1 (patch-gui_qt__uic.gypi) = 7dd69ee109e81f0e70f2866b77555412518b4844
-SHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = 218e3706b819855814ba8871504fc7ccb4e40b23
-SHA1 (patch-gyp_common.gypi) = ce27e8665b9dab4dc6d34d337a2cb8c985c9e6f4
-SHA1 (patch-gyp_directories.gypi) = eea985113aac5b99bf3c12267ad754817eef5dcc
-SHA1 (patch-ipc_ipc__path__manager.cc) = cd1352bd5333f1ed755dcf6221f931fcd0a936d3
-SHA1 (patch-ipc_ipc__path__manager__test.cc) = 1b83b513383f184f5ab5a56cce734b7934998533
-SHA1 (patch-ipc_named__event.cc) = 8be0b1e5c4675e5b238e07b63e395dbed3c2d125
-SHA1 (patch-ipc_unix__ipc.cc) = d5d86910ca610015103a309bba8d6392d96f6ce6
-SHA1 (patch-protobuf_protobuf.gyp) = bb1c9684881199936abb8acd73948d1cb174a1ea
-SHA1 (patch-renderer_renderer.gyp) = 83493259d6b8cd9ab6871512bebc9616d72132d1
-SHA1 (patch-session_session.cc) = 3ae2c8dd056aae4c92d9dbfdac53d9c45261aad2
-SHA1 (patch-session_session__test.cc) = 7396e2f4931257d8a33087b1bed5418a038fefa1
-SHA1 (patch-third__party_abseil-cpp_absl_base_config.h) = e996fad886e0763c7be7b79735819e668159fd82
-SHA1 (patch-third__party_protobuf_post__process__dist.sh) = 8adc79d5d7eed3cbf406ebcfbd5832b7a050ced6
-SHA1 (patch-uim-mozc) = 0000583d8f3f44ef2281888c7cfdb968c17ec798
-SHA1 (patch-unix_ibus_ibus.gyp) = aa2077cf3c379bf9ce33e97abe478540346782ad
-SHA1 (patch-unix_ibus_path__util.cc) = a6aa368d9ce8926e200602fdc370c13e35d5a8cf
+BLAKE2s (abseil-abseil-cpp-c2435f8342c2d0ed8101cb43adfd605fdc52dca2.tar.gz) = 00ebf72f25bc06218db107c4bcf3d471c4e015394285658a8a840e5c5643674d
+SHA512 (abseil-abseil-cpp-c2435f8342c2d0ed8101cb43adfd605fdc52dca2.tar.gz) = 
e84f7d84b39fe2c68626da0bf0f1a50d1edcfda321739be0cba8d27758caf0962ff918afdd15ea109ae81e5a167ac0bea769f8780ff9b7517ff5807ca3a0880d
+Size (abseil-abseil-cpp-c2435f8342c2d0ed8101cb43adfd605fdc52dca2.tar.gz) = 2120347 bytes
+BLAKE2s (chromium-gyp-9ecf45e37677743503342ee4c6a76eaee80e4a7f.tar.gz) = ed98efdbceffd7f4d178db312bb90024228f449bb2445193a50d259af4922233
+SHA512 (chromium-gyp-9ecf45e37677743503342ee4c6a76eaee80e4a7f.tar.gz) = 
961259c270471524ac371310460ca0fc34cec1cc57f6604915a6771be5f577420a7f1ddccb0d865fb94f5fb1516e0cdbb7f74d05252c5c3782d2b8fe7bf6f7df
+Size (chromium-gyp-9ecf45e37677743503342ee4c6a76eaee80e4a7f.tar.gz) = 630462 bytes
+BLAKE2s (google-breakpad-216cea7bca53fa441a3ee0d0f5fd339a3a894224.tar.gz) = 9ad9f07697109ee2bf795c327bef55c0d7de9ecdf25a04c999ac3a542904607e
+SHA512 (google-breakpad-216cea7bca53fa441a3ee0d0f5fd339a3a894224.tar.gz) = 
6c7c667349c1b8e5509ba3a4a78873b87d1f1decefbd01e916e4b34497518c53c418ff5eaf88c9c9ef1815c8ee75112f876eebca4222ebb372fe6e5c2f5ab948
+Size (google-breakpad-216cea7bca53fa441a3ee0d0f5fd339a3a894224.tar.gz) = 5276094 bytes
+BLAKE2s (google-googletest-58d77fa8070e8cec2dc1ed015d66b454c8d78850.tar.gz) = 975854728adcbc9b8f8642b2d484529024b2f9459a81769bba39b0cc74565f5a
+SHA512 (google-googletest-58d77fa8070e8cec2dc1ed015d66b454c8d78850.tar.gz) = 
d8153c426e4f9c89a74721cc4a24dfcaf319810f4f10aa25fc972f99da2d96d66bc840cf2f51b756fef6b1ca47e8d2c8633f5862cc24e34d57309ad48802124a
+Size (google-googletest-58d77fa8070e8cec2dc1ed015d66b454c8d78850.tar.gz) = 855887 bytes
+BLAKE2s (hiroyuki-komatsu-japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.tar.gz) = 41a7c5d9cc2ffcce85239a416580d4595c129e7aca00316462e387b205183d07
+SHA512 (hiroyuki-komatsu-japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.tar.gz) = 
b7e997a979b6d50e49b9af5dc830ea4df0532f6ab1321b9ef14983f65bb54f1b2967375c82e07957ae7693ebbf43c9b56ecea6bfea8dd1fdaee444bd549d83a7
+Size (hiroyuki-komatsu-japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.tar.gz) = 71051 bytes
+BLAKE2s (microsoft-wil-fc5dbf55989fe20351c71d038a8d12de4b397a6d.tar.gz) = bd4eed4a97519b07fc1ac749e92058425232bff17796425b7469a065d3e2e7ce
+SHA512 (microsoft-wil-fc5dbf55989fe20351c71d038a8d12de4b397a6d.tar.gz) = 
59548723d25e6f3c4a0f750d9874b06a487c15afb9cc9fa3a7a5290cbf79ea42cf36b9906c73dc56c566736141819d7a020b7a3d793724df83a9de5bc61ef674
+Size (microsoft-wil-fc5dbf55989fe20351c71d038a8d12de4b397a6d.tar.gz) = 520155 bytes
+BLAKE2s (mozc-2.29.5268.102.tar.gz) = d01da00f8d8c4bb0e14188fab66d05cd3dd3097ee5803fea7c7dfff4927e2caf
+SHA512 (mozc-2.29.5268.102.tar.gz) = 1b3586659044fabad5eec151e885c6781d00af8c345e2e8768aceaacfdcdce01651d08d854cbcd079e6f1f75743e305316b2f410c3d8049c23880a7e0f620d0c
+Size (mozc-2.29.5268.102.tar.gz) = 38277685 bytes
+BLAKE2s (protocolbuffers-protobuf-54a2e5caa9d1a0a714fb2aa99753a1444414292a.tar.gz) = 4c142ebd4c669862e2a68ec2c90db0b9d1b17a74d9dbc379f994b01b5a84aaa1
+SHA512 (protocolbuffers-protobuf-54a2e5caa9d1a0a714fb2aa99753a1444414292a.tar.gz) = 
05d4c987e790dc1180b1e3555de52fa7b52866b2dea2dff5fca1398edd4a39c32611e7bc074df9749a06bcf2e9ee338379329900b01bc7f3c8caff55412e06ed
+Size (protocolbuffers-protobuf-54a2e5caa9d1a0a714fb2aa99753a1444414292a.tar.gz) = 5185168 bytes
+SHA1 (patch-WORKSPACE.bazel) = 10a4b9321943152c7ed00148630eff5409e13ae1
+SHA1 (patch-base_cpu__stats.cc) = 7e057385f271f7fa14a761d11b9a9663c5ab39b3
+SHA1 (patch-base_file_recursive.cc) = 9c6f5a2db32a757fa72b6a86d51e50f09fe9b38e
+SHA1 (patch-base_logging.cc) = dbf245a2d3869db3d5c930e9a1ccc581bb7cf216
+SHA1 (patch-base_password__manager.cc) = 71469a4ea2b7ba97d4bb105bd7f443ffdb4a027e
+SHA1 (patch-base_port.h) = c17c6057d26b91536b78047b85ad860e4cf56c83
+SHA1 (patch-base_process.cc) = 65a4aa23cc13dd3d85fc8d7b58058068e930829f
+SHA1 (patch-base_system__util.cc) = 893cac24fbdd1fa5ff02a1cb6f6ca2539021c8f7
+SHA1 (patch-base_system__util__test.cc) = 0195f3bd34d695ff047bf44152923cdcbc6e61f1
+SHA1 (patch-bazel_pkg__config__repository.bzl) = 1f0be3d001e14af31e75052aa6e3e1c8b31b12c3
+SHA1 (patch-client_client.cc) = 2094c8d9fa9c3806fc343373ac34b7cfd441c1e8
+SHA1 (patch-config.bzl) = 2c35cc8a89ecda745604911b0430df4834548bc3
+SHA1 (patch-config_stats__config__util__test.cc) = a51e1c239c54c406b21375be526facf29d924c53
+SHA1 (patch-gui_config__dialog_config__dialog.cc) = b7761985e9150da19deeeda9b751d6e65d488071
+SHA1 (patch-gui_config__dialog_keybinding__editor.cc) = a2e22f214f943c9d91b091432749f24900675f94
+SHA1 (patch-gui_config__dialog_keymap__editor.cc) = 12671f74b38944f908c20a48bae8e83f140732e8
+SHA1 (patch-gui_dictionary__tool_dictionary__tool.cc) = eeb6427662b121dfd0fe5cf09b8d3eba4cdc6cd2
+SHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = b90573e75df98a477441bb992722b5dba060b016
+SHA1 (patch-ipc_ipc__path__manager.cc) = 1366d8a7258fbe0268f032540bd1dc5edfd350bf
+SHA1 (patch-ipc_unix__ipc.cc) = 8ab319397184fed222bc597c6494db65e46066f1
+SHA1 (patch-session_session.cc) = 4f2629d6831c2f1caf00f7bcc2b5a377c3db50d3
+SHA1 (patch-session_session__handler__scenario__test.cc) = 7f879d70aa88c4a512f1342b16cfd7d8c0c1eec7
+SHA1 (patch-session_session__test.cc) = da2d7033d8c3a68c1cf154f4e17a3642f34bcfb3
+SHA1 (patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc) = 26e9978a2b131c935f57e54d5fdd99bc71aa9c82
+SHA1 (patch-third__party_protobuf_toolchain_cc__toolchain__config.bzl) = 5ffa624bc7ba6a195f7f6206dc1513c090d18719

Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_cpu__stats.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-base_cpu__stats.cc:1.4 pkgsrc/inputmethod/mozc-server/patches/patch-base_cpu__stats.cc:1.5
--- pkgsrc/inputmethod/mozc-server/patches/patch-base_cpu__stats.cc:1.4 Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_cpu__stats.cc     Sat Feb 10 01:17:27 2024
@@ -1,48 +1,31 @@
-$NetBSD: patch-base_cpu__stats.cc,v 1.4 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-base_cpu__stats.cc,v 1.5 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- base/cpu_stats.cc.orig     2021-02-15 03:48:53.000000000 +0000
+--- base/cpu_stats.cc.orig     2023-10-26 12:00:50.000000000 +0000
 +++ base/cpu_stats.cc
-@@ -122,13 +122,13 @@ float CPUStats::GetSystemCPULoad() {
+@@ -116,7 +116,7 @@ float CPUStats::GetSystemCPULoad() {
  
  #endif  // __APPLE__
  
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
    // NOT IMPLEMENTED
    // TODO(taku): implement Linux version
    // can take the info from /proc/stats
-   const uint64 total_times = 0;
-   const uint64 cpu_times = 0;
--#endif  // OS_LINUX || OS_ANDROID || OS_WASM
-+#endif  // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
- 
-   return UpdateCPULoad(total_times, cpu_times, &prev_system_total_times_,
-                        &prev_system_cpu_times_);
-@@ -175,11 +175,11 @@ float CPUStats::GetCurrentProcessCPULoad
-                            TimeValueTToInt64(task_times_info.system_time);
+@@ -169,7 +169,7 @@ float CPUStats::GetCurrentProcessCPULoad
+                              TimeValueTToInt64(task_times_info.system_time);
  #endif  // __APPLE__
  
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
    // not implemented
-   const uint64 total_times = 0;
-   const uint64 cpu_times = 0;
--#endif  // OS_LINUX || OS_ANDROID || OS_WASM
-+#endif  // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
- 
-   return UpdateCPULoad(total_times, cpu_times,
-                        &prev_current_process_total_times_,
-@@ -206,9 +206,9 @@ size_t CPUStats::GetNumberOfProcessors()
+   const uint64_t total_times = 0;
+   const uint64_t cpu_times = 0;
+@@ -200,7 +200,7 @@ size_t CPUStats::GetNumberOfProcessors()
    return static_cast<size_t>(basic_info.avail_cpus);
  #endif  // __APPLE__
  
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
    // Not implemented
    return 1;
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
- }
- }  // namespace mozc
+ #endif  // __linux__ || __wasm__
Index: pkgsrc/inputmethod/mozc-server/patches/patch-client_client.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-client_client.cc:1.4 pkgsrc/inputmethod/mozc-server/patches/patch-client_client.cc:1.5
--- pkgsrc/inputmethod/mozc-server/patches/patch-client_client.cc:1.4   Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-client_client.cc       Sat Feb 10 01:17:27 2024
@@ -1,24 +1,13 @@
-$NetBSD: patch-client_client.cc,v 1.4 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-client_client.cc,v 1.5 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- client/client.cc.orig      2021-02-15 03:48:53.000000000 +0000
+--- client/client.cc.orig      2023-12-13 09:23:05.795914176 +0000
 +++ client/client.cc
-@@ -867,7 +867,7 @@ bool Client::LaunchTool(const std::strin
+@@ -897,7 +897,7 @@ bool Client::LaunchTool(const std::strin
      return false;
    }
  
--#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)
-+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NETBSD)
-   std::string arg = "--mode=" + mode;
+-#if defined(_WIN32) || defined(__linux__)
++#if defined(_WIN32) || defined(__linux__) || defined(__NetBSD__)
+   std::string arg = absl::StrCat("--mode=", mode);
    if (!extra_arg.empty()) {
-     arg += " ";
-@@ -877,7 +877,7 @@ bool Client::LaunchTool(const std::strin
-     LOG(ERROR) << "Cannot execute: " << kMozcTool << " " << arg;
-     return false;
-   }
--#endif  // OS_WIN || OS_LINUX || OS_ANDROID
-+#endif  // OS_WIN || OS_LINUX || OS_ANDROID || OS_NETBSD
- 
-   // TODO(taku): move MacProcess inside SpawnMozcProcess.
-   // TODO(taku): support extra_arg.
+     absl::StrAppend(&arg, " ", extra_arg);
Index: pkgsrc/inputmethod/mozc-server/patches/patch-config_stats__config__util__test.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-config_stats__config__util__test.cc:1.4 pkgsrc/inputmethod/mozc-server/patches/patch-config_stats__config__util__test.cc:1.5
--- pkgsrc/inputmethod/mozc-server/patches/patch-config_stats__config__util__test.cc:1.4        Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-config_stats__config__util__test.cc    Sat Feb 10 01:17:27 2024
@@ -1,20 +1,13 @@
-$NetBSD: patch-config_stats__config__util__test.cc,v 1.4 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-config_stats__config__util__test.cc,v 1.5 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- config/stats_config_util_test.cc.orig      2021-02-15 03:48:53.000000000 +0000
+--- config/stats_config_util_test.cc.orig      2023-12-13 09:31:24.408148702 +0000
 +++ config/stats_config_util_test.cc
-@@ -685,11 +685,11 @@ TEST(StatsConfigUtilTestAndroid, Default
+@@ -688,7 +688,7 @@ TEST(StatsConfigUtilTestAndroid, Default
+   EXPECT_FALSE(StatsConfigUtil::IsEnabled());
+ #endif  // CHANNEL_DEV
  }
- #endif  // OS_ANDROID
- 
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_NETBSD)
+-#elif defined(__linux__)  // __ANDROID__
++#elif defined(__linux__) || defined(__NetBSD__)  // __ANDROID__
  TEST(StatsConfigUtilTestLinux, DefaultValueTest) {
    EXPECT_FALSE(StatsConfigUtil::IsEnabled());
  }
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_NETBSD
- 
- #else  // !GOOGLE_JAPANESE_INPUT_BUILD
- TEST(StatsConfigUtilTestNonOfficialBuild, DefaultValueTest) {
Index: pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc:1.4 pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc:1.5
--- pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc:1.4   Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc       Sat Feb 10 01:17:27 2024
@@ -1,24 +1,31 @@
-$NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.4 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.5 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- gui/config_dialog/keybinding_editor.cc.orig        2021-02-15 03:48:53.000000000 +0000
+--- gui/config_dialog/keybinding_editor.cc.orig        2023-12-13 09:41:52.856716895 +0000
 +++ gui/config_dialog/keybinding_editor.cc
-@@ -381,7 +381,7 @@ KeyBindingFilter::KeyState KeyBindingFil
+@@ -111,7 +111,7 @@ static const auto *kQtKeyModifierNonRequ
+         {Qt::Key_Hiragana_Katakana, "Hiragana"},
+         {Qt::Key_Eisu_toggle, "Eisu"},
+         {Qt::Key_Zenkaku_Hankaku, "Hankaku/Zenkaku"},
+-#ifdef __linux__
++#if defined(__linux__) || defined(__NetBSD__)
+         // On Linux (X / Wayland), Hangul and Hanja are identical with
+         // ImeOn and ImeOff.
+         // https://github.com/google/mozc/issues/552
+@@ -361,7 +361,7 @@ KeyBindingFilter::KeyState KeyBindingFil
        return Encode(result);
      }
    }
--#elif OS_LINUX
-+#elif defined(OS_LINUX) || defined(OS_NETBSD)
+-#elif __linux__
++#elif defined(__linux__) || defined(__NetBSD__)
    // The XKB defines three types of logical key code: "xkb::Hiragana",
    // "xkb::Katakana" and "xkb::Hiragana_Katakana".
    // On most of Linux distributions, any key event against physical
-@@ -478,7 +478,7 @@ bool KeyBindingFilter::eventFilter(QObje
+@@ -460,7 +460,7 @@ bool KeyBindingFilter::eventFilter(QObje
  KeyBindingEditor::KeyBindingEditor(QWidget *parent, QWidget *trigger_parent)
      : QDialog(parent), trigger_parent_(trigger_parent) {
    setupUi(this);
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_NETBSD)
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__NetBSD__)
    // Workaround for the issue https://github.com/google/mozc/issues/9
    // Seems that even after clicking the button for the keybinding dialog,
    // the edit is not raised. This might be a bug of setFocusProxy.
Index: pkgsrc/inputmethod/mozc-server/patches/patch-session_session__test.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-session_session__test.cc:1.4 pkgsrc/inputmethod/mozc-server/patches/patch-session_session__test.cc:1.5
--- pkgsrc/inputmethod/mozc-server/patches/patch-session_session__test.cc:1.4   Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-session_session__test.cc       Sat Feb 10 01:17:28 2024
@@ -1,71 +1,31 @@
-$NetBSD: patch-session_session__test.cc,v 1.4 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-session_session__test.cc,v 1.5 2024/02/10 01:17:28 ryoon Exp $
 
-* NetBSD support
-
---- session/session_test.cc.orig       2021-02-15 03:48:53.000000000 +0000
+--- session/session_test.cc.orig       2023-12-13 09:36:18.413874507 +0000
 +++ session/session_test.cc
-@@ -1974,11 +1974,11 @@ TEST_F(SessionTest, UpdatePreferences) {
+@@ -2011,7 +2011,7 @@ TEST_F(SessionTest, UpdatePreferences) {
    const size_t cascading_cand_size =
        command.output().candidates().candidate_size();
  
--#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_WASM
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_WASM || defined(OS_NETBSD)
-   EXPECT_EQ(no_cascading_cand_size, cascading_cand_size);
--#else   // defined(OS_LINUX) || defined(OS_ANDROID) || OS_WASM
-+#else   // defined(OS_LINUX) || defined(OS_ANDROID) || OS_WASM || defined(OS_NETBSD)
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
+   EXPECT_EQ(cascading_cand_size, no_cascading_cand_size);
+ #else   // __linux__ || __wasm__
    EXPECT_GT(no_cascading_cand_size, cascading_cand_size);
--#endif  // defined(OS_LINUX) || defined(OS_ANDROID) || OS_WASM
-+#endif  // defined(OS_LINUX) || defined(OS_ANDROID) || OS_WASM || defined(OS_NETBSD)
- 
-   command.Clear();
-   session->ConvertCancel(&command);
-@@ -2149,7 +2149,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
+@@ -2200,7 +2200,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
  
-     EXPECT_EQ(0, output.all_candidate_words().focused_index());
-     EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
+     EXPECT_EQ(output.all_candidate_words().focused_index(), 0);
+     EXPECT_EQ(output.all_candidate_words().category(), commands::CONVERSION);
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
      // Cascading window is not supported on Linux, so the size of
      // candidate words is different from other platform.
      // TODO(komatsu): Modify the client for Linux to explicitly change
-@@ -2159,13 +2159,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
-     //   "aiueo"  (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
-     //   "アイウエオ" (t13n) ]
-     EXPECT_EQ(9, output.all_candidate_words().candidates_size());
--#else   // OS_LINUX || OS_ANDROID || OS_WASM
-+#else   // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
-     // [ "あいうえお", "アイウエオ", "アイウエオ" (t13n), "あいうえお" (t13n),
-     //   "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
-     //   "aiueo"  (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
-     //   "アイウエオ" (t13n) ]
-     EXPECT_EQ(11, output.all_candidate_words().candidates_size());
--#endif  // OS_LINUX || OS_ANDROID || OS_WASM
-+#endif  // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
-   }
+@@ -2228,7 +2228,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
  
-   command.Clear();
-@@ -2177,7 +2177,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
- 
-     EXPECT_EQ(1, output.all_candidate_words().focused_index());
-     EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
+     EXPECT_EQ(output.all_candidate_words().focused_index(), 1);
+     EXPECT_EQ(output.all_candidate_words().category(), commands::CONVERSION);
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
      // Cascading window is not supported on Linux, so the size of
      // candidate words is different from other platform.
      // TODO(komatsu): Modify the client for Linux to explicitly change
-@@ -2187,13 +2187,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
-     //   "aiueo"  (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
-     //   "アイウエオ" (t13n) ]
-     EXPECT_EQ(9, output.all_candidate_words().candidates_size());
--#else   // OS_LINUX || OS_ANDROID || OS_WASM
-+#else   // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
-     // [ "あいうえお", "アイウエオ",
-     //   "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
-     //   "aiueo"  (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
-     //   "アイウエオ" (t13n) ]
-     EXPECT_EQ(11, output.all_candidate_words().candidates_size());
--#endif  // OS_LINUX || OS_ANDROID || OS_WASM
-+#endif  // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
-   }
- }
- 

Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_logging.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-base_logging.cc:1.6 pkgsrc/inputmethod/mozc-server/patches/patch-base_logging.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-base_logging.cc:1.6    Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_logging.cc        Sat Feb 10 01:17:27 2024
@@ -1,27 +1,17 @@
-$NetBSD: patch-base_logging.cc,v 1.6 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-base_logging.cc,v 1.7 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- base/logging.cc.orig       2021-02-15 05:04:33.000000000 +0000
+--- base/logging.cc.orig       2023-10-26 12:00:50.000000000 +0000
 +++ base/logging.cc
-@@ -62,6 +62,10 @@
- #include "absl/flags/flag.h"
- #include "absl/strings/str_cat.h"
- 
-+#if defined(OS_NETBSD)
-+#include <lwp.h>
-+#endif
-+
- ABSL_FLAG(bool, colored_log, true,
-           "Enables colored log messages on tty devices");
- ABSL_FLAG(bool, logtostderr, false,
-@@ -112,6 +116,9 @@ string Logging::GetLogMessageHeader() {
+@@ -114,10 +114,10 @@ std::string Logging::GetLogMessageHeader
+ #if defined(__wasm__)
+   return absl::StrCat(timestamp, ::getpid(), " ",
+                       static_cast<unsigned int>(pthread_self()));
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__NetBSD__)
    return absl::StrCat(timestamp, ::getpid(), " ",
                        // It returns unsigned long.
-                       pthread_self());
-+# elif defined(OS_NETBSD)
-+  return absl::StrCat(timestamp, ::getpid(), " ",
-+                      (unsigned long)_lwp_self());
- # elif defined(__APPLE__)
- #  ifdef __LP64__
+-                      pthread_self());
++                      (unsigned long)pthread_self());
+ #elif defined(__APPLE__)
+ #ifdef __LP64__
    return absl::StrCat(timestamp, ::getpid(), " ",
Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_process.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-base_process.cc:1.6 pkgsrc/inputmethod/mozc-server/patches/patch-base_process.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-base_process.cc:1.6    Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_process.cc        Sat Feb 10 01:17:27 2024
@@ -1,73 +1,28 @@
-$NetBSD: patch-base_process.cc,v 1.6 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-base_process.cc,v 1.7 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- base/process.cc.orig       2021-02-15 03:48:53.000000000 +0000
+--- base/process.cc.orig       2023-12-13 09:15:36.129469332 +0000
 +++ base/process.cc
-@@ -46,12 +46,12 @@
- #include "base/mac_process.h"
- #endif  // __APPLE__
- 
--#if defined(OS_LINUX) || defined(OS_ANDROID)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NETBSD)
- #include <fcntl.h>
- #include <signal.h>
- #include <spawn.h>  // for posix_spawn().
- #include <sys/types.h>
--#endif  // OS_LINUX || OS_ANDROID
-+#endif  // OS_LINUX || OS_ANDROID || OS_NETBSD
- 
- #include <cstdlib>
- #include <memory>
 @@ -98,12 +98,12 @@ bool Process::OpenBrowser(const std::str
-   return WinUtil::ShellExecuteInSystemDir(L"open", wurl.c_str(), nullptr);
- #endif
+       L"open", win32::Utf8ToWide(url).c_str(), nullptr);
+ #endif  // _WIN32
  
--#if defined(OS_LINUX) || defined(OS_ANDROID)
--  static const char kBrowserCommand[] = "/usr/bin/xdg-open";
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NETBSD)
-+  static const char kBrowserCommand[] = "@PREFIX@/bin/xdg-open";
+-#ifdef __linux__
++#if defined(__linux__) || defined(__NetBSD__)
+ 
+ #ifndef MOZC_BROWSER_COMMAND
    // xdg-open which uses kfmclient or gnome-open internally works both on KDE
    // and GNOME environments.
-   return SpawnProcess(kBrowserCommand, url);
--#endif  // OS_LINUX || OS_ANDROID
-+#endif  // OS_LINUX || OS_ANDROID || OS_NETBSD
+-#define MOZC_BROWSER_COMMAND "/usr/bin/xdg-open"
++#define MOZC_BROWSER_COMMAND "@PREFIX@/bin/xdg-open"
+ #endif  // MOZC_BROWSER_COMMAND
  
- #ifdef __APPLE__
-   return MacProcess::OpenBrowserForMac(url);
-@@ -185,7 +185,7 @@ bool Process::SpawnProcess(const std::st
+   return SpawnProcess(MOZC_BROWSER_COMMAND, url);
+@@ -387,7 +387,7 @@ bool Process::LaunchErrorMessageDialog(c
    }
- #endif
- 
--#if defined(OS_LINUX) || defined(OS_ANDROID)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NETBSD)
-   // Do not call posix_spawn() for obviously bad path.
-   if (!S_ISREG(statbuf.st_mode)) {
-     LOG(ERROR) << "Not a regular file: " << path;
-@@ -208,7 +208,7 @@ bool Process::SpawnProcess(const std::st
-   // (www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html)
-   const int kOverwrite = 0;  // Do not overwrite.
-   ::setenv("MALLOC_CHECK_", "2", kOverwrite);
--#endif  // OS_LINUX || OS_ANDROID
-+#endif  // OS_LINUX || OS_ANDROID || OS_NETBSD
-   pid_t tmp_pid = 0;
+ #endif  // _WIN32
  
-   // Spawn new process.
-@@ -383,7 +383,7 @@ bool Process::LaunchErrorMessageDialog(c
-   }
- #endif  // OS_WIN
- 
--#if defined(OS_LINUX) || defined(OS_ANDROID)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NETBSD)
-   const char kMozcTool[] = "mozc_tool";
+-#if defined(__linux__) && !defined(__ANDROID__)
++#if (defined(__linux__) || defined(__NetBSD__)) && !defined(__ANDROID__)
+   constexpr char kMozcTool[] = "mozc_tool";
    const std::string arg =
        "--mode=error_message_dialog --error_type=" + error_type;
-@@ -392,7 +392,7 @@ bool Process::LaunchErrorMessageDialog(c
-     LOG(ERROR) << "cannot launch " << kMozcTool;
-     return false;
-   }
--#endif  // OS_LINUX || OS_ANDROID
-+#endif  // OS_LINUX || OS_ANDROID || OS_NETBSD
- 
-   return true;
- }
Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util.cc:1.6 pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util.cc:1.6       Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util.cc   Sat Feb 10 01:17:27 2024
@@ -1,87 +1,62 @@
-$NetBSD: patch-base_system__util.cc,v 1.6 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-base_system__util.cc,v 1.7 2024/02/10 01:17:27 ryoon Exp $
 
---- base/system_util.cc.orig   2021-02-15 05:04:33.000000000 +0000
+--- base/system_util.cc.orig   2023-10-26 12:00:50.000000000 +0000
 +++ base/system_util.cc
-@@ -275,7 +275,7 @@ std::string UserProfileDirectoryImpl::Ge
- # endif  //  GOOGLE_JAPANESE_INPUT_BUILD
+@@ -278,7 +278,7 @@ std::string UserProfileDirectoryImpl::Ge
+   return FileUtil::JoinPath(dir, "Mozc");
+ #endif  //  GOOGLE_JAPANESE_INPUT_BUILD
  
- 
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_NETBSD)
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__NetBSD__)
    // 1. If "$HOME/.mozc" already exists,
    //    use "$HOME/.mozc" for backward compatibility.
    // 2. If $XDG_CONFIG_HOME is defined
-@@ -422,7 +422,7 @@ std::string SystemUtil::GetServerDirecto
+@@ -429,9 +429,9 @@ std::string SystemUtil::GetServerDirecto
    return MacUtil::GetServerDirectory();
  #endif  // __APPLE__
  
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
- # if defined(MOZC_SERVER_DIRECTORY)
-   return MOZC_SERVER_DIRECTORY;
- # else
-@@ -499,12 +499,12 @@ std::string SystemUtil::GetUserNameAsStr
-   return ppw->pw_name;
- #endif  // OS_ANDROID
- 
--#if defined(__APPLE__) || defined(OS_LINUX) || defined(OS_WASM)
-+#if defined(__APPLE__) || defined(OS_LINUX) || defined(OS_WASM) || defined(OS_NETBSD)
-   struct passwd pw, *ppw;
-   char buf[1024];
-   CHECK_EQ(0, getpwuid_r(geteuid(), &pw, buf, sizeof(buf), &ppw));
-   return pw.pw_name;
--#endif  // __APPLE__ || OS_LINUX || OS_WASM
-+#endif  // __APPLE__ || OS_LINUX || OS_WASM || OS_NETBSD
- 
-   // If none of the above platforms is specified, the compiler raises an error
-   // because of no return value.
-@@ -662,13 +662,13 @@ string GetSessionIdString() {
- #endif  // OS_WIN
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
+ #ifndef MOZC_SERVER_DIR
+-#define MOZC_SERVER_DIR "/usr/lib/mozc"
++#define MOZC_SERVER_DIR "@PREFIX@/libexec"
+ #endif  // MOZC_SERVER_DIR
+   return MOZC_SERVER_DIR;
+ #endif  // __linux__ || __wasm__
+@@ -471,7 +471,7 @@ std::string SystemUtil::GetDocumentDirec
+ #if defined(__linux__)
+ 
+ #ifndef MOZC_DOCUMENT_DIR
+-#define MOZC_DOCUMENT_DIR "/usr/lib/mozc/documents"
++#define MOZC_DOCUMENT_DIR "@PREFIX@/libexec/documents"
+ #endif  // MOZC_DOCUMENT_DIR
+   return MOZC_DOCUMENT_DIR;
+ 
+@@ -661,7 +661,7 @@ std::string GetSessionIdString() {
+ #endif  // _WIN32
  
  std::string SystemUtil::GetDesktopNameAsString() {
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
    const char *display = Environ::GetEnv("DISPLAY");
    if (display == nullptr) {
      return "";
-   }
-   return display;
--#endif  // OS_LINUX || OS_ANDROID || OS_WASM
-+#endif  // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
- 
- #if defined(__APPLE__)
-   return "";
-@@ -862,10 +862,13 @@ std::string SystemUtil::GetOSVersionStri
- #elif defined(OS_LINUX)
+@@ -834,6 +834,9 @@ std::string SystemUtil::GetOSVersionStri
+ #elif defined(__linux__)
    const std::string ret = "Linux";
    return ret;
--#else   // !OS_WIN && !__APPLE__ && !OS_LINUX
-+#elif defined(OS_NETBSD)
++#elif defined(__NetBSD__)
 +  const std::string ret = "NetBSD";
 +  return ret;
-+#else   // !OS_WIN && !__APPLE__ && !OS_LINUX && !OS_NETBSD
-   const string ret = "Unknown";
+ #else   // !_WIN32 && !__APPLE__ && !__linux__
+   const std::string ret = "Unknown";
    return ret;
--#endif  // OS_WIN, __APPLE__, OS_LINUX
-+#endif  // OS_WIN, __APPLE__, OS_LINUX, OS_NETBSD
- }
- 
- void SystemUtil::DisableIME() {
-@@ -901,7 +904,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
+@@ -873,7 +876,7 @@ uint64_t SystemUtil::GetTotalPhysicalMem
    return total_memory;
  #endif  // __APPLE__
  
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
- # if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
-   const int32 page_size = sysconf(_SC_PAGESIZE);
-   const int32 number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES);
-@@ -914,7 +917,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
- # else   // defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
-   return 0;
- # endif  // defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
--#endif   // OS_LINUX || OS_ANDROID || OS_WASM
-+#endif   // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
- 
-   // If none of the above platforms is specified, the compiler raises an error
-   // because of no return value.
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
+ #if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
+   const int32_t page_size = sysconf(_SC_PAGESIZE);
+   const int32_t number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES);
Index: pkgsrc/inputmethod/mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc:1.6 pkgsrc/inputmethod/mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc:1.6   Sun Dec 17 14:15:43 2017
+++ pkgsrc/inputmethod/mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc       Sat Feb 10 01:17:27 2024
@@ -1,15 +1,13 @@
-$NetBSD: patch-gui_dictionary__tool_dictionary__tool.cc,v 1.6 2017/12/17 14:15:43 tsutsui Exp $
+$NetBSD: patch-gui_dictionary__tool_dictionary__tool.cc,v 1.7 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- gui/dictionary_tool/dictionary_tool.cc.orig        2014-05-21 10:51:22.000000000 +0000
+--- gui/dictionary_tool/dictionary_tool.cc.orig        2023-12-13 09:38:40.198993431 +0000
 +++ gui/dictionary_tool/dictionary_tool.cc
-@@ -347,7 +347,7 @@ DictionaryTool::DictionaryTool(QWidget *
+@@ -369,7 +369,7 @@ DictionaryTool::DictionaryTool(QWidget *
  #endif  // !ENABLE_CLOUD_SYNC
  
    // main window
--#ifndef OS_LINUX
-+#if !defined(OS_LINUX) && !defined(OS_NETBSD)
+-#ifndef __linux__
++#if !defined(__linux__) && !defined(__NetBSD__)
    // For some reason setCentralWidget crashes the dictionary_tool on Linux
    // TODO(taku): investigate the cause of the crashes
    setCentralWidget(splitter_);
Index: pkgsrc/inputmethod/mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc:1.6 
pkgsrc/inputmethod/mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc:1.6       Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc   Sat Feb 10 01:17:28 2024
@@ -1,19 +1,13 @@
-$NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.6 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.7 2024/02/10 01:17:28 ryoon Exp $
 
-* NetBSD support
-* Fix from https://github.com/google/mozc/issues/460
-
---- gui/word_register_dialog/word_register_dialog.cc.orig      2021-02-15 03:48:53.000000000 +0000
+--- gui/word_register_dialog/word_register_dialog.cc.orig      2023-12-13 09:33:09.127301725 +0000
 +++ gui/word_register_dialog/word_register_dialog.cc
-@@ -97,9 +97,9 @@ QString GetEnv(const char *envname) {
+@@ -100,7 +100,7 @@ QString GetEnv(const char *envname) {
    }
    return QLatin1String("");
- #endif  // OS_WIN
--#if defined(__APPLE__) || defined(OS_LINUX)
-+#if defined(__APPLE__) || defined(OS_LINUX) || defined(OS_NETBSD)
+ #endif  // _WIN32
+-#if defined(__APPLE__) || defined(__linux__)
++#if defined(__APPLE__) || defined(__linux__) || defined(__NetBSD__)
    return QString::fromUtf8(::getenv(envname));
--#endif  // __APPLE__ or OS_LINUX
-+#endif  // __APPLE__ or OS_LINUX or OS_NETBSD
+ #endif  // __APPLE__ or __linux__
    // TODO(team): Support other platforms.
-   return QLatin1String("");
- }
Index: pkgsrc/inputmethod/mozc-server/patches/patch-ipc_ipc__path__manager.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-ipc_ipc__path__manager.cc:1.6 pkgsrc/inputmethod/mozc-server/patches/patch-ipc_ipc__path__manager.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-ipc_ipc__path__manager.cc:1.6  Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-ipc_ipc__path__manager.cc      Sat Feb 10 01:17:28 2024
@@ -1,42 +1,13 @@
-$NetBSD: patch-ipc_ipc__path__manager.cc,v 1.6 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-ipc_ipc__path__manager.cc,v 1.7 2024/02/10 01:17:28 ryoon Exp $
 
-* NetBSD support
-
---- ipc/ipc_path_manager.cc.orig       2021-02-15 03:48:53.000000000 +0000
+--- ipc/ipc_path_manager.cc.orig       2023-12-13 09:35:34.871003763 +0000
 +++ ipc/ipc_path_manager.cc
-@@ -53,6 +53,11 @@
+@@ -389,7 +389,7 @@ bool IPCPathManager::IsValidServer(uint3
+   server_pid_ = pid;
  #endif  // __APPLE__
- #endif  // OS_WIN
- 
-+#if defined(OS_NETBSD)
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#endif
-+
- #include <cstdlib>
- #include <map>
- #ifdef OS_WIN
-@@ -425,6 +430,23 @@ bool IPCPathManager::IsValidServer(uint3
-     return true;
-   }
  
-+#if defined(OS_NETBSD)
-+  int name[] = { CTL_KERN, KERN_PROC_ARGS, static_cast<int>(pid) };
-+  size_t data_len = 0;
-+  if (sysctl(name, arraysize(name), NULL,
-+             &data_len, NULL, 0) < 0) {
-+    LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
-+    return false;
-+  }
-+
-+  server_path_.resize(data_len);
-+  if (sysctl(name, arraysize(name), &server_path_[0],
-+             &data_len, NULL, 0) < 0) {
-+    LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
-+    return false;
-+  }
-+#endif // OS_NETBSD
-+
- #ifdef OS_LINUX
-   if ((server_path + " (deleted)") == server_path_) {
-     LOG(WARNING) << server_path << " on disk is modified";
+-#ifdef __linux__
++#if defined(__linux__) || defined(__NetBSD__)
+   // load from /proc/<pid>/exe
+   std::string proc = absl::StrFormat("/proc/%u/exe", pid);
+   char filename[512];
Index: pkgsrc/inputmethod/mozc-server/patches/patch-ipc_unix__ipc.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-ipc_unix__ipc.cc:1.6 pkgsrc/inputmethod/mozc-server/patches/patch-ipc_unix__ipc.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-ipc_unix__ipc.cc:1.6   Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-ipc_unix__ipc.cc       Sat Feb 10 01:17:28 2024
@@ -1,35 +1,29 @@
-$NetBSD: patch-ipc_unix__ipc.cc,v 1.6 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-ipc_unix__ipc.cc,v 1.7 2024/02/10 01:17:28 ryoon Exp $
 
-* NetBSD support
-
---- ipc/unix_ipc.cc.orig       2021-02-15 03:48:53.000000000 +0000
+--- ipc/unix_ipc.cc.orig       2023-10-26 12:00:50.000000000 +0000
 +++ ipc/unix_ipc.cc
 @@ -28,7 +28,7 @@
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
- // OS_LINUX only. Note that OS_ANDROID/OS_WASM don't reach here.
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_NETBSD)
+ // __linux__ only. Note that __ANDROID__/__wasm__ don't reach here.
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__NetBSD__)
  
- #include <arpa/inet.h>
  #include <fcntl.h>
-@@ -125,7 +125,7 @@ bool IsPeerValid(int socket, pid_t *pid)
-   // sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
-   // system call.
-   // TODO(yusukes): Add implementation for ARM Linux.
--#ifndef __arm__
-+#if !defined(__arm__) && !defined(OS_NETBSD)
+ #include <sys/select.h>
+@@ -119,6 +119,7 @@ bool IsWriteTimeout(int socket, absl::Du
+ bool IsPeerValid(int socket, pid_t *pid) {
+   *pid = 0;
+ 
++#if defined(__linux__)
    struct ucred peer_cred;
    int peer_cred_len = sizeof(peer_cred);
-   if (getsockopt(socket, SOL_SOCKET, SO_PEERCRED,
-@@ -141,7 +141,23 @@ bool IsPeerValid(int socket, pid_t *pid)
+   if (getsockopt(socket, SOL_SOCKET, SO_PEERCRED, &peer_cred,
+@@ -133,7 +134,21 @@ bool IsPeerValid(int socket, pid_t *pid)
    }
  
    *pid = peer_cred.pid;
--#endif  // __arm__
-+#endif  // __arm__ || OS_NETBSD
-+
-+#if defined(OS_NETBSD)
++#elif defined(__NetBSD__)
 +  struct unpcbid peer_cred;
 +  int peer_cred_len = sizeof(peer_cred);
 +  if (getsockopt(socket, 0, LOCAL_PEEREID,
@@ -38,18 +32,12 @@ $NetBSD: patch-ipc_unix__ipc.cc,v 1.6 20
 +    LOG(ERROR) << "cannot get peer credential. Not a Unix socket?";
 +    return false;
 +  }
-+
+ 
 +  if (peer_cred.unp_euid!= ::geteuid()) {
 +    LOG(WARNING) << "uid mismatch." << peer_cred.unp_euid << "!=" << ::geteuid();
 +    return false;
 +  }
 +#endif
- 
    return true;
  }
-@@ -468,4 +484,4 @@ void IPCServer::Terminate() { server_thr
- 
- }  // namespace mozc
  
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_NETBSD
Index: pkgsrc/inputmethod/mozc-server/patches/patch-session_session.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-session_session.cc:1.6 pkgsrc/inputmethod/mozc-server/patches/patch-session_session.cc:1.7
--- pkgsrc/inputmethod/mozc-server/patches/patch-session_session.cc:1.6 Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-session_session.cc     Sat Feb 10 01:17:28 2024
@@ -1,36 +1,22 @@
-$NetBSD: patch-session_session.cc,v 1.6 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-session_session.cc,v 1.7 2024/02/10 01:17:28 ryoon Exp $
 
-* NetBSD support
-
---- session/session.cc.orig    2021-02-15 03:48:53.000000000 +0000
+--- session/session.cc.orig    2023-12-13 09:32:05.846503615 +0000
 +++ session/session.cc
-@@ -230,9 +230,9 @@ void Session::InitContext(ImeContext *co
-   context->SetConfig(&context->GetConfig());
- 
- #if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_LINUX) || \
--    defined(OS_WASM)
-+    defined(OS_WASM) || defined(OS_NETBSD)
+@@ -241,7 +241,7 @@ void Session::InitContext(ImeContext *co
+   // Tests for session layer (session_handler_scenario_test, etc) can be
+   // unstable.
+ #if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || defined(__linux__) || \
+-    defined(__wasm__)
++    defined(__wasm__) || defined(__NetBSD__)
    context->mutable_converter()->set_use_cascading_window(false);
--#endif  // OS_ANDROID || OS_IOS || OS_LINUX || OS_WASM
-+#endif  // OS_ANDROID || OS_IOS || OS_LINUX || OS_WASM || OS_NETBSD
+ #endif  // TARGET_OS_IPHONE || __linux__ || __wasm__
  }
- 
- void Session::PushUndoContext() {
-@@ -964,14 +964,14 @@ void Session::UpdatePreferences(commands
+@@ -973,7 +973,7 @@ void Session::UpdatePreferences(commands
    }
  
- #if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_LINUX) || \
--    defined(OS_WASM)
-+    defined(OS_WASM) || defined(OS_NETBSD)
+ #if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || defined(__linux__) || \
+-    defined(__wasm__)
++    defined(__wasm__) || defined(__NetBSD__)
    context_->mutable_converter()->set_use_cascading_window(false);
--#else   // OS_LINUX || OS_ANDROID || OS_WASM
-+#else   // OS_LINUX || OS_ANDROID || OS_WASM || OS_NETBSD
+ #else   // TARGET_OS_IPHONE || __linux__ || __wasm__
    if (config.has_use_cascading_window()) {
-     context_->mutable_converter()->set_use_cascading_window(
-         config.use_cascading_window());
-   }
--#endif  // OS_ANDROID || OS_IOS || OS_LINUX || OS_WASM
-+#endif  // OS_ANDROID || OS_IOS || OS_LINUX || OS_WASM || OS_NETBSD
- }
- 
- bool Session::IMEOn(commands::Command *command) {

Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_password__manager.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-base_password__manager.cc:1.5 pkgsrc/inputmethod/mozc-server/patches/patch-base_password__manager.cc:1.6
--- pkgsrc/inputmethod/mozc-server/patches/patch-base_password__manager.cc:1.5  Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_password__manager.cc      Sat Feb 10 01:17:27 2024
@@ -1,15 +1,13 @@
-$NetBSD: patch-base_password__manager.cc,v 1.5 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-base_password__manager.cc,v 1.6 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- base/password_manager.cc.orig      2021-02-15 03:48:53.000000000 +0000
+--- base/password_manager.cc.orig      2023-10-26 12:00:50.000000000 +0000
 +++ base/password_manager.cc
-@@ -264,7 +264,7 @@ bool WinMacPasswordManager::RemovePasswo
+@@ -265,7 +265,7 @@ bool WinMacPasswordManager::RemovePasswo
  // We use plain text file for password storage on Linux. If you port this module
  // to other Linux distro, you might want to implement a new password manager
  // which adopts some secure mechanism such like gnome-keyring.
--#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
+-#if defined(__linux__) || defined(__wasm__)
++#if defined(__linux__) || defined(__wasm__) || defined(__NetBSD__)
  typedef PlainPasswordManager DefaultPasswordManager;
- #endif  // OS_LINUX || OS_ANDROID || OS_WASM
+ #endif  // __linux__ || __wasm__
  
Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_port.h
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-base_port.h:1.5 pkgsrc/inputmethod/mozc-server/patches/patch-base_port.h:1.6
--- pkgsrc/inputmethod/mozc-server/patches/patch-base_port.h:1.5        Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_port.h    Sat Feb 10 01:17:27 2024
@@ -1,15 +1,21 @@
-$NetBSD: patch-base_port.h,v 1.5 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-base_port.h,v 1.6 2024/02/10 01:17:27 ryoon Exp $
 
---- base/port.h.orig   2021-02-15 05:04:33.000000000 +0000
+--- base/port.h.orig   2023-10-26 12:00:50.000000000 +0000
 +++ base/port.h
-@@ -69,6 +69,10 @@ using std::string;
- #define MOZC_OS_DEFINED
- #endif  // OS_WASM
+@@ -45,6 +45,7 @@ enum class PlatformType {
+   kIPhone,    // Darwin-based firmware, devices, or simulator
+   kWASM,      // WASM
+   kChromeOS,  // ChromeOS
++  kNetBSD,    // NetBSD
+ };
  
-+#ifdef OS_NETBSD
-+#define MOZC_OS_DEFINED
-+#endif  // OS_NETBSD
-+
- #ifndef MOZC_OS_DEFINED
- #error "OS_XXX (e.g., OS_WIN) must be defined."
- #endif  // !MOZC_OS_DEFINED
+ // kTargetPlatform is the current build target platform.
+@@ -68,6 +69,8 @@ inline constexpr PlatformType kTargetPla
+ #endif                   // !TARGET_OS_IPHONE
+ #elif defined(__wasm__)  // __APPLE__
+ inline constexpr PlatformType kTargetPlatform = PlatformType::kWASM;
++#elif defined(__NetBSD__)
++inline constexpr PlatformType kTargetPlatform = PlatformType::kNetBSD;
+ #else                    // __wasm__
+ #error "Unsupported target platform."
+ #endif  // !__wasm__

Index: pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl:1.1 pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl:1.2
--- pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl:1.1 Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-config.bzl     Sat Feb 10 01:17:27 2024
@@ -1,19 +1,29 @@
-$NetBSD: patch-config.bzl,v 1.1 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-config.bzl,v 1.2 2024/02/10 01:17:27 ryoon Exp $
 
-* For pkgsrc layout.
-
---- config.bzl.orig    2021-02-15 05:04:34.000000000 +0000
+--- config.bzl.orig    2023-12-14 11:23:07.849816899 +0000
 +++ config.bzl
-@@ -30,9 +30,9 @@
+@@ -35,16 +35,16 @@
  
  BRANDING = "Mozc"
  
--LINUX_MOZC_SERVER_DIRECTORY = "/usr/lib/mozc"
--IBUS_MOZC_ICON_PATH = "/usr/share/ibus-mozc/product_icon.png"
+-LINUX_MOZC_BROWSER_COMMAND = "/usr/bin/xdg-open"
+-LINUX_MOZC_ICONS_DIR = "/usr/share/icons/mozc"
+-LINUX_MOZC_SERVER_DIR = "/usr/lib/mozc"
++LINUX_MOZC_BROWSER_COMMAND = "@PREFIX@/bin/xdg-open"
++LINUX_MOZC_ICONS_DIR = "@PREFIX@/share/icons/mozc"
++LINUX_MOZC_SERVER_DIR = "@PREFIX@/libexec"
+ LINUX_MOZC_DOCUMENT_DIR = LINUX_MOZC_SERVER_DIR + "/documents"
+-IBUS_COMPONENT_DIR = "/usr/share/ibus/component"
+-IBUS_MOZC_INSTALL_DIR = "/usr/share/ibus-mozc"
++IBUS_COMPONENT_DIR = "@PREFIX@/share/ibus/component"
++IBUS_MOZC_INSTALL_DIR = "@PREFIX@/share/ibus-mozc"
+ IBUS_MOZC_ICON_PATH = IBUS_MOZC_INSTALL_DIR + "/product_icon.png"
 -IBUS_MOZC_PATH = "/usr/lib/ibus-mozc/ibus-engine-mozc"
-+LINUX_MOZC_SERVER_DIRECTORY = "@PREFIX@/libexec"
-+IBUS_MOZC_ICON_PATH = "@PREFIX@/share/ibus-mozc/product_icon.png"
+-EMACS_MOZC_CLIENT_DIR = "/usr/share/emacs/site-lisp/emacs-mozc"
+-EMACS_MOZC_HELPER_DIR = "/usr/bin"
 +IBUS_MOZC_PATH = "@PREFIX@/libexec/ibus-engine-mozc"
++EMACS_MOZC_CLIENT_DIR = "@PREFIX@/share/emacs/site-lisp/emacs-mozc"
++EMACS_MOZC_HELPER_DIR = "@PREFIX@/bin"
  
  MACOS_BUNDLE_ID_PREFIX = "org.mozc.inputmethod.Japanese"
- MACOS_MIN_OS_VER = "10.12"
+ MACOS_MIN_OS_VER = "11.0"

Index: pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
diff -u pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_config__dialog.cc:1.7 pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_config__dialog.cc:1.8
--- pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_config__dialog.cc:1.7       Mon Feb 15 14:50:23 2021
+++ pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_config__dialog.cc   Sat Feb 10 01:17:27 2024
@@ -1,50 +1,31 @@
-$NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.7 2021/02/15 14:50:23 ryoon Exp $
+$NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.8 2024/02/10 01:17:27 ryoon Exp $
 
-* NetBSD support
-
---- gui/config_dialog/config_dialog.cc.orig    2021-02-15 03:48:53.000000000 +0000
+--- gui/config_dialog/config_dialog.cc.orig    2023-12-13 09:33:40.403986822 +0000
 +++ gui/config_dialog/config_dialog.cc
-@@ -104,21 +104,21 @@ ConfigDialog::ConfigDialog()
+@@ -105,7 +105,7 @@ ConfigDialog::ConfigDialog()
    setWindowTitle(tr("%1 Preferences").arg(GuiUtil::ProductName()));
  #endif  // __APPLE__
  
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_NETBSD)
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__NetBSD__)
    miscDefaultIMEWidget->setVisible(false);
    miscAdministrationWidget->setVisible(false);
    miscStartupWidget->setVisible(false);
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_NETBSD
- 
- #ifdef MOZC_NO_LOGGING
+@@ -115,7 +115,7 @@ ConfigDialog::ConfigDialog()
    // disable logging options
    miscLoggingWidget->setVisible(false);
  
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_NETBSD)
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__NetBSD__)
    // The last "misc" tab has no valid configs on Linux
-   const int kMiscTabIndex = 6;
+   constexpr int kMiscTabIndex = 6;
    configDialogTabWidget->removeTab(kMiscTabIndex);
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_NETBSD
- #endif  // MOZC_NO_LOGGING
- 
-   suggestionsSizeSpinBox->setRange(1, 9);
-@@ -280,7 +280,7 @@ ConfigDialog::ConfigDialog()
+@@ -281,7 +281,7 @@ ConfigDialog::ConfigDialog()
    dictionaryPreloadingAndUACLabel->setVisible(false);
- #endif  // OS_WIN
+ #endif  // _WIN32
  
--#ifdef OS_LINUX
-+#if defined(OS_LINUX) || defined(OS_NETBSD)
+-#ifdef __linux__
++#if defined(__linux__) || defined(__NetBSD__)
    // On Linux, disable all fields for UsageStats
    usageStatsLabel->setEnabled(false);
    usageStatsLabel->setVisible(false);
-@@ -290,7 +290,7 @@ ConfigDialog::ConfigDialog()
-   usageStatsMessage->setVisible(false);
-   usageStatsCheckBox->setEnabled(false);
-   usageStatsCheckBox->setVisible(false);
--#endif  // OS_LINUX
-+#endif  // OS_LINUX || OS_NETBSD
- 
-   GuiUtil::ReplaceWidgetLabels(this);
- 

Index: pkgsrc/inputmethod/mozc-tool/Makefile
diff -u pkgsrc/inputmethod/mozc-tool/Makefile:1.86 pkgsrc/inputmethod/mozc-tool/Makefile:1.87
--- pkgsrc/inputmethod/mozc-tool/Makefile:1.86  Mon Jan  1 16:05:23 2024
+++ pkgsrc/inputmethod/mozc-tool/Makefile       Sat Feb 10 01:17:29 2024
@@ -1,22 +1,25 @@
-# $NetBSD: Makefile,v 1.86 2024/01/01 16:05:23 ryoon Exp $
+# $NetBSD: Makefile,v 1.87 2024/02/10 01:17:29 ryoon Exp $
 
 PKGNAME=       ${DISTNAME:S/mozc-/mozc-tool-/}
-PKGREVISION=   25
 
 INSTALLATION_DIRS+=    libexec
 
-ALL_ENV+=      qt_dir=${QTDIR}
-
-pre-configure:
-       ${RM} ${WRKSRC}/unix/uim/uim.gyp
-
 do-build:
        cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
-               ${PYTHONBIN} build_mozc.py build -c ${MOZC_BUILD_MODE} \
-                       gui/gui.gyp:mozc_tool
+               ${PREFIX}/bin/bazel \
+                       --output_user_root=${WRKDIR}/bazel \
+                       --client_debug \
+                       build \
+                       gui/tool:mozc_tool \
+                       --subcommands \
+                       --host_action_env=PATH=${PATH} \
+                       --action_env=PATH=${PATH} \
+                       --sandbox_debug \
+                       --verbose_failures \
+                       --config oss_linux --compilation_mode opt
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/out_${OSDEST}/${MOZC_BUILD_MODE}/mozc_tool \
+       ${INSTALL_PROGRAM} ${WRKSRC}/bazel-out/${OSDEST}//bin/gui/tool/mozc_tool \
                ${DESTDIR}${PREFIX}/libexec
 
 .include "../../inputmethod/mozc-server/Makefile.common"

Added files:

Index: pkgsrc/inputmethod/mozc-server/patches/patch-WORKSPACE.bazel
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-WORKSPACE.bazel:1.1
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-WORKSPACE.bazel        Sat Feb 10 01:17:27 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-WORKSPACE.bazel,v 1.1 2024/02/10 01:17:27 ryoon Exp $
+
+--- WORKSPACE.bazel.orig       2023-10-26 12:00:50.000000000 +0000
++++ WORKSPACE.bazel
+@@ -118,7 +128,7 @@ new_local_repository(
+ # Qt for Linux
+ pkg_config_repository(
+   name = "qt_linux",
+-  packages = ["Qt6Core", "Qt6Gui", "Qt6Widgets"],
++  packages = ["Qt6Core", "Qt6Gui", "Qt6Widgets", "Qt6OpenGL", "gl"],
+ )
+ 
+ # Qt for macOS
Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_file_recursive.cc
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-base_file_recursive.cc:1.1
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_file_recursive.cc Sat Feb 10 01:17:27 2024
@@ -0,0 +1,14 @@
+$NetBSD: patch-base_file_recursive.cc,v 1.1 2024/02/10 01:17:27 ryoon Exp $
+
+--- base/file/recursive.cc.orig        2023-10-26 12:00:50.000000000 +0000
++++ base/file/recursive.cc
+@@ -105,7 +105,8 @@ void UnlinkFileOrLog(const char *path) {
+ }  // namespace
+ 
+ #if (defined(__linux__) && !defined(__ANDROID__)) || \
+-    (defined(TARGET_OS_OSX) && TARGET_OS_OSX)
++    (defined(TARGET_OS_OSX) && TARGET_OS_OSX) || \
++    defined(__NetBSD__)
+ 
+ absl::Status DeleteRecursively(const zstring_view path) {
+   // fts is not POSIX, but it's available on both Linux and MacOS.
Index: pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util__test.cc
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util__test.cc:1.1
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-base_system__util__test.cc     Sat Feb 10 01:17:27 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-base_system__util__test.cc,v 1.1 2024/02/10 01:17:27 ryoon Exp $
+
+--- base/system_util_test.cc.orig      2023-12-13 09:25:13.483600855 +0000
++++ base/system_util_test.cc
+@@ -59,7 +59,7 @@ TEST_F(SystemUtilTest, GetUserProfileDir
+ #elif defined(__APPLE__)
+   // TODO(komatsu): write a test.
+ 
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__NetBSD__)
+   EnvironMock environ_mock;
+   FileUtilMock file_util_mock;
+   SystemUtil::SetUserProfileDirectory("");
Index: pkgsrc/inputmethod/mozc-server/patches/patch-bazel_pkg__config__repository.bzl
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-bazel_pkg__config__repository.bzl:1.1
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-bazel_pkg__config__repository.bzl      Sat Feb 10 01:17:27 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-bazel_pkg__config__repository.bzl,v 1.1 2024/02/10 01:17:27 ryoon Exp $
+
+--- bazel/pkg_config_repository.bzl.orig       2023-12-14 08:51:15.941327119 +0000
++++ bazel/pkg_config_repository.bzl
+@@ -103,7 +103,7 @@ def _pkg_config_repository_impl(repo_ctx
+         "hdrs": _make_strlist([item + "/**" for item in includes]),
+         "copts": _make_strlist(_exec_pkg_config(repo_ctx, "--cflags-only-other")),
+         "includes": _make_strlist(includes),
+-        "linkopts": _make_strlist(_exec_pkg_config(repo_ctx, "--libs-only-l")),
++        "linkopts": _make_strlist(_exec_pkg_config(repo_ctx, "--libs")),
+     }
+     build_file_data = BUILD_TEMPLATE.format(**data)
+ 
Index: pkgsrc/inputmethod/mozc-server/patches/patch-session_session__handler__scenario__test.cc
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-session_session__handler__scenario__test.cc:1.1
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-session_session__handler__scenario__test.cc    Sat Feb 10 01:17:28 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-session_session__handler__scenario__test.cc,v 1.1 2024/02/10 01:17:28 ryoon Exp $
+
+--- session/session_handler_scenario_test.cc.orig      2023-12-13 09:39:32.677437804 +0000
++++ session/session_handler_scenario_test.cc
+@@ -172,7 +172,7 @@ const char *kUsageStatsScenarioFileList[
+     DATA_DIR "select_minor_prediction.txt",
+     DATA_DIR "select_prediction.txt",
+     DATA_DIR "select_t13n_by_key.txt",
+-#ifndef __linux__
++#if !defined(__linux__) && !defined(__NetBSD__)
+     // This test requires cascading window.
+     // TODO(hsumita): Removes this ifndef block.
+     DATA_DIR "select_t13n_on_cascading_window.txt",
Index: pkgsrc/inputmethod/mozc-server/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc:1.1
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc     Sat Feb 10 01:17:28 2024
@@ -0,0 +1,14 @@
+$NetBSD: patch-third__party_abseil-cpp_absl_base_internal_raw__logging.cc,v 1.1 2024/02/10 01:17:28 ryoon Exp $
+
+--- third_party/abseil-cpp/absl/base/internal/raw_logging.cc.orig      2023-12-13 09:40:20.988739236 +0000
++++ third_party/abseil-cpp/absl/base/internal/raw_logging.cc
+@@ -39,7 +39,8 @@
+ // this, consider moving both to config.h instead.
+ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+     defined(__Fuchsia__) || defined(__native_client__) ||               \
+-    defined(__OpenBSD__) || defined(__EMSCRIPTEN__) || defined(__ASYLO__)
++    defined(__OpenBSD__) || defined(__EMSCRIPTEN__) || defined(__ASYLO__) || \
++    defined(__NetBSD__)
+ 
+ #include <unistd.h>
+ 
Index: pkgsrc/inputmethod/mozc-server/patches/patch-third__party_protobuf_toolchain_cc__toolchain__config.bzl
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-third__party_protobuf_toolchain_cc__toolchain__config.bzl:1.1
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-third__party_protobuf_toolchain_cc__toolchain__config.bzl      Sat Feb 10 01:17:28 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-third__party_protobuf_toolchain_cc__toolchain__config.bzl,v 1.1 2024/02/10 01:17:28 ryoon Exp $
+
+--- third_party/protobuf/toolchain/cc_toolchain_config.bzl.orig        2023-12-13 11:45:04.226274104 +0000
++++ third_party/protobuf/toolchain/cc_toolchain_config.bzl
+@@ -206,7 +206,7 @@ def _impl(ctx):
+         cxx_builtin_include_directories = [
+             ctx.attr.sysroot,
+             ctx.attr.extra_include,
+-            "/usr/local/include",
++            "@PREFIX@/include",
+             "/usr/local/lib/clang",
+         ],
+         features = features,

Index: pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keymap__editor.cc
diff -u /dev/null pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keymap__editor.cc:1.4
--- /dev/null   Sat Feb 10 01:17:29 2024
+++ pkgsrc/inputmethod/mozc-server/patches/patch-gui_config__dialog_keymap__editor.cc   Sat Feb 10 01:17:27 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-gui_config__dialog_keymap__editor.cc,v 1.4 2024/02/10 01:17:27 ryoon Exp $
+
+--- gui/config_dialog/keymap_editor.cc.orig    2023-12-13 09:38:10.376387232 +0000
++++ gui/config_dialog/keymap_editor.cc
+@@ -441,7 +441,7 @@ bool KeyMapEditorDialog::Update() {
+   absl::StrAppend(keymap_table, invisible_keymap_table_);
+ 
+   if (new_direct_mode_commands != direct_mode_commands_) {
+-#if defined(_WIN32) || defined(__linux__)
++#if defined(_WIN32) || defined(__linux__) || defined(__NetBSD__)
+     QMessageBox::information(
+         this, windowTitle(),
+         tr("Changes of keymaps for direct input mode will apply only to "



Home | Main Index | Thread Index | Old Index