鼠鬚管核心 librime 編譯 - oniondelta/Onion_Rime_Files GitHub Wiki
編譯環境準備
-
下載安裝 Xcode
-
安裝 Xcode Command Line Tools
xcode-select --install
-
安裝 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
-
Homebrew 安裝 cmake、git 編譯工具
brew install cmake git
-
需 Python,Mac 原生已有
編譯
-
從 GitHub 獲取檔案
git clone --recursive https://github.com/rime/librime.git
-
獲取 librime 插件檔案
librime-charcode 插件,編譯後只能本機使用?!且需特別設定。參考一、參考二、參考三、參考四。不推薦附加,因 lua 也可做出相同功能替代。
bash librime/install-plugins.sh rime/librime-sample bash librime/install-plugins.sh lotem/librime-octagram bash librime/install-plugins.sh hchunhui/librime-lua
-
獲取 librime-lua 缺少之分支檔案
移到 lua 資料夾,clone 缺少之檔案
cd /Users/〔使用者名稱〕/librime/plugins/lua git clone https://github.com/hchunhui/librime-lua.git -b thirdparty --depth=1 thirdparty
備註:-b 〈分支名〉(只下載該分支檔案,第一個 thirdparty 為分支名稱);--depth=1 (只下載最新 commit 的檔案);最後的 thirdparty 為 clone 到的資料夾(最後一個 thirdparty 為資料夾名稱)
-
構建 boost
移到 librime 資料夾,構建 boost
cd /Users/〔使用者名稱〕/librime/ make xcode/deps/boost export BOOST_ROOT="$(pwd)/deps/boost_1_78_0"
-
完成編譯
make xcode/deps make xcode
-
編譯後 librime 檔案位置
/Users/〔使用者名稱〕/librime/build/lib/Release/librime.1.7.3.dylib
替換更新 librime 核心
-
鼠鬚管( Squirrel )
把前面編譯好的
librime.1.7.3.dylib
更名為librime.1.dylib
Squirrel.app 右鍵顯示套件內容,於其中
/Contents/Frameworks/librime.1.dylib
替換