Merge 4cf4f23d70336b2857a2cf79edf1fee3d3eb5599 into bcb694384de8462302448cab6a3dfb1853ba5d5e

This commit is contained in:
Qijia Liu 2026-07-30 17:15:55 +08:00 committed by GitHub
commit 7a8dae9ecc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 148 additions and 0 deletions

3
.gitmodules vendored
View File

@ -56,3 +56,6 @@
[submodule "plugin/thai/src/main/cpp/fcitx5-libthai"]
path = plugin/thai/src/main/cpp/fcitx5-libthai
url = https://github.com/fcitx/fcitx5-libthai
[submodule "plugin/m17n/src/main/cpp/fcitx5-m17n"]
path = plugin/m17n/src/main/cpp/fcitx5-m17n
url = https://github.com/fcitx/fcitx5-m17n

View File

@ -548,6 +548,7 @@ Java_org_fcitx_fcitx5_android_core_Fcitx_startupFcitx(
fcitx::stringutils::joinPath(usr_share, "lua", "5.4", "?.so"), ";",
";"
);
const std::string m17n_dir = fcitx::stringutils::joinPath(usr_share, "m17n");
// prevent StandardPath from resolving it's hardcoded installation path
// setenv("SKIP_FCITX_PATH", "1", 1);
@ -578,6 +579,7 @@ Java_org_fcitx_fcitx5_android_core_Fcitx_startupFcitx(
setenv("XDG_RUNTIME_DIR", extCache_, 1);
setenv("LUA_PATH", lua_path.c_str(), 1);
setenv("LUA_CPATH", lua_cpath.c_str(), 1);
setenv("M17NDIR", m17n_dir.c_str(), 1);
const char *locale_dir_char = locale_dir.c_str();
fcitx::registerDomain("fcitx5", locale_dir_char);

View File

@ -0,0 +1,52 @@
plugins {
id("org.fcitx.fcitx5.android.app-convention")
id("org.fcitx.fcitx5.android.plugin-app-convention")
id("org.fcitx.fcitx5.android.native-app-convention")
id("org.fcitx.fcitx5.android.build-metadata")
id("org.fcitx.fcitx5.android.data-descriptor")
id("org.fcitx.fcitx5.android.fcitx-component")
}
android {
namespace = "org.fcitx.fcitx5.android.plugin.m17n"
defaultConfig {
applicationId = "org.fcitx.fcitx5.android.plugin.m17n"
@Suppress("UnstableApiUsage")
externalNativeBuild {
cmake {
targets(
"m17n"
)
}
}
}
buildTypes {
release {
resValue("string", "app_name", "@string/app_name_release")
}
debug {
resValue("string", "app_name", "@string/app_name_debug")
}
}
packaging {
jniLibs {
excludes += setOf(
"**/libc++_shared.so",
"**/libFcitx5*"
)
}
}
}
fcitxComponent {
installPrebuiltAssets = true
}
dependencies {
implementation(project(":lib:fcitx5"))
implementation(project(":lib:plugin-base"))
}

View File

@ -0,0 +1,11 @@
{
"uniqueId": "fcitx/fcitx5-m17n",
"artifactVersion": "5.1.5",
"description": "M17n Wrapper for Fcitx",
"name": "fcitx/fcitx5-m17n",
"website": "https://github.com/fcitx/fcitx5-m17n",
"tag": "native",
"licenses": [
"LGPL-2.1-or-later"
]
}

View File

@ -0,0 +1,11 @@
{
"uniqueId": "GNU/glibc",
"artifactVersion": "2.42",
"description": "GNU C Library",
"name": "GNU/glibc",
"website": "https://sourceware.org/glibc/",
"tag": "native",
"licenses": [
"LGPL-2.1-or-later"
]
}

View File

@ -0,0 +1,11 @@
{
"uniqueId": "NonGNU/m17n-db",
"artifactVersion": "1.8.10",
"description": "Multilingual text processing library (database)",
"name": "NonGNU/m17n-db",
"website": "https://www.nongnu.org/m17n/",
"tag": "native",
"licenses": [
"LGPL-2.1-or-later"
]
}

View File

@ -0,0 +1,11 @@
{
"uniqueId": "NonGNU/m17n-lib",
"artifactVersion": "1.8.6",
"description": "Multilingual text processing library (runtimes)",
"name": "NonGNU/m17n-lib",
"website": "https://www.nongnu.org/m17n/",
"tag": "native",
"licenses": [
"LGPL-2.1-or-later"
]
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="@string/app_name" />
</manifest>

View File

@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.18)
project(fcitx5-android-plugin-m17n VERSION ${VERSION_NAME})
# For reproducible build
add_link_options("LINKER:--hash-style=gnu,--build-id=none")
# prefab dependency
find_package(fcitx5 REQUIRED CONFIG)
get_target_property(FCITX5_CMAKE_MODULES fcitx5::cmake INTERFACE_INCLUDE_DIRECTORIES)
set(CMAKE_MODULE_PATH ${FCITX5_CMAKE_MODULES} ${CMAKE_MODULE_PATH})
find_package(ECM MODULE)
find_package(Fcitx5Core MODULE)
find_package(Fcitx5Module MODULE)
add_library(M17n_static STATIC IMPORTED)
set_target_properties(M17n_static PROPERTIES
IMPORTED_LOCATION "${PREBUILT_DIR}/m17n-lib/${ANDROID_ABI}/lib/libm17n.a"
INTERFACE_INCLUDE_DIRECTORIES "${PREBUILT_DIR}/m17n-lib/${ANDROID_ABI}/include"
)
set(M17N_TARGET M17n_static)
option(ENABLE_TEST "" OFF)
add_subdirectory(fcitx5-m17n)
install(DIRECTORY "${PREBUILT_DIR}/m17n-db/" DESTINATION "${FCITX_INSTALL_DATADIR}/m17n" COMPONENT prebuilt-assets)

@ -0,0 +1 @@
Subproject commit a1af9d00296a57d3567b08ea18aea24509a33f09

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name_debug">Fcitx5 (M17n Plugin | Debug)</string>
<string name="app_name_release">Fcitx5 (M17n Plugin)</string>
<string name="description">M17n (multilingualization) engine support for Fcitx5</string>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="../../../../../pluginSchema.xsd">
<apiVersion>0.1</apiVersion>
<domain>fcitx5-m17n</domain>
<description>@string/description</description>
</plugin>

View File

@ -35,3 +35,4 @@ include(":plugin:chewing")
include(":plugin:sayura")
include(":plugin:jyutping")
include(":plugin:thai")
include(":plugin:m17n")