The strange package dependence problem: fcitx-frontend-qt5 must be installed for self-compiled fcitx5.

96 views
Skip to first unread message

Hongyi Zhao

unread,
Jan 3, 2021, 9:05:57 PM1/3/21
to fcitx-dev

On Ubuntu 20.10, I've compiled and installed the following packages in order of number:

10-cldr-emoji-annotation.git
10-fmt.git
10-librime.git
10-xcb-imdkit.git
20-fcitx5.git
25-libime.git
30-fcitx5-gtk.git
30-fcitx5-lua.git
30-fcitx5-qt.git
30-fcitx5-rime.git
40-fcitx5-chinese-addons.git
40-fcitx5-configtool.git

But it seems that the input methods switch through the frontend of fcitx5 still needed the following package to be installed, otherwise the input methods switch will be disabled and not responds to the keystroke:

$ sudo apt-get install -y fcitx-frontend-qt5

I'm very confused on this problem can't figure out the reason. Any hints will be highly appreciated.

Regards,
HY

Weng Xuetian

unread,
Jan 3, 2021, 9:15:56 PM1/3/21
to fcitx-dev
When you compile your own gtk im module, the hook will not update it
automatically.
you need to manually run gtk-query-immodules-3.0 --update-cache for
gtk3 and gtk-query-immodules-2.0 --update-cache for gtk2.
Depending on the distribution, the file may be overwritten by any
related package update.

fcitx-frontend-qt5 is fcitx4's im module, which indeed works with
fcitx 5, for backward compatibility.

Also it is possible that you didn't install them to the directory that
is recognized by system's gtk / qt.

Please run fcitx5-diagnose for more information and post it here if
you don't understand how to interpret it.

(BTW you can use Chinese to reply if you want)
> --
> You received this message because you are subscribed to the Google Groups "fcitx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fcitx-dev+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fcitx-dev/dbfe4a6a-2588-4991-8dd6-5496a45f0fd8n%40googlegroups.com.

Hongyi Zhao

unread,
Jan 3, 2021, 9:24:34 PM1/3/21
to fcit...@googlegroups.com
On Mon, Jan 4, 2021 at 10:15 AM Weng Xuetian <wen...@gmail.com> wrote:
>
> When you compile your own gtk im module, the hook will not update it
> automatically.
> you need to manually run gtk-query-immodules-3.0 --update-cache for
> gtk3 and gtk-query-immodules-2.0 --update-cache for gtk2.

仍然不太清楚甚末时候及如何调用上面的命令。参看如下结果:

werner@X10DAi:~$ gtk-query-immodules-3.0
gtk-query-immodules-3.0: command not found
werner@X10DAi:~$ gtk-query-immodules-2.0
gtk-query-immodules-2.0: command not found


> Depending on the distribution, the file may be overwritten by any
> related package update.
>
> fcitx-frontend-qt5 is fcitx4's im module, which indeed works with
> fcitx 5, for backward compatibility.
>
> Also it is possible that you didn't install them to the directory that
> is recognized by system's gtk / qt.

如何知道/怎么检查/如何修正?

>
> Please run fcitx5-diagnose for more information and post it here if
> you don't understand how to interpret it.

werner@X10DAi:~$ fcitx5-diagnose
# System Info:
1. `uname -a`:

Linux X10DAi 5.8.0-25-generic #26-Ubuntu SMP Thu Oct 15
10:30:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

2. `lsb_release -a`:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy

3. `lsb_release -d`:

Description: Ubuntu 20.10

4. `/etc/lsb-release`:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.10
DISTRIB_CODENAME=groovy
DISTRIB_DESCRIPTION="Ubuntu 20.10"

5. `/etc/os-release`:

NAME="Ubuntu"
VERSION="20.10 (Groovy Gorilla)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.10"
VERSION_ID="20.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=groovy
UBUNTU_CODENAME=groovy

6. Desktop Environment:

Desktop environment is `gnome3`.

7. Bash Version:

BASH_VERSION='5.0.17(1)-release'

# Environment:
1. DISPLAY:

DISPLAY=':0'

2. Keyboard Layout:

1. `setxkbmap`:

xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+us:2+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};

2. `xprop`:

_XKB_RULES_NAMES(STRING) = "evdev", "pc105", "us,us", ",", ""

3. Locale:

1. All locale:

C
C.UTF-8
de_AT.utf8
de_BE.utf8
de_CH.utf8
de_DE.utf8
de_IT.utf8
de_LI.utf8
de_LU.utf8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IL
en_IL.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
es_AR.utf8
es_BO.utf8
es_CL.utf8
es_CO.utf8
es_CR.utf8
es_CU
es_CU.utf8
es_DO.utf8
es_EC.utf8
es_ES.utf8
es_GT.utf8
es_HN.utf8
es_MX.utf8
es_NI.utf8
es_PA.utf8
es_PE.utf8
es_PR.utf8
es_PY.utf8
es_SV.utf8
es_US.utf8
es_UY.utf8
es_VE.utf8
fr_BE.utf8
fr_CA.utf8
fr_CH.utf8
fr_FR.utf8
fr_LU.utf8
it_CH.utf8
it_IT.utf8
POSIX
pt_BR.utf8
pt_PT.utf8
ru_RU.utf8
ru_UA.utf8
zh_CN.utf8
zh_SG.utf8

2. Current locale:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

4. Directories:

1. Home:

/home/werner

2. `${XDG_CONFIG_HOME}`:

Environment variable `XDG_CONFIG_HOME` is not set.

Current value of `XDG_CONFIG_HOME` is `~/.config`
(`/home/werner/.config`).

3. Fcitx5 Settings Directory:

Current fcitx5 settings directory is `~/.config/fcitx5`
(`/home/werner/.config/fcitx5`).

5. Current user:

The script is run as werner (1000).

# Fcitx State:
1. executable:

Found fcitx5 at `/usr/local/bin/fcitx5`.

2. version:

Fcitx version: `5.0.4`

3. process:

Found 1 fcitx5 process:

2662992 fcitx5

4. `fcitx5-remote`:

`fcitx5-remote` works properly.

5. DBus interface:

Using `dbus-send` to check dbus.

Owner of DBus name `org.fcitx.Fcitx5` is `:1.5`.

PID of DBus name `org.fcitx.Fcitx5` owner is `2662992`.

# Fcitx Configure UI:
1. Config Tool Wrapper:

Found fcitx5-configtool at `/usr/local/bin/fcitx5-configtool`.

2. Config GUI for qt:

Found `fcitx5-config-qt` at `/usr/bin/fcitx5-config-qt`.

3. Config GUI for kde:

**`kcmshell5` not found.**

# Frontends setup:
## Xim:
1. `${XMODIFIERS}`:

Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
Xim Server Name from Environment variable is fcitx.

2. XIM_SERVERS on root window:

Xim server name is the same with that set in the environment variable.

## Qt:
1. qt4 - `${QT4_IM_MODULE}`:

Environment variable QT_IM_MODULE is set to "fcitx" correctly.

2. qt5 - `${QT_IM_MODULE}`:

Environment variable QT_IM_MODULE is set to "fcitx" correctly.

3. Qt IM module files:

Found unknown fcitx qt module:
`/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so`.
Found unknown fcitx qt module:
`/lib/x86_64-linux-gnu/fcitx/qt/libfcitx-quickphrase-editor5.so`.
Found fcitx5 qt5 module:
`/usr/local/lib/fcitx5/qt5/libfcitx-quickphrase-editor5.so`.
**Cannot find fcitx5 input method module for Qt4.**
**Cannot find fcitx5 input method module for Qt5.**

## Gtk:
1. gtk - `${GTK_IM_MODULE}`:

Environment variable GTK_IM_MODULE is set to "fcitx" correctly.

2. `gtk-query-immodules`:

1. gtk 2:

**Cannot find `gtk-query-immodules` for gtk 2**

**Cannot find fcitx5 im module for gtk 2.**

2. gtk 3:

**Cannot find `gtk-query-immodules` for gtk 3**

**Cannot find fcitx5 im module for gtk 3.**

3. Gtk IM module cache:

1. gtk 2:

Found immodules cache for gtk `2.24.32` at
`/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache`.
Version Line:

# Created by
/usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0 from
gtk+-2.24.32

**Failed to find fcitx5 in immodule cache at
`/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache`**

**Cannot find fcitx5 im module for gtk 2 in cache.**

2. gtk 3:

Found immodules cache for gtk `3.24.23` at
`/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache`.
Version Line:

# Created by
/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 from
gtk+-3.24.23

**Failed to find fcitx5 in immodule cache at
`/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache`**

**Cannot find fcitx5 im module for gtk 3 in cache.**

3. gtk 4:

**Cannot find immodules cache for gtk 4**

**Cannot find fcitx5 im module for gtk 4 in cache.**

4. Gtk IM module files:

1. gtk 2:

All found Gtk 2 immodule files exist.

2. gtk 3:

All found Gtk 3 immodule files exist.

3. gtk 4:

All found Gtk 4 immodule files exist.

# Configuration:
## Fcitx Addons:
1. Addon Config Dir:

Found fcitx5 addon config directory: `/usr/local/share/fcitx5/addon`.

2. Addon List:

1. Found 28 enabled addons:

Simplified and Traditional Chinese Translation
Classic User Inteface
Clipboard
Cloud Pinyin
DBus
DBus Frontend
Emoji
Full width character
IBus Frontend
Lua IME API
Input method selector
Keyboard
KDE Input Method Panel
Lua Addon Loader
Status Notifier
Notification
Pinyin
Extra Pinyin functionality
Punctuation
Quick Phrase
Rime
Spell
Table
Unicode
Wayland
Wayland Input method frontend
XCB
X Input Method Frontend

2. Found 0 disabled addons:

3. Addon Libraries:

All libraries for all addons are found.

4. User Interface:

Found 2 enabled user interface addons:

Classic User Inteface
KDE Input Method Panel

# Log:
1. `date`:

Mon Jan 4 10:23:28 AM CST 2021

2. `/home/werner/.config/fcitx5/crash.log`:

`/crash.log` not found.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fcitx-dev/CAKiDycFwPNL%3D3nCF%2B3xmd4q13gEKwM3C_WDuvzTA02JX4wiqqw%40mail.gmail.com.



--
Assoc. Prof. Hongyi Zhao <hongy...@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China

Weng Xuetian

unread,
Jan 3, 2021, 9:35:12 PM1/3/21
to fcitx-dev
这两个命令在 ubuntu 上没有被安装到 PATH 里面,因为 debian 的 multiarch 的关系

在类似这种目录下面
/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0

用这个网站搜索比较方便
https://pkgs.org/search/?q=gtk-query-immodules-3.0
另外可能需要指定 -DGTK3_IM_MODULEDIR=/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules
(gtk2 类似)


而且可以看出 qt im module 安装的路径肯定也不对,因为没有找到
可以编译时用 -DCMAKE_INSTALL_QT5PLUGINDIR 来指定
根据 fcitx5-diagnose 的输出,可以设置为 /lib/x86_64-linux-gnu/qt5/plugins
> To view this discussion on the web visit https://groups.google.com/d/msgid/fcitx-dev/CAGP6PO%2B8V8RPdN%2BohrTSo224gHJ_SORrhr1g0aZSp9uunrX-ng%40mail.gmail.com.

Hongyi Zhao

unread,
Jan 3, 2021, 10:23:25 PM1/3/21
to fcit...@googlegroups.com
On Mon, Jan 4, 2021 at 10:35 AM Weng Xuetian <wen...@gmail.com> wrote:
>
> 这两个命令在 ubuntu 上没有被安装到 PATH 里面,因为 debian 的 multiarch 的关系
>
> 在类似这种目录下面
> /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0
>
> 用这个网站搜索比较方便
> https://pkgs.org/search/?q=gtk-query-immodules-3.0

我一般使用下面的命令:

$ apt-file search -x 'gtk-query-immodules-[0-9.]+$'
libgtk-3-0: /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0
libgtk2.0-0: /usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0

根据你上面的提示,我执行了下面的命令:

werner@X10DAi:~$ sudo
/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0
--update-cache


> 另外可能需要指定 -DGTK3_IM_MODULEDIR=/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules
> (gtk2 类似)

改为下面的来编译fcitx5-gtk.git:
cmake -DENABLE_GTK2_IM_MODULE=OFF -DENABLE_GTK4_IM_MODULE=OFF
-DGTK3_IM_MODULEDIR=/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules ..

> 而且可以看出 qt im module 安装的路径肯定也不对,因为没有找到
> 可以编译时用 -DCMAKE_INSTALL_QT5PLUGINDIR 来指定
> 根据 fcitx5-diagnose 的输出,可以设置为 /lib/x86_64-linux-gnu/qt5/plugins

改为下面的来编译fcitx5-qt.git:

cmake -DENABLE_QT4=false
-DCMAKE_INSTALL_QT5PLUGINDIR=/lib/x86_64-linux-gnu/qt5/plugins ..

确实解决了问题。

另外,我想知道,如何采用上面的编译选项,是否就没有必要单独运行的这个命令了:

werner@X10DAi:~$ sudo
/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0
--update-cache
> To view this discussion on the web visit https://groups.google.com/d/msgid/fcitx-dev/CAKiDycG7kphPsy%3DGhp%3Da8rbPhvbjw6gypVKD30q%2BXc82kaYaCw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages