Difference between revisions of "Compiling fcitx5"

From Fcitx
Jump to navigation Jump to search
(Sketch intro)
 
(Add content)
Line 1: Line 1:
While fcitx5 is readily available in many official package repositories, some GNU/Linux distributions (such as Gentoo) don't officially provide it as of May 2020. This article aims to give general instructions on how to compile and install fcitx5 in your GNU/Linux system.
+
'''(This article is a work in progress)'''
  
''(Work in Progress)''
+
While fcitx5 is provided as a package in many distributions, some GNU/Linux distributions (such as Gentoo) don't officially provide it as of May 2020. This article aims to give general instructions on how to compile and install fcitx5 in your GNU/Linux system.
 +
 
 +
== Dependencies ==
 +
* C Compiler
 +
* C++ Compiler
 +
* [https://en.wikipedia.org/wiki/CMake CMake]
 +
* ECM (Extra CMake Modules)
 +
* GNU Make
 +
* libxcb ([https://xcb.freedesktop.org/ X protocol C-language Binding])
 +
* [https://libexpat.github.io/ Expat]
 +
* [https://www.freedesktop.org/wiki/Software/pkg-config/ PkgConfig]
 +
* [https://github.com/json-c/json-c/wiki json-c]
 +
* dbus
 +
* cldr-emoji-annotation*
 +
 
 +
Note that most of these packages are usually provided by many distributions. cldr-emoji-annotation is a special case and will be covered in the next section.
 +
 
 +
== Building process ==
 +
=== xcb-imdkit ===
 +
After installing all the dependencies, the first thing to do is install xcb-imdkit, an implementation of the X Input Method in XCB. Clone the [https://github.com/fcitx/xcb-imdkit GitHub repository]:
 +
git clone https://github.com/fcitx/xcb-imdkit.git
 +
<code>cd</code> into the Git directory and run cmake:
 +
cmake .
 +
To install it to a custom directory, set the <code>CMAKE_INSTALL_PREFIX</code> flag:
 +
cmake -DCMAKE_INSTALL_PREFIX=/your/install/path .
 +
Then simply run <code>make</code> and <code>make install</code>.
 +
 
 +
=== cldr-emoji-annotation ===
 +
fcitx5 uses these for its emoji module. Some distributions (such as Void Linux) provide this package. Gentoo, on the other hand, does not, but there are user-maintained [https://wiki.gentoo.org/wiki/Ebuild_repository Portage overlays] that provide it such as [https://github.com/microcai/gentoo-zh gentoo-zh]. If you want to build it, [https://github.com/fujiwarat/cldr-emoji-annotation clone the repository] and run <code>./autogen.sh</code>, then <code>./configure</code>, <code>make</code> and <code>make install</code>. It must be installed to the default directory so '''do not set a prefix to the <code>./configure</code> script'''.
 +
 
 +
=== fcitx5 ===
 +
You should now be able to build fcitx5. [https://github.com/fcitx/fcitx5 Clone the repository]. Some cmake options to keep in mind before building are:
 +
 
 +
*'''ENABLE_WAYLAND''': Wayland support. Defaults to On and should be fine for desktop environments such as KDE and GNOME. Users running X11-based window managers will need to turn it off.
 +
*'''ENABLE_ENCHANT''': Enchant support. Defaults to On. Used for word prediction (hinting). Depends on [https://github.com/AbiWord/enchant libenchant], which is provided by most distributions.
 +
 
 +
The user is encouraged to check the contents of CMakeLists.txt for an exhaustive list of options.
 +
 
 +
For example, an [https://i3wm.org/ i3] user who wishes to install it to /opt would run:
 +
cmake -DENABLE_WAYLAND=Off -DCMAKE_INSTALL_PREFIX=/opt .
 +
make
 +
make install
 +
 
 +
=== fcitx5-qt ===
 +
 
 +
TODO
 +
 
 +
=== fcitx5-gtk ===
 +
 
 +
TODO

Revision as of 10:12, 11 May 2020

(This article is a work in progress)

While fcitx5 is provided as a package in many distributions, some GNU/Linux distributions (such as Gentoo) don't officially provide it as of May 2020. This article aims to give general instructions on how to compile and install fcitx5 in your GNU/Linux system.

Dependencies

Note that most of these packages are usually provided by many distributions. cldr-emoji-annotation is a special case and will be covered in the next section.

Building process

xcb-imdkit

After installing all the dependencies, the first thing to do is install xcb-imdkit, an implementation of the X Input Method in XCB. Clone the GitHub repository:

git clone https://github.com/fcitx/xcb-imdkit.git

cd into the Git directory and run cmake:

cmake .

To install it to a custom directory, set the CMAKE_INSTALL_PREFIX flag:

cmake -DCMAKE_INSTALL_PREFIX=/your/install/path .

Then simply run make and make install.

cldr-emoji-annotation

fcitx5 uses these for its emoji module. Some distributions (such as Void Linux) provide this package. Gentoo, on the other hand, does not, but there are user-maintained Portage overlays that provide it such as gentoo-zh. If you want to build it, clone the repository and run ./autogen.sh, then ./configure, make and make install. It must be installed to the default directory so do not set a prefix to the ./configure script.

fcitx5

You should now be able to build fcitx5. Clone the repository. Some cmake options to keep in mind before building are:

  • ENABLE_WAYLAND: Wayland support. Defaults to On and should be fine for desktop environments such as KDE and GNOME. Users running X11-based window managers will need to turn it off.
  • ENABLE_ENCHANT: Enchant support. Defaults to On. Used for word prediction (hinting). Depends on libenchant, which is provided by most distributions.

The user is encouraged to check the contents of CMakeLists.txt for an exhaustive list of options.

For example, an i3 user who wishes to install it to /opt would run:

cmake -DENABLE_WAYLAND=Off -DCMAKE_INSTALL_PREFIX=/opt .
make
make install

fcitx5-qt

TODO

fcitx5-gtk

TODO