Skip to content

Commit

Permalink
Merge pull request #827 from zonble/master
Browse files Browse the repository at this point in the history
Updates the build script for McBopomofo.
  • Loading branch information
ottokang authored May 16, 2024
2 parents 2efd45e + 304001c commit dee3548
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
push:
pull_request:
branches: [main]

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Use Node.js 21.x
uses: actions/setup-node@v4
with:
node-version: 21.x
- name: Use Install NSIS
uses: repolevedavaj/install-nsis@v1.0.1
with:
nsis-version: 3.08
- name: Run build.bat
run: |
.\build.bat
- name: Build the installer
run: |
cmd /C "C:\Program Files (x86)\NSIS\Bin\makensis.exe" ".\installer\installer.nsi"
- uses: actions/upload-artifact@v4
with:
name: Installer
path: installer/*.exe
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vs
build
build64
node/input_methods/McBopomofo
installer/*.exe
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "libchewing"]
path = libchewing
url = https://github.com/chewing/libchewing.git
[submodule "McBopomofoWeb"]
path = McBopomofoWeb
url = git@github.com:openvanilla/McBopomofoWeb.git
1 change: 1 addition & 0 deletions McBopomofoWeb
Submodule McBopomofoWeb added at 3b0819
15 changes: 13 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
cmake . -Bbuild -G"Visual Studio 14 2015"
cmake . -Bbuild -G "Visual Studio 17 2022" -A Win32
cmake --build build --config Release

cmake . -Bbuild64 -G"Visual Studio 14 2015 Win64"
cmake . -Bbuild64 -G "Visual Studio 17 2022" -A x64
cmake --build build64 --config Release --target PIMETextService

echo "Start building McBopomofo"
cd McBopomofoWeb
cmd /C npm install
cmd /C npm run build:pime
cd ..

echo "Copy McBopomofo to node\input_methods\McBopomofo"
cmd /C rd /s /q node\input_methods\McBopomofo
cmd /C mkdir node\input_methods\McBopomofo
cmd /C xcopy /s /q /y /f McBopomofoWeb\output\pime node\input_methods\McBopomofo\.
8 changes: 8 additions & 0 deletions installer/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,13 @@ SectionGroupEnd

SectionGroup /e $(NODE_SECTION_GROUP) node_section_group
SectionGroup /e $(NODE_CHT_SECTION_GROUP) node_cht_section_group
Section $(MCBOPOMOFO) McBopomofo
SectionIn 2
SetOutPath "$INSTDIR\node\input_methods\McBopomofo"
File /r "..\node\input_methods\McBopomofo\*.*"
StrCpy $INST_NODE "True"
SectionEnd

Section $(EMOJIME) emojime
SectionIn 2
SetOutPath "$INSTDIR\node\input_methods\emojime"
Expand Down Expand Up @@ -648,6 +655,7 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${chephonetic} $(chephonetic_DESC)
!insertmacro MUI_DESCRIPTION_TEXT ${cheez} $(cheez_DESC)
!insertmacro MUI_DESCRIPTION_TEXT ${rime} $(rime_DESC)
!insertmacro MUI_DESCRIPTION_TEXT ${mcbopomofo} $(mcbopomofo_DESC)
!insertmacro MUI_DESCRIPTION_TEXT ${emojime} $(emojime_DESC)
!insertmacro MUI_DESCRIPTION_TEXT ${cheeng} $(cheeng_DESC)
!insertmacro MUI_DESCRIPTION_TEXT ${braille_chewing} $(braille_chewing_DESC)
Expand Down
2 changes: 2 additions & 0 deletions installer/locale/English.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
!insertmacro LANG_STRING CHEPHONETIC "Phonetic"
!insertmacro LANG_STRING CHEEZ "EZ Input"
!insertmacro LANG_STRING RIME "Rime"
!insertmacro LANG_STRING MCBOPOMOFO "McBopomofo"
!insertmacro LANG_STRING EMOJIME "emojime"
!insertmacro LANG_STRING CHEENG "Eng-Num"
!insertmacro LANG_STRING BRAILLE_CHEWING "Braille Chewing"
Expand All @@ -61,6 +62,7 @@
!insertmacro LANG_STRING chephonetic_DESC "Install Phonetic input method module."
!insertmacro LANG_STRING cheez_DESC "Install EZ Input method module."
!insertmacro LANG_STRING rime_DESC "Install Rime input method engine, 内含拼音、注音、仓颉、五笔、粤拼、吴语等数种输入方案。"
!insertmacro LANG_STRING mcbopomofo_DESC "Install McBopomofo input method module."
!insertmacro LANG_STRING emojime_DESC "Install emojime input method module."
!insertmacro LANG_STRING cheeng_DESC "Install Eng-Num input method module."
!insertmacro LANG_STRING braille_chewing_DESC "Install Braille Chewing input method module."
Expand Down
2 changes: 2 additions & 0 deletions installer/locale/SimpChinese.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
!insertmacro LANG_STRING CHEPHONETIC 注音
!insertmacro LANG_STRING CHEEZ 轻松
!insertmacro LANG_STRING RIME 中州韵
!insertmacro LANG_STRING MCBOPOMOFO 小麦注音
!insertmacro LANG_STRING EMOJIME emojime
!insertmacro LANG_STRING CHEENG 英数
!insertmacro LANG_STRING BRAILLE_CHEWING "盲文酷音"
Expand All @@ -61,6 +62,7 @@
!insertmacro LANG_STRING chephonetic_DESC "安装注音输入法模块。"
!insertmacro LANG_STRING cheez_DESC "安装轻松输入法模块。"
!insertmacro LANG_STRING rime_DESC "安装中州韵输入法引擎,内含拼音、注音、仓颉、五笔、粤拼、吴语等数种输入方案。"
!insertmacro LANG_STRING mcbopomofo_DESC "安装小麦注音输入法模块。"
!insertmacro LANG_STRING emojime_DESC "安装 emojime 输入法模块。"
!insertmacro LANG_STRING cheeng_DESC "安装英数输入法模块。"
!insertmacro LANG_STRING braille_chewing_DESC "安装盲文酷音输入法模块。"
Expand Down
2 changes: 2 additions & 0 deletions installer/locale/TradChinese.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
!insertmacro LANG_STRING CHEPHONETIC 注音
!insertmacro LANG_STRING CHEEZ 輕鬆
!insertmacro LANG_STRING RIME 中州韻
!insertmacro LANG_STRING MCBOPOMOFO 小麥注音
!insertmacro LANG_STRING EMOJIME emojime
!insertmacro LANG_STRING CHEENG 英數
!insertmacro LANG_STRING BRAILLE_CHEWING "點字酷音"
Expand All @@ -61,6 +62,7 @@
!insertmacro LANG_STRING chephonetic_DESC "安裝注音輸入法模組。"
!insertmacro LANG_STRING cheez_DESC "安裝輕鬆輸入法模組。"
!insertmacro LANG_STRING rime_DESC "安裝中州韻輸入法引擎,內含拼音、注音、倉頡、五筆、粵拼、吳語等數種輸入方案。"
!insertmacro LANG_STRING mcbopomofo_DESC "安裝小麥注音輸入法模組。"
!insertmacro LANG_STRING emojime_DESC "安裝 emojime 輸入法模組。"
!insertmacro LANG_STRING cheeng_DESC "安裝英數輸入法模組。"
!insertmacro LANG_STRING braille_chewing_DESC "安裝點字酷音輸入法模組。"
Expand Down

0 comments on commit dee3548

Please sign in to comment.