Skip to content

Commit

Permalink
feat: update fcitx5 to 5.0.21
Browse files Browse the repository at this point in the history
Next generation of Fcitx Input Method Framework

Issue: deepin-community/sig-deepin-sysdev-team#552
Log: update repo
  • Loading branch information
xzl01 committed Dec 2, 2024
1 parent ca11396 commit 21a95df
Show file tree
Hide file tree
Showing 484 changed files with 13,109 additions and 29,748 deletions.
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6.0)
project(fcitx VERSION 5.1.10)
project(fcitx VERSION 5.0.21)
set(FCITX_VERSION ${PROJECT_VERSION})

find_package(ECM REQUIRED 1.0.0)
Expand Down Expand Up @@ -31,7 +31,7 @@ option(ENABLE_DBUS "Enable DBus" On)
option(ENABLE_DOC "Build doxygen" Off)
option(ENABLE_SERVER "Build a fcitx as server, disable this option if you want to use fcitx as an embedded library." On)
option(ENABLE_KEYBOARD "Enable key event translation with XKB and build keyboard engine" On)
option(USE_SYSTEMD "Use systemd for event loop and dbus, will fallback to libuv/libdbus if not found." On)
option(USE_SYSTEMD "Use systemd for event loop and dbus, will fallback to libevent/libdbus if not found." On)
option(ENABLE_XDGAUTOSTART "Enable xdg autostart desktop file installation" On)
option(USE_FLATPAK_ICON "Use flatpak icon name for desktop files" Off)
option(ENABLE_EMOJI "Enable emoji module" On)
Expand Down Expand Up @@ -69,11 +69,14 @@ if (NOT TARGET Systemd::Systemd)
pkg_get_variable(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "dbus-1" "system_bus_default_address")
endif()

if (NOT LIBUV_TARGET)
if (NOT (TARGET PkgConfig::LibUV))
pkg_check_modules(LibUV REQUIRED IMPORTED_TARGET "libuv")
endif()
set(LIBUV_TARGET PkgConfig::LibUV)
if (NOT (TARGET libevent::core OR TARGET PkgConfig::LibEvent))
find_package(Libevent)
endif()
if (TARGET libevent::core)
set(LIBEVENT_TARGET libevent::core)
else()
pkg_check_modules(LibEvent REQUIRED IMPORTED_TARGET "libevent_core")
set(LIBEVENT_TARGET PkgConfig::LibEvent)
endif()
endif()

Expand Down Expand Up @@ -124,8 +127,8 @@ if (ENABLE_KEYBOARD)
pkg_check_modules(JsonC REQUIRED IMPORTED_TARGET "json-c")

set(DEFAULT_XKB_RULES_FILES "${XKEYBOARDCONFIG_XKBBASE}/rules/${DEFAULT_XKB_RULES}.xml")
if (NOT EXISTS "${DEFAULT_XKB_RULES_FILES}" AND NOT APPLE)
message(WARNING "Could not find default xkb rules file: ${DEFAULT_XKB_RULES_FILES}")
if (NOT EXISTS "${DEFAULT_XKB_RULES_FILES}")
message(FATAL_ERROR "Could not find default xkb rules file: ${DEFAULT_XKB_RULES_FILES}")
endif()
endif()

Expand All @@ -138,7 +141,7 @@ if (ENABLE_X11 OR ENABLE_WAYLAND)
endif()

if (ENABLE_WAYLAND)
set(REQUIRED_WAYLAND_COMPONENTS Client Cursor)
set(REQUIRED_WAYLAND_COMPONENTS Client)
find_package(Wayland REQUIRED COMPONENTS ${REQUIRED_WAYLAND_COMPONENTS})
find_package(WaylandScanner REQUIRED)
find_package(WaylandProtocols REQUIRED)
Expand Down
7 changes: 2 additions & 5 deletions cmake/Fcitx5CompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ set(CMAKE_C_STANDARD 99)

set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}")

if(NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")
endif()
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
Expand Down
16 changes: 6 additions & 10 deletions cmake/FindIsoCodes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ endif(ISOCODES_INCLUDE_DIR AND ISOCODES_LIBRARIES)
find_package(PkgConfig)
pkg_check_modules(PC_ISOCODES iso-codes)

if(NOT DEFINED ISOCODES_ISO639_JSON)
find_file(ISOCODES_ISO639_JSON iso_639-3.json
HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
)
endif()
find_file(ISOCODES_ISO639_JSON iso_639-3.json
HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
)

if(NOT DEFINED ISOCODES_ISO3166_JSON)
find_file(ISOCODES_ISO3166_JSON iso_3166-1.json
HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
)
endif()
find_file(ISOCODES_ISO3166_JSON iso_3166-1.json
HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IsoCodes DEFAULT_MSG ISOCODES_ISO639_JSON ISOCODES_ISO3166_JSON)
Expand Down
8 changes: 2 additions & 6 deletions cmake/FindXKeyboardConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ find_package(PkgConfig)

pkg_check_modules(PKG_XKEYBOARDCONFIG QUIET xkeyboard-config)

if(NOT DEFINED XKEYBOARDCONFIG_XKBBASE)
pkg_get_variable(XKEYBOARDCONFIG_XKBBASE xkeyboard-config xkb_base)
endif()
if(NOT DEFINED XKEYBOARDCONFIG_DATADIR)
pkg_get_variable(XKEYBOARDCONFIG_DATADIR xkeyboard-config datadir)
endif()
pkg_get_variable(XKEYBOARDCONFIG_XKBBASE xkeyboard-config xkb_base)
pkg_get_variable(XKEYBOARDCONFIG_DATADIR xkeyboard-config datadir)

set(XKEYBOARDCONFIG_VERSION ${PKG_XKEYBOARDCONFIG_VERSION})
mark_as_advanced(XKEYBOARDCONFIG_VERSION)
Expand Down
2 changes: 0 additions & 2 deletions data/20-fcitx-x11.in

This file was deleted.

15 changes: 0 additions & 15 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,3 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fcitx5-diagnose" DESTINATION "${FCITX
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

install(DIRECTORY default DESTINATION "${FCITX_INSTALL_PKGDATADIR}" COMPONENT config)

if (WAYLAND_FOUND AND ENABLE_X11)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/20-fcitx-x11.in
${CMAKE_CURRENT_BINARY_DIR}/20-fcitx-x11 @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/20-fcitx-x11" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/Xwayland-session.d" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()

if (ENABLE_DBUS AND WAYLAND_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcitx5-wayland-launcher.desktop.in.in
${CMAKE_CURRENT_BINARY_DIR}/fcitx5-wayland-launcher.desktop.in @ONLY)
fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/fcitx5-wayland-launcher.desktop.in
fcitx5-wayland-launcher.desktop)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fcitx5-wayland-launcher.desktop"
DESTINATION "${FCITX_INSTALL_DATADIR}/applications")
endif()
17 changes: 7 additions & 10 deletions data/fcitx5-configtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

export TEXTDOMAIN=fcitx5

if command -v kdialog > /dev/null 2>&1; then
if which kdialog > /dev/null 2>&1; then
message() {
kdialog --msgbox "$1"
}
error() {
kdialog --error "$1"
}
elif command -v zenity > /dev/null 2>&1; then
elif which zenity > /dev/null 2>&1; then
message() {
zenity --info --text="$1"
}
Expand All @@ -28,7 +28,7 @@ else
}
fi

if command -v gettext > /dev/null 2>&1; then
if which gettext > /dev/null 2>&1; then
_() {
gettext "$@"
}
Expand Down Expand Up @@ -108,21 +108,18 @@ detectDE() {
if [ x"$DE" = x"gnome" ]; then
# gnome-default-applications-properties is only available in GNOME 2.x
# but not in GNOME 3.x
command -v gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3"
which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3"
fi
}

run_kde() {
if (systemsettings --list 2>/dev/null | grep ^kcm_fcitx5 > /dev/null 2>&1); then
exec systemsettings kcm_fcitx5
fi
if (systemsettings5 --list 2>/dev/null | grep ^kcm_fcitx5 > /dev/null 2>&1); then
exec systemsettings5 kcm_fcitx5
fi
}

run_qt() {
if command -v fcitx5-config-qt > /dev/null 2>&1; then
if which fcitx5-config-qt > /dev/null 2>&1; then
exec fcitx5-config-qt
fi
return 1
Expand All @@ -138,13 +135,13 @@ run_xdg() {
;;
esac

if command="$(command -v xdg-open 2>/dev/null)"; then
if command="$(which xdg-open 2>/dev/null)"; then
exec "$command" "$HOME/.config/fcitx5"
fi
}

_which_cmdline() {
cmd="$(command -v "$1")" || return 1
cmd="$(which "$1")" || return 1
shift
echo "$cmd $*"
}
Expand Down
Loading

0 comments on commit 21a95df

Please sign in to comment.