Mozc is an open-source counterpart of Google Japanese Input, a Japanese input method developed by Google.

Setup build environment

$ sw_vers
ProductName:	macOS
ProductVersion:	12.2.1
BuildVersion:	21D62

$ xcodebuild -version
Xcode 13.3
Build version 13E113
# Install dependencies
brew install python3 ninja qt@5

# Clone the repository
git clone -b master --single-branch --recursive

Build mozc

# Move to the source directory
cd mozc/src

# Expose necessary variable
MAC_SDK=$(xcodebuild -showsdks 2>/dev/null | grep '\tmacOS' | awk '{print $2}')
MAC_DEPLOYMENT_TARGET=$(sw_vers -productVersion | sed -E 's/\.[^.]+$//')
export GYP_DEFINES="mac_sdk=${MAC_SDK} mac_deployment_target=${MAC_DEPLOYMENT_TARGET}"

# Apply hotfix to third party libs
cd third_party
git clone
export PATH="$PATH:$PWD/depot_tools"
python3 -m pip install six
cd gyp
git apply ../../gyp/gyp.patch
cd ../..

# Configure
python3 gyp --qtdir=/usr/local/opt/qt@5

# Build main converter and GUI tools
python3 build -c Release mac/mac.gyp:GoogleJapaneseInput gui/gui.gyp:config_dialog_main

# Install
sudo cp -r out_mac/Release/ /Library/Input\ Methods/
sudo cp mac/installer/LaunchAgents/org.mozc.inputmethod.Japanese.Converter.plist /Library/LaunchAgents
sudo cp mac/installer/LaunchAgents/org.mozc.inputmethod.Japanese.Renderer.plist /Library/LaunchAgents

# Clean up the tree
python3 clean