Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
af80ab5
Update libraries
rocka Jan 16, 2025
5d36c7e
generate libiconv configure file by cmake
rocka Jan 16, 2025
a0b2d41
change libiconv submodule upstream to github mirror
rocka Jan 16, 2025
76b6497
revert boost
rocka Jan 18, 2025
bc62911
retry with ndk r28-rc3
rocka Jan 18, 2025
9dd2c0f
try fix libuv build
rocka Jan 18, 2025
4b58c58
try fix libuv build (take 2)
rocka Jan 18, 2025
3062062
try fix lua build
rocka Jan 18, 2025
d4e4788
fixup
rocka Jan 18, 2025
98c2cdf
fixup fixup
rocka Jan 18, 2025
e2b9f89
fixup^3
rocka Jan 18, 2025
0ee1ed1
revert boost (again)
rocka Jan 18, 2025
89d118d
update libs
rocka Mar 16, 2025
430cbcc
try ndk r28
rocka Mar 16, 2025
422acf0
try boost 1.87.0 again
rocka Mar 16, 2025
c452a60
disable boost's inline asm debug_gdb_scripts
rocka Mar 16, 2025
970c5ae
try define 1
rocka Mar 16, 2025
7dfce5a
Add cmake env
berberman Mar 16, 2025
ed9db6b
try CXXFLAGS env
rocka Mar 16, 2025
d62d612
try CXXFLAGS on librime
rocka Mar 17, 2025
6e921bf
it needs more
rocka Mar 17, 2025
d0eba28
use CMAKE_CXX_FLAGS
rocka Mar 17, 2025
5de4987
path librime target_compile_definitions
rocka Mar 17, 2025
51f1abe
also patch librime-lua
rocka Mar 17, 2025
0873823
patch all librime plugins
rocka Mar 17, 2025
a59c298
refine libuv patch
rocka Mar 18, 2025
3cd4670
try build host fcitx5 before libime
rocka Apr 5, 2025
760144c
allow running workflow manually
rocka Apr 5, 2025
1397496
Merge branch 'master' into feat/update-libs-3
rocka Apr 5, 2025
3e72bee
install comp-spell-dict manually
rocka Apr 5, 2025
063797c
tidy host build dir
rocka Apr 5, 2025
cb57cda
cleanup build deps
rocka Apr 5, 2025
d32643b
fixup
rocka Apr 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ jobs:
container: archlinux:base-devel
env:
ABI: "armeabi-v7a,arm64-v8a,x86,x86_64"
NDK_VERSION: "25.2.9519653"
CMAKE_VERSION: "3.22.1"
NDK_VERSION: "28.0.13004108"
CMAKE_VERSION: "3.31.6"
ANDROID_PLATFORM: "23"

steps:
- name: Install build dependencies
# android-actions/setup-android needs unzip
# sdkmanager needs jre
run: |
pacman -Syu --needed --noconfirm \
git unzip ghc cabal-install haskell-shake haskell-aeson-pretty \
cmake extra-cmake-modules ninja fmt fcitx5 boost python opencc jre-openjdk gperf
git unzip jre-openjdk \
ghc cabal-install haskell-shake haskell-aeson-pretty \
cmake extra-cmake-modules ninja \
boost \
python opencc \
gperf

- name: Fetch source code
uses: actions/checkout@v4
Expand Down
6 changes: 4 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
[submodule "libime"]
path = libime
url = https://github.com/fcitx/libime
fetchRecurseSubmodules = true
[submodule "libime-jyutping"]
path = libime-jyutping
url = https://github.com/fcitx/libime-jyutping
Expand All @@ -65,4 +64,7 @@
url = https://github.com/tlwg/libthai
[submodule "libiconv"]
path = libiconv
url = https://git.savannah.gnu.org/git/libiconv
url = https://github.com/fcitx5-android/libiconv
[submodule "fcitx5"]
path = fcitx5
url = https://github.com/fcitx/fcitx5
2 changes: 1 addition & 1 deletion Lua
Submodule Lua updated 1 files
+1 −1 CMakeLists.txt
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ Build static libraries for [fcitx5-android](https://github.com/fcitx5-android/fc

Cabal is required to build this project.

* NDK Vesion: `25.2.9519653`
* CMake Version: `3.22.1`
### Android related

* Android Platform (API Level): `23`
* `bash tar unzip curl git python ghc haskell-shake haskell-aeson-pretty cabal-install`
* `fcitx5` (`fcitx5-modules` on Debian): for `comp-spell-dict`
* `libime` (`libime-bin` on Debian) >= 1.0.5 : for various `libime_*` tools
* Android NDK: `28.0.13004108`
* CMake Version: `3.31.6`

both can be installed with `sdkmanager` command line tool.

### System dependencies

* `tar curl git`
* `ghc haskell-shake haskell-aeson-pretty cabal-install`: haskell stuff
* `cmake extra-cmake-modules ninja`: cmake stuff
* `python`: build dep of `opencc`
* `opencc`: for `opencc_dict`
* `gperf`: build dep of `libiconv`

## Libraries

Expand Down
16 changes: 8 additions & 8 deletions build.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ lm_sc = lm_sc.arpa-20250113.tar.zst
lm_sc_sha256 = ee83ecf20d52e8bccdba4cf6cd57183d53c257713a5eb77ee3a63d50fc3796dd

# pinyin dict
pinyin_dict = dict-20241001.tar.zst
pinyin_dict_sha256 = d3313b88a68620a23bc8d5f9564cf1b678848dc7af541c4f5f02198e5a3686bf
pinyin_dict = dict-20250327.tar.zst
pinyin_dict_sha256 = 7ca6be4754c0d4c27ba7702c0dce651659bd2ca1faa5cbf2848d81a0053c8c13

# table dict
table = table-20240108.tar.gz
table_sha256 = 729c596d86907de727c74d0fc3fd241c406c5debd2b4cb74eefe022387ee9dae

## https://github.com/fcitx/fcitx5-chinese-addons/blob/master/im/pinyin/chaizi.txt
# extra pinyin dict
chinese_addon_repo = https://raw.githubusercontent.com/fcitx/fcitx5-chinese-addons/5.1.2/im/pinyin/
chinese_addon_repo = https://raw.githubusercontent.com/fcitx/fcitx5-chinese-addons/5.0.0/im/pinyin/
chaizi_sha256 = cd659605360120f7390fda1a278eea12c4df6d763a95c8099068ab09cfafd058

## https://github.com/fcitx/fcitx5-chinese-addons/blob/master/modules/pinyinhelper/CMakeLists.txt
# py stroke
py_stroke = py_stroke-20121124.tar.gz
py_stroke_sha256 = 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248
py_stroke = py_stroke-20250329.tar.gz
py_stroke_sha256 = c1a7ca7225d3614ab83353fc827503006a980447762018f53760425d7b5303a6

# py table
py_table = py_table-20121124.tar.gz
py_table_sha256 = 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04

## https://github.com/boostorg/boost/releases
## https://github.com/boostorg/boost/releases boost-<boost_version>-cmake.tar.xz
# boost
boost_version = 1.86.0
boost_sha256 = 2c5ec5edcdff47ff55e27ed9560b0a0b94b07bd07ed9928b476150e16b0efc57
boost_version = 1.87.0
boost_sha256 = 7da75f171837577a52bbf217e17f8ea576c7c246e4594d617bfde7fafd408be5

## https://github.com/fcitx/libime-jyutping/blob/master/data/CMakeLists.txt
# jyutping dict
Expand Down
1 change: 1 addition & 0 deletions fcitx5
Submodule fcitx5 added at 8af72c
2 changes: 1 addition & 1 deletion fmt
Submodule fmt updated 56 files
+6 −0 .clang-format
+5 −3 .github/workflows/cifuzz.yml
+1 −1 .github/workflows/doc.yml
+8 −36 .github/workflows/lint.yml
+15 −13 .github/workflows/linux.yml
+6 −2 .github/workflows/macos.yml
+4 −4 .github/workflows/scorecard.yml
+4 −9 .github/workflows/windows.yml
+1 −0 .gitignore
+31 −15 CMakeLists.txt
+322 −0 ChangeLog.md
+1 −0 README.md
+54 −23 doc/api.md
+1 −1 doc/get-started.md
+2 −2 doc/index.md
+4 −5 doc/syntax.md
+20 −28 include/fmt/args.h
+1,775 −1,890 include/fmt/base.h
+376 −470 include/fmt/chrono.h
+20 −22 include/fmt/color.h
+54 −44 include/fmt/compile.h
+65 −44 include/fmt/format-inl.h
+1,104 −1,287 include/fmt/format.h
+43 −55 include/fmt/os.h
+43 −88 include/fmt/ostream.h
+107 −130 include/fmt/printf.h
+98 −130 include/fmt/ranges.h
+74 −47 include/fmt/std.h
+97 −46 include/fmt/xchar.h
+19 −1 src/fmt.cc
+4 −1 src/format.cc
+6 −11 src/os.cc
+35 −3 support/mkdocs
+311 −290 support/python/mkdocstrings_handlers/cxx/__init__.py
+31 −61 support/release.py
+4 −19 test/CMakeLists.txt
+14 −0 test/args-test.cc
+131 −144 test/base-test.cc
+40 −15 test/chrono-test.cc
+1 −27 test/compile-error-test/CMakeLists.txt
+51 −13 test/compile-test.cc
+4 −3 test/format-impl-test.cc
+148 −27 test/format-test.cc
+19 −11 test/gtest/gmock-gtest-all.cc
+24 −10 test/gtest/gmock/gmock.h
+4 −3 test/gtest/gtest/gtest.h
+24 −0 test/no-builtin-types-test.cc
+1 −1 test/os-test.cc
+23 −16 test/ranges-test.cc
+3 −3 test/scan-test.cc
+5 −5 test/scan.h
+29 −3 test/std-test.cc
+1 −1 test/test-assert.h
+1 −1 test/unicode-test.cc
+4 −5 test/util.cc
+23 −105 test/xchar-test.cc
2 changes: 1 addition & 1 deletion libiconv
Submodule libiconv updated 193 files
2 changes: 1 addition & 1 deletion libime
Submodule libime updated 92 files
+1 −0 .clang-format
+15 −4 CMakeLists.txt
+4 −4 data/CMakeLists.txt
+4 −3 src/libime/core/CMakeLists.txt
+80 −53 src/libime/core/datrie.cpp
+22 −1 src/libime/core/datrie.h
+7 −6 src/libime/core/decoder.cpp
+9 −4 src/libime/core/decoder.h
+9 −0 src/libime/core/dictionary.cpp
+7 −8 src/libime/core/dictionary.h
+31 −23 src/libime/core/historybigram.cpp
+5 −1 src/libime/core/historybigram.h
+3 −5 src/libime/core/inputbuffer.cpp
+6 −4 src/libime/core/inputbuffer.h
+22 −4 src/libime/core/languagemodel.cpp
+7 −4 src/libime/core/languagemodel.h
+7 −0 src/libime/core/lattice.cpp
+10 −1 src/libime/core/lattice.h
+3 −4 src/libime/core/lattice_p.h
+8 −6 src/libime/core/lrucache.h
+14 −12 src/libime/core/naivevector.h
+11 −6 src/libime/core/prediction.cpp
+5 −1 src/libime/core/prediction.h
+11 −5 src/libime/core/segmentgraph.cpp
+25 −18 src/libime/core/segmentgraph.h
+5 −2 src/libime/core/triedictionary.cpp
+4 −2 src/libime/core/triedictionary.h
+12 −3 src/libime/core/userlanguagemodel.cpp
+6 −1 src/libime/core/userlanguagemodel.h
+1 −0 src/libime/core/utils.cpp
+5 −2 src/libime/core/utils.h
+1 −2 src/libime/core/utils_p.h
+2 −2 src/libime/core/zstdfilter.h
+2 −2 src/libime/pinyin/CMakeLists.txt
+1 −0 src/libime/pinyin/constants.h
+23 −13 src/libime/pinyin/pinyincontext.cpp
+5 −1 src/libime/pinyin/pinyincontext.h
+15 −1 src/libime/pinyin/pinyincorrectionprofile.cpp
+11 −2 src/libime/pinyin/pinyincorrectionprofile.h
+8 −5 src/libime/pinyin/pinyindata.h
+7 −0 src/libime/pinyin/pinyindecoder.cpp
+7 −1 src/libime/pinyin/pinyindecoder.h
+2 −1 src/libime/pinyin/pinyindecoder_p.h
+51 −22 src/libime/pinyin/pinyindictionary.cpp
+14 −5 src/libime/pinyin/pinyindictionary.h
+23 −8 src/libime/pinyin/pinyinencoder.cpp
+12 −13 src/libime/pinyin/pinyinencoder.h
+7 −0 src/libime/pinyin/pinyinime.cpp
+2 −1 src/libime/pinyin/pinyinime.h
+5 −0 src/libime/pinyin/pinyinmatchstate.cpp
+3 −1 src/libime/pinyin/pinyinmatchstate.h
+16 −9 src/libime/pinyin/pinyinmatchstate_p.h
+1 −1 src/libime/pinyin/pinyinprediction.h
+339 −273 src/libime/pinyin/shuangpinprofile.cpp
+7 −1 src/libime/pinyin/shuangpinprofile.h
+2 −2 src/libime/table/CMakeLists.txt
+16 −5 src/libime/table/autophrasedict.cpp
+1 −1 src/libime/table/autophrasedict.h
+121 −95 src/libime/table/tablebaseddictionary.cpp
+14 −4 src/libime/table/tablebaseddictionary.h
+8 −0 src/libime/table/tablebaseddictionary_p.h
+24 −6 src/libime/table/tablecontext.cpp
+11 −4 src/libime/table/tablecontext.h
+21 −5 src/libime/table/tabledecoder.cpp
+11 −3 src/libime/table/tabledecoder.h
+5 −1 src/libime/table/tabledecoder_p.h
+6 −0 src/libime/table/tableoptions.cpp
+1 −1 src/libime/table/tableoptions.h
+14 −2 src/libime/table/tablerule.cpp
+3 −1 src/libime/table/tablerule.h
+2 −0 test/testautophrasedict.cpp
+10 −2 test/testdecoder.cpp
+9 −3 test/testhistorybigram.cpp
+2 −0 test/testinputbuffer.cpp
+5 −2 test/testmodel.cpp
+4 −0 test/testpinyincontext.cpp
+4 −0 test/testpinyindictionary.cpp
+26 −0 test/testpinyinencoder.cpp
+8 −1 test/testpinyinime.cpp
+29 −2 test/testpinyinime_unit.cpp
+3 −0 test/testprediction.cpp
+9 −0 test/testshuangpinprofile.cpp
+22 −2 test/testtable.cpp
+6 −0 test/testtableime.cpp
+3 −0 test/testtableime_unit.cpp
+5 −2 test/testtrie.cpp
+8 −2 test/testusermodel.cpp
+3 −0 test/testutils.h
+4 −0 test/triebench.cpp
+2 −2 tools/CMakeLists.txt
+25 −45 tools/libime_migrate_fcitx4_pinyin.cpp
+53 −73 tools/libime_migrate_fcitx4_table.cpp
2 changes: 1 addition & 1 deletion libuv
Submodule libuv updated 60 files
+69 −66 .github/workflows/CI-unix.yml
+1 −1 .github/workflows/sanitizer.yml
+1 −0 .mailmap
+3 −1 AUTHORS
+3 −2 CMakeLists.txt
+82 −1 ChangeLog
+1 −0 LINKS.md
+3 −3 MAINTAINERS.md
+2 −1 Makefile.am
+2 −2 SUPPORTED_PLATFORMS.md
+1 −1 configure.ac
+5 −0 docs/src/fs_event.rst
+11 −0 docs/src/misc.rst
+25 −0 docs/src/threading.rst
+2 −0 docs/src/threadpool.rst
+9 −5 docs/src/timer.rst
+14 −0 docs/src/udp.rst
+12 −0 include/uv.h
+6 −0 include/uv/errno.h
+4 −1 include/uv/unix.h
+2 −2 include/uv/version.h
+1 −9 include/uv/win.h
+3 −0 src/fs-poll.c
+1 −1 src/idna.c
+1 −0 src/threadpool.c
+83 −0 src/unix/async.c
+47 −3 src/unix/core.c
+2 −18 src/unix/darwin-proctitle.c
+24 −0 src/unix/internal.h
+17 −12 src/unix/kqueue.c
+45 −30 src/unix/linux.c
+9 −21 src/unix/pipe.c
+98 −0 src/unix/thread.c
+201 −186 src/unix/udp.c
+22 −0 src/uv-common.c
+20 −0 src/uv-common.h
+8 −102 src/win/core.c
+4 −0 src/win/fs-event.c
+197 −8 src/win/fs.c
+9 −3 src/win/pipe.c
+74 −0 src/win/thread.c
+20 −1 src/win/udp.c
+68 −24 src/win/util.c
+0 −13 src/win/winapi.c
+54 −54 src/win/winapi.h
+0 −41 src/win/winsock.h
+14 −0 test/runner.c
+8 −1 test/test-fs-event.c
+54 −0 test/test-fs.c
+19 −7 test/test-idna.c
+10 −0 test/test-list.h
+9 −0 test/test-pipe-getsockname.c
+16 −0 test/test-platform-output.c
+2 −4 test/test-spawn.c
+189 −0 test/test-thread-name.c
+10 −0 test/test-thread.c
+3 −2 test/test-udp-mmsg.c
+17 −2 test/test-udp-multicast-join.c
+1 −0 test/test-udp-multicast-join6.c
+34 −6 test/test-udp-try-send.c
15 changes: 12 additions & 3 deletions patches/libiconv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
cmake_minimum_required(VERSION 3.22.1)
project(libiconv)

set(DLL_VARIABLE "")
set(EILSEQ "")
set(ICONV_CONST "")
set(USE_MBSTATE_T "1")
set(BROKEN_WCHAR_H "0")
set(HAVE_WCHAR_T "1")
configure_file("include/iconv.h.in" "iconv.h" @ONLY)
configure_file("libcharset/include/localcharset.h.in" "localcharset.h" @ONLY)

set(LIBICONV_HEADER
"include/iconv.h"
"${CMAKE_CURRENT_BINARY_DIR}/iconv.h"
)
set(LIBICONV_SOURCE
lib/iconv.c
libcharset/lib/localcharset.c
)

add_library(iconv STATIC ${LIBICONV_SOURCE})
target_include_directories(iconv PRIVATE include libcharset/include)
target_include_directories(iconv PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
install(TARGETS iconv)
install(FILES ${LIBICONV_HEADER} DESTINATION include)
install(FILES ${LIBICONV_HEADER} DESTINATION "include")
58 changes: 0 additions & 58 deletions patches/libiconv/libiconv.patch

This file was deleted.

3 changes: 2 additions & 1 deletion patches/librime-lua.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42f2ebb..4f068d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,7 @@ aux_source_directory(src RIME_LUA_SRC)
@@ -40,6 +40,8 @@ aux_source_directory(src RIME_LUA_SRC)
aux_source_directory(src/lib RIME_LUA_LIB_SRC)

add_library(rime-lua-objs OBJECT ${RIME_LUA_SRC} ${RIME_LUA_LIB_SRC} ${LUA_SRC})
+target_compile_options(rime-lua-objs PRIVATE "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
+target_compile_definitions(rime-lua-objs PRIVATE BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS)
if(BUILD_SHARED_LIBS)
set_target_properties(rime-lua-objs PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
Expand Down
3 changes: 2 additions & 1 deletion patches/librime-octagram.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4115fa7..162ffb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.10)
@@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.10)
aux_source_directory(src octagram_src)

add_library(rime-octagram-objs OBJECT ${octagram_src})
+target_compile_options(rime-octagram-objs PRIVATE "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
+target_compile_definitions(rime-octagram-objs PRIVATE BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS)
if(BUILD_SHARED_LIBS)
set_target_properties(rime-octagram-objs
PROPERTIES
3 changes: 2 additions & 1 deletion patches/librime-predict.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07703bf..5ab6d3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.10)
@@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.10)
aux_source_directory(src predict_src)

add_library(rime-predict-objs OBJECT ${predict_src})
+target_compile_options(rime-predict-objs PRIVATE "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
+target_compile_definitions(rime-predict-objs PRIVATE BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS)
if(BUILD_SHARED_LIBS)
set_target_properties(rime-predict-objs
PROPERTIES
2 changes: 1 addition & 1 deletion patches/librime.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index 16082869..c4a5b5ca 100644
add_library(rime-static STATIC ${rime_src})
target_link_libraries(rime-static ${rime_deps})
+ target_compile_options(rime-static PRIVATE "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
+ target_compile_definitions(rime-static PRIVATE BOOST_DISABLE_CURRENT_LOCATION)
+ target_compile_definitions(rime-static PRIVATE BOOST_DISABLE_CURRENT_LOCATION BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS)
set_target_properties(rime-static PROPERTIES
OUTPUT_NAME "rime" PREFIX "lib"
ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
Expand Down
3 changes: 2 additions & 1 deletion patches/libuv.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28c6df256..3ec932e54 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,6 +277,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
@@ -277,6 +277,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
src/unix/random-getentropy.c
src/unix/random-getrandom.c
src/unix/random-sysctl-linux.c)
+ list(APPEND uv_defines LLONG_MAX=0x7fffffffffffffffLL)
+ if(ANDROID_PLATFORM_LEVEL LESS 24)
+ list(APPEND uv_sources
+ src/unix/android-ifaddrs.c)
Expand Down
14 changes: 14 additions & 0 deletions patches/lua.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/lua-5.4.7/src/liolib.c b/lua-5.4.7/src/liolib.c
index c5075f3..1946943 100644
--- a/lua-5.4.7/src/liolib.c
+++ b/lua-5.4.7/src/liolib.c
@@ -115,7 +115,8 @@ static int l_checkmode (const char *mode) {

#if !defined(l_fseek) /* { */

-#if defined(LUA_USE_POSIX) /* { */
+#if defined(LUA_USE_POSIX) && \
+ (!defined(ANDROID) || (defined(__LP64__) || ANDROID_PLATFORM >= 24)) /* { */

#include <sys/types.h>

2 changes: 1 addition & 1 deletion prebuilder.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ executable prebuilder
CMakeBuilder
Rules.AnthyData
Rules.Boost
Rules.Fcitx5Data
Rules.Fcitx5
Rules.Fmt
Rules.GLog
Rules.LevelDB
Expand Down
4 changes: 2 additions & 2 deletions src/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ execute :: String -> (CmdArguments args) => args :-> Action ()
execute tool =
cmdArguments
( CmdArgument
[ Right (outputDir </> "bin" </> tool),
Left (AddEnv "LD_LIBRARY_PATH" (outputDir </> "lib"))
[ Right (outputDir </> "host" </> "bin" </> tool),
Left (AddEnv "LD_LIBRARY_PATH" (outputDir </> "host" </> "lib"))
]
)

Expand Down
13 changes: 9 additions & 4 deletions src/CMakeBuilder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ data CmakeBuilder q = CmakeBuilder
doInstall :: Bool,
-- | path the cmake file
-- if not specified, run cmake in source dir
cmakeFile :: Maybe FilePath
cmakeFile :: Maybe FilePath,
-- | Additional cmake environment variables
cmakeEnv :: BuildEnv -> [(String, String)]
}

cmakeBuilder :: String -> CmakeBuilder b
Expand All @@ -83,7 +85,8 @@ cmakeBuilder name =
source = const $ pure name,
name = name,
doInstall = True,
cmakeFile = Nothing
cmakeFile = Nothing,
cmakeEnv = const mempty
}

useCMake ::
Expand All @@ -107,9 +110,11 @@ useCMake CmakeBuilder {..} = addOracle $ \(WithAndroidEnv q env) -> do
forM_ abiList $ \a -> do
let bEnv@BuildEnv {..} = buildEnv a
unBuildActionABI preBuildEachABI q bEnv
let cmakeEnvOptions = [AddEnv k v | (k, v) <- cmakeEnv bEnv]
cmd_
(Cwd src)
(AddPath [] [ ninja ])
(AddPath [] [ninja])
cmakeEnvOptions
cmake
"-B"
buildEnvBuildDir
Expand All @@ -124,7 +129,7 @@ useCMake CmakeBuilder {..} = addOracle $ \(WithAndroidEnv q env) -> do
<> cmakeFlags bEnv
)
(maybeToList cmakeFile)
cmd_ (Cwd src) cmake "--build" buildEnvBuildDir
cmd_ (Cwd src) cmakeEnvOptions cmake "--build" buildEnvBuildDir
when doInstall $
cmd_ (Cwd src) cmake "--install" buildEnvBuildDir
unBuildActionABI postBuildEachABI q bEnv
Expand Down
3 changes: 2 additions & 1 deletion src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Data.Text.Lazy.Builder qualified as TLB
import Development.Shake.Config
import Rules.AnthyData
import Rules.Boost
import Rules.Fcitx5Data
import Rules.Fcitx5
import Rules.Fmt
import Rules.GLog
import Rules.LevelDB
Expand Down Expand Up @@ -49,6 +49,7 @@ main = do
want files
usingConfigFile "build.cfg"
downloadFileRule
hostFcitx5Rule
spellDictRule
libIMERule
chineseAddonsRule
Expand Down
2 changes: 2 additions & 0 deletions src/Rules/Boost.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ boostRule = do
<> intercalate
";"
[ "atomic",
"asio",
"charconv",
"chrono",
"cobalt",
"context",
"contract",
"coroutine",
Expand Down
Loading