Compiling librime, librime-lua, and ibus-rime from Source on Debian-Based Systems

Distribution-provided packages for ibus-rime frequently lag behind upstream releases, shipping with outdated versions of the core librime engine. This version mismatch prevents access to recent algorithmic improvements and breaks compatibility with modern Lua-based extensions used in contemporary Rime configurations. Compiling the stack from source resolves these dependency bottlenecks and enables full feature utilization on Linux desktops.

Environment Preparation

Remove conflicting repository packages before proceeding with source compilation to prevent library path collisions.

sudo apt-get remove --purge -y ibus-rime librime-data librime1
sudo apt-get autoremove -y

Install the required build toolchain and development headers. The build system requires CMake 3.25 or newer, alongside Boost, Google Glog, LevelDB, Marisa, OpenCC, and IBus development files.

sudo apt-get update
sudo apt-get install -y build-essential git \
    libboost-all-dev libgoogle-glog-dev libgtest-dev \
    libyaml-cpp-dev libleveldb-dev libmarisa-dev \
    libz-dev libopencc-dev libibus-1.0-dev libnotify-dev

Verify the CMake version. If the distribution package is below the required threshold, install a newer binary release directly:

cmake --version
# Fetch and deploy a standalone release if necessary
WORK_DIR=$(mktemp -d)
cd "$WORK_DIR"
wget -q https://github.com/Kitware/CMake/releases/download/v3.29.4/cmake-3.29.4-linux-x86_64.sh
chmod +x cmake-*.sh
sudo ./cmake-*.sh --skip-license --prefix=/usr/local
hash -r
rm -rf "$WORK_DIR"

Source Retrieval

Clone the ibus-rime repository and initialize its embedded submodules (librime and plum).

git clone --recursive https://github.com/rime/ibus-rime.git
cd ibus-rime

Compiling librime with Lua Support

Navigate to the librime submodule directory. Switch to the primary development branch to ensure access to the latest API changes required by Lua plugins.

cd librime
git checkout master
git pull origin master

Fetch and integrate the librime-lua extension. The upstream repository provides a helper script to manage plugin dependencies.

bash install-plugins.sh hchunhui/librime-lua
make merged-plugins -j$(nproc)

Build and install the core library system-wide.

make -j$(nproc)
sudo make install
cd ..

Building plum (Rime Package Manager)

The plum utility handles schema deployment and configuration management. Compile it from its submodule directory.

cd plum
make -j$(nproc)
sudo make install
cd ..

Compiling ibus-rime

With the core engine and package manager in place, build the IBus frontend module.

make -j$(nproc)
sudo make install

After installation, restart the IBus daemon or log out and back into the desktop session to register the new input method engine.

ibus restart

Deploying Configurations via plum

The rime-install executable (provided by plum) streamlines configuration deployment by fetching remote repositories and applying recipe files. Recipes define file mapings for dictionaries, Lua scripts, and schema definitions.

To deploy a complete configuration set, execute:

rime-install <repository_owner>/<repository_name>:<path_to_recipe>

By default, plum targets platform-specific directories (~/.config/ibus/rime on Linux). To override the target path—for instance, when configuring Fcitx5 alongside IBus—export the target variable before execution:

TARGET_RIME_PATH="$HOME/.local/share/fcitx5/rime" rime-install <repository_owner>/<repository_name>:plum/full

The recipe parser resolves glob patterns (e.g., lua/*.lua, *.schema.yaml) and copies matching assets into the target directory. Existing *.custom.yaml overrides remain untouched during updates, preserving user modifications while refreshing upstream dictionaries and scripts.

Tags: Linux rime ibus CMake input-method

Posted on Tue, 12 May 2026 23:23:34 +0000 by ollmorris