本文介绍在深度Deepin Linux系统中安装rime输入法,打造完善的输入环境。rime可以支持辅码,下面手动编译安装最新的ibus-rime版本。
第一步、安装最新的引擎librime 项目地址:https://github.com/rime/librime 1、安装各种依赖包 sudo apt install libopencc-dev cmake debhelper libboost-dev libboost-filesystem-dev libboost-locale-dev libboost-regex-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libgoogle-glog-dev libleveldb-dev libmarisa-dev libopencc-dev libyaml-cpp-dev x11proto-core-dev x11proto-dev zlib1g-dev 再编译安装: leveldb-master marisa-trie yaml-cpp-master 相关链接: https://github.com/hxoht/level-replicator https://github.com/pytries/marisa-trie https://github.com/jbeder/yaml-cpp 2、下载源码到本地make,编译完成再运行sudo make install 错误记录1: 编译检查时报错:CMake Error at cmake/FindGlog.cmake:22 需安装: sudo apt install libgoogle-glog-dev libgflags-dev 错误记录2: 编译检查时报错:Could not find xxxxx library 需要安装 xxxxxx 错误记录3: 编译中途报错,例如下面之类: [ 77%] Linking CXX shared library ../lib/librime.so /usr/bin/ld: /usr/local/lib/libleveldb.a(repair.cc.o): relocation R_X86_64_PC32 against symbol `_ZN7leveldb10EnvWrapper9CreateDirERKNSt7_ cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: 最后的链结失败: 错误的值 collect2: error: ld returned 1 exit status make[3]: *** [src/CMakeFiles/rime.dir/build.make:1579:lib/librime.so.1.3.2] 错误 1 make[3]: 离开目录“/home/shui/Desktop/librime-master/build” make[2]: *** [CMakeFiles/Makefile2:118:src/CMakeFiles/rime.dir/all] 错误 2 make[2]: 离开目录“/home/shui/Desktop/librime-master/build” make[1]: *** [Makefile:141:all] 错误 2 make[1]: 离开目录“/home/shui/Desktop/librime-master/build” make: *** [Makefile:29:release] 错误 2 原因:安装时安装的是静态库(.a),需要安装动态库(.o) 可以进入 /usr/local/lib 看见 libleveldb.a 存在,没有 libleveldb.o 不过,我搜索了一下我的硬盘,里面有,在 /usr/local/lib 里做了连接解决。 注:如果是: [ 76%] Linking CXX shared library ../lib/librime.so /usr/bin/ld: /home/shui/Desktop/librime-master/thirdparty/lib/libyaml-cpp.a(emitterstate.cpp.o): relocation R_X86_64_PC32 against symbol `_ZNSt6vectorISt10unique_ptrIN4YAML12EmitterState5GroupESt14default _deleteIS3_EESaIS6_EED1Ev' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: 最后的链结失败: 错误的值 collect2: error: ld returned 1 exit status make[3]: *** [src/CMakeFiles/rime.dir/build.make:1579:lib/librime.so.1.3.2] 错误 1 make[3]: 离开目录“/home/shui/Desktop/librime-master/build” make[2]: *** [CMakeFiles/Makefile2:118:src/CMakeFiles/rime.dir/all] 错误 2 make[2]: 离开目录“/home/shui/Desktop/librime-master/build” make[1]: *** [Makefile:141:all] 错误 2 make[1]: 离开目录“/home/shui/Desktop/librime-master/build” make: *** [Makefile:29:release] 错误 2 在安装 yaml-cpp 时,用下面这条命令编译安装: cmake -DBUILD_SHARED_LIBS=OFF] ..
第二步、安装ibus客户端 运行以下命令: sudo apt install ibus-clutter ibus-doc ibus-qt4 ibus-gtk ibus-gtk3
第三步、安装最新的ibus-rime 项目地址:https://github.com/rime/ibus-rime 直接下载源码:make 再运行命令:sudo make install 错误记录1: 出现: -- Found rime, version 1.3.2 -- Found Rime: /usr/lib/librime.so CMake Error at /usr/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find RimeData (missing: RIME_DATA_DIR) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) cmake/FindRimeData.cmake:22 (find_package_handle_standard_args) CMakeLists.txt:27 (find_package) -- Configuring incomplete, errors occurred! See also "/home/shui/Desktop/ibus-rime-master/build/CMakeFiles/CMakeOutput.log". make: *** [Makefile:15:ibus-engine-rime] 错误 1 重启系统可解决。 错误记录2: 出现: mkdir -p build (cd build; cmake -DCMAKE_BUILD_TYPE=Release .. && make) CMake Error at /usr/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find RimeData (missing: RIME_DATA_DIR) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) cmake/FindRimeData.cmake:22 (find_package_handle_standard_args) CMakeLists.txt:27 (find_package) -- Configuring incomplete, errors occurred! See also "/home/shui/Desktop/ibus-rime-master/build/CMakeFiles/CMakeOutput.log". make: *** [Makefile:15:ibus-engine-rime] 错误 1 在上一步的librime编译中的build/bin文件里有配置文件,新建目录:/usr/share/rime-data 把相关配置文件复制进去。 至此,编译安装rime完成,实测可以正常使用。
相关主题 |