Porting IBus-Rime to Slackware
- Posted:
2025-03-28
Rime is an input method engine for entering Chinese characters, supporting a wide range of input methods; The Rime engine itself does not provide a frontend for receiving user input. It must be used with an input method framework such as Fcitx5 or IBus [1]. That comes ibus-rime, which is the frontend of IBus. I have been using it for years on Gentoo.
However, when it comes to Slackware, it seems that neither Slackware nor Rime is popular among Chinese Linux users, as I found no one had ported it to Slackware. Therefore, I decided to port it myself, and then submit it to SlackBuilds.org to share my work with other Slackware users.
Creating a Working Directory
The working directory is where all the relevant files (mentioned in the below section) should be placed:
$ mkdir ibus-rime $ cd ibus-rime
Obtaining the Source Code
Before starting to build ibus-rime, the source code should be ready on the local system, which can be downloaded from Github, using the following URL:
$ wget https://github.com/rime/ibus-rime/archive/1.5.1/ibus-rime-1.5.1.tar.gz
Writing a Slack-Desc File
A slack-desc file is used to describe the program/application, and it can include relevant links or instructions, with the maximum length of 11 lines. There is a command-line tool, slackdesc, that automates the creation of a slack-desc file.
Use the tool slackdesc to generate a slack-desc file for ibus-rime:
$ slackdesc "ibus-rime" "Rime Input Method Engine for IBus" "Rime Input Method Engine for Ibus - Rime is a modular, extensible input method engine, Covering features found in a large variety of Chinese input methods, either shape-based or phonetic-based." "https://github.com/rime/ibus-rime"
Writing a SlackBuild Script
A SlackBuild script is used to automate the compiling and packaging of the program/applicaton from source. There are some pre-written templates offered by SlackBuilds.org to start with.
For ibus-rime, which uses the CMake build system, the SlackBuild script can be based on cmake-template.SlackBuild, with the following key modifications:
mkdir -p build cd build cmake \ -DRIME_DATA_DIR=/usr/share/rime-data \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release .. make make install/strip DESTDIR=$PKG cd ..
Writing Other Necessary Files
There are two more necessary files required by SlackBuilds.org [2]:
$PRGNAM.info (i.e., ibus-rime.info): it provides essential information about the program/application, such as the download URL of the source code, a list of dependencies, and details about the maintainer.
README: it is similar to a slack-desc file, but it is more flexible, allowing to add as many details as needed, such as special configurations after installation, or incompatibilities with any other packages.
Executing the SlackBuild Script
If the SlackBuild script works well, it will generate a package file. Otherwise, if the script exits with errors, keep fixing the issues by modifying the SlackBuild script and running it again:
$ ./ibus-rime.SlackBuild
Packing all relevant Files
Once a descired package file has been built, it is time to prepare for the submission by gathering all relevant files into a compressed tarball:
$ tar zcvf ibus-rime.tar.gz slack-desc ibus-rime.SlackBuild ibus-rime.info README
Linting all relevant Files
To make it easy to review package submissions from the community users around the world, SlackBuilds.org provides some useful lint tools.
It is suggested to run it on the local system before making a package submission:
$ sbolint ibus-rime.tar.gz $ sbopkglint /tmp/ibus-rime-1.5.1-x86_64-1_SBo.tgz
Submitting to SlackBuilds.org
Since everything has done well, I made a submission request to SlackBuilds.org through SlackBuild Upload Form.

Thanks for reading :)