feat: use librime's bundled opencc

Drop the duplicated app/src/main/jni/OpenCC submodule, and build OpenCC from
librime/deps/opencc instead.

The opencc already is one dependency of librime, we should use it
instead of adding new submodule.
This commit is contained in:
Bambooin 2026-10-17 21:33:05 +08:00
parent 3f0eb5203b
commit f5008260dc
6 changed files with 4 additions and 9 deletions

3
.gitmodules vendored
View File

@ -2,9 +2,6 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
[submodule "OpenCC"]
path = app/src/main/jni/OpenCC
url = https://github.com/BYVoid/OpenCC.git
[submodule "snappy"]
path = app/src/main/jni/snappy
url = https://github.com/google/snappy.git

View File

@ -47,7 +47,7 @@ target_compile_options(
set(LIBMARISA marisa)
option(USE_SYSTEM_MARISA "" ON)
add_subdirectory(OpenCC)
add_subdirectory(librime/deps/opencc)
include(OpenccWorkarounds)
set(X11Keysym "${CMAKE_SOURCE_DIR}/librime/include")

@ -1 +0,0 @@
Subproject commit 025f371dc76b598d77384fbdab90c937471844d8

View File

@ -4,6 +4,5 @@
# Since OpenCC doesn't include its headers in the binary dir, we need to install
# them manually.
file(GLOB LIBOPENCC_HEADERS OpenCC/src/*.hpp
"${CMAKE_BINARY_DIR}/OpenCC/src/opencc_config.h")
file(GLOB LIBOPENCC_HEADERS librime/deps/opencc/src/*.hpp)
file(COPY ${LIBOPENCC_HEADERS} DESTINATION "${CMAKE_BINARY_DIR}/include/opencc")

View File

@ -19,7 +19,7 @@ class NativeAppConventionPlugin : NativeBaseConventionPlugin() {
private val Project.openccVersion: String
get() =
runCmd(
"git -C app/src/main/jni/OpenCC describe --tags --long --always",
"git -C app/src/main/jni/librime/deps/opencc describe --tags --long --always",
)
override fun apply(target: Project) {

View File

@ -26,7 +26,7 @@ class OpenCCDataPlugin : Plugin<Project> {
}
private val Project.dataBaseDir
get() = file("src/main/jni/OpenCC/data")
get() = file("src/main/jni/librime/deps/opencc/data")
private val Project.dataInstallDir
get() = assetsDir.resolve("shared/opencc")