termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.36k stars 3.08k forks source link

[Package]: 编译了libime和fcitx5-chinese-addons如何传至仓里 #22121

Open liuo2023 opened 2 weeks ago

liuo2023 commented 2 weeks ago

Why is it worth to add this package?

需要中文输入法,目前已经编译并安装libime和fcitx5-Chinese-addons,需要递交到x11-repo代码仓

Home page URL

https://fcitx-im.org

Source code URL

https://github.com/fcitx/fcitx5-chinese-adsons

Packaging policy acknowledgement

Additional information

No response

Biswa96 commented 2 weeks ago

I have tried to compile fcitx5-chinese-addons package but I can not compile its dependency libime. The later one requires some tools which need to be built for host x86_64. The libime tools requires fcitx5 and dependencies.

liuo2023 commented 2 weeks ago

I have tried to compile fcitx5-chinese-addons package but I can not compile its dependency libime. The later one requires some tools which need to be built for host x86_64. The libime tools requires fcitx5 and dependencies.

非常简单,下载分别下载libime源码和 kenlm源码. git clone https://mirror.ghproxy.com/https://github.com/kpu/kenlm.git,然后将kenlm源码里面kenlm目录下的文件复制到libime-1.1.9/src/libime/core/kenlm,然后编译安装。很简单的

liuo2023 commented 2 weeks ago

I have tried to compile fcitx5-chinese-addons package but I can not compile its dependency libime. The later one requires some tools which need to be built for host x86_64. The libime tools requires fcitx5 and dependencies.

没有那么复杂,先编译安装libime包,然后编译fcitx5-chinese-addons,但编译fcitx5-chinese-addons的时候要注意在主要的Cmakelist.txt中屏蔽一下qt6-qtwebengine

liuo2023 commented 2 weeks ago

编译fcitx5-chinese-addons 主CMakeList.txt中添加 原来的是这样的: cmake_minimum_required(VERSION 3.6.0) project(fcitx5-chinese-addons VERSION 5.1.7)

find_package(ECM REQUIRED 1.0.0)

修改后是这样的: cmake_minimum_required(VERSION 3.6.0) project(fcitx5-chinese-addons VERSION 5.1.7) set(QT_HOST_PATH_CMAKE_DIR /data/data/com.termux/files/usr/lib/cmake) set(QT_HOST_PATH /data/data/com.termux/files/usr/lib/cmake/Qt6/) find_package(ECM REQUIRED 1.0.0)

删除掉的内容: else() find_package(Qt${QT_MAJOR_VERSION}WebEngineWidgets REQUIRED)

liuo2023 commented 2 weeks ago

你可以参考并试试 ------------------ 原始邮件 ------------------ 发件人: "termux/termux-packages" @.>; 发送时间: 2024年11月7日(星期四) 下午3:47 @.>; @.**@.>; 主题: Re: [termux/termux-packages] [Package]: 编译了libime和fcitx5-chinese-addons如何传至仓里 (Issue #22121)

I have tried to compile fcitx5-chinese-addons package but I can not compile its dependency libime. The later one requires some tools which need to be built for host x86_64. The libime tools requires fcitx5 and dependencies.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

从QQ邮箱发来的超大附件

libime和fcitx5-chinese-addons.zip (186.06M, 2024年12月08日 15:53 到期)进入下载页面:http://mail.qq.com/cgi-bin/ftnExs_download?t=exs_ftn_download&k=6e38623662323bc0353621711231561b404c065406050551150e5254551c5d0c0c094f55040205190c59530e5504560d0959015034106458515a0b5b518ba9525b51164e011c075c51560745511c05505c570c451a4b0d443805&code=88b641d4

liuo2023 commented 2 weeks ago

fcitx5-chinese-addons 里面涉及的 else() find_package(Qt${QT_MAJOR_VERSION}WebEngineWidgets REQUIRED) 都要删除

liuo2023 commented 2 weeks ago

因为qt6-qtwebengine 没有相关的包

Biswa96 commented 2 weeks ago

The issue is not about that. The termux packages are cross compile for 4 CPU architectures (aarch64, arm, x86, x86_64) but the host platform is x86_64 Ubuntu. So, the build failed with /bin/sh: 1: LibIME::slm_build_binary: not found error. We need libime for x86_64 Ubuntu host which requires every fcitx dependencies.

liuo2023 commented 2 weeks ago

The issue is not about that. The termux packages are cross compile for 4 CPU architectures (aarch64, arm, x86, x86_64) but the host platform is x86_64 Ubuntu. So, the build failed with /bin/sh: 1: LibIME::slm_build_binary: not found error. We need libime for x86_64 Ubuntu host which requires every fcitx dependencies.

你缺少src/libime/core/kenlm/lm/build_binary_main.cc.o 这个文件,这个源于kenlm源码,去下载kenlm源码,替换到libime相应目录里面

liuo2023 commented 2 weeks ago

libime源码中,kenlm里面没有源码,这个需要到kenlm仓中下载,将kenlm源码放进去,然后直接编译libime即可,不需要编译kenlm

liuo2023 commented 1 week ago

close

Biswa96 commented 1 week ago

The issue is not solved yet. I've built the packages without dictionary files. I'll try to add the packages.

liuo2023 commented 1 week ago

The issue is not solved yet. I've built the packages without dictionary files. I'll try to add the packages.

dictionary files will be downloaded automatically when build libime

Biswa96 commented 1 week ago

I have added the required packages in the aforementioned pull request. Those do not have dictionary files yet. I have copied them from ArchLinux packages. Here is the result in mousepad text editor in xfce4.

image

I can not figure out how to add dictionary files with the cross compilation. Please feel free to add necessary changes in a pull request.

2061360308 commented 12 hours ago

我还是没办法使用中文输入法,请问是哪里出错了吗?

环境是termux里安装了lxqt,并且使用termux-x11

我按照以下步骤操作

# 安装必要的包
pkg install fcitx5 fcitx5-configtool fcitx5-chinese-addons fcitx5-gtk-common fcitx5-hangul fcitx5-qt

# 配置环境变量
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
# 启动 D-Bus 服务
termux-services start

eval `dbus-launch --sh-syntax --exit-with-session`

# 启动 fcitx5
fcitx5 &

这是最终的结果mmexport1732474799436.jpg

twaik commented 12 hours ago

@2061360308 official repository language is english.

Biswa96 commented 12 hours ago

The fcitx5-chinese-addons and libime packages do not have dictionary files yet. I can not figure out how to add those. Please feel free to create pull request with the fixes.

2061360308 commented 12 hours ago

The fcitx5-chinese-addons and libime packages do not have dictionary files yet. I can not figure out how to add those. Please feel free to create pull request with the fixes.

It's not working yet, is it? Thank you for your help.