fcitx: use enchant2

+46 -2
+42
pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch
···
··· 1 + diff --git a/cmake/FindEnchant.cmake b/cmake/FindEnchant.cmake 2 + index 7c182e6a..5537595e 100644 3 + --- a/cmake/FindEnchant.cmake 4 + +++ b/cmake/FindEnchant.cmake 5 + @@ -16,7 +16,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) 6 + endif(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) 7 + 8 + find_package(PkgConfig) 9 + -pkg_check_modules(PC_ENCHANT enchant) 10 + +pkg_check_modules(PC_ENCHANT enchant-2) 11 + 12 + find_path(ENCHANT_INCLUDE_DIR 13 + NAMES enchant.h 14 + @@ -24,7 +24,7 @@ find_path(ENCHANT_INCLUDE_DIR 15 + PATH_SUFFIXES "enchant") 16 + 17 + find_library(ENCHANT_LIBRARIES 18 + - NAMES enchant 19 + + NAMES enchant-2 20 + HINTS ${PC_ENCHANT_LIBRARY_DIRS}) 21 + 22 + if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) 23 + @@ -39,7 +39,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) 24 + #include <stdlib.h> 25 + #include <stddef.h> 26 + #include <string.h> 27 + - #include <enchant/enchant.h> 28 + + #include <enchant-2/enchant.h> 29 + 30 + EnchantBroker *enchant_broker_init(); 31 + char **enchant_dict_suggest(EnchantDict *dict, const char *str, 32 + @@ -78,6 +78,10 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) 33 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") 34 + endif() 35 + 36 + +if(ENCHANT_API_COMPATIBLE) 37 + + set(ENCHANT_LIBRARY_FILENAME ${ENCHANT_LIBRARIES}) 38 + +endif(ENCHANT_API_COMPATIBLE) 39 + + 40 + include(FindPackageHandleStandardArgs) 41 + find_package_handle_standard_args(Enchant DEFAULT_MSG ENCHANT_LIBRARIES 42 + ENCHANT_INCLUDE_DIR ENCHANT_API_COMPATIBLE)
+4 -2
pkgs/tools/inputmethods/fcitx/unwrapped.nix
··· 1 { stdenv, fetchurl, pkgconfig, cmake, intltool, gettext 2 - , libxml2, enchant1, isocodes, icu, libpthreadstubs 3 , pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon 4 , dbus, gtk2, gtk3, qt4, extra-cmake-modules 5 , xkeyboard_config, pcre, libuuid ··· 59 '' 60 ; 61 62 postPatch = '' 63 substituteInPlace src/frontend/qt/CMakeLists.txt \ 64 --replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins ··· 69 nativeBuildInputs = [ cmake extra-cmake-modules intltool pkgconfig pcre ]; 70 71 buildInputs = [ 72 - xkeyboard_config enchant1 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile 73 libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid 74 ]; 75
··· 1 { stdenv, fetchurl, pkgconfig, cmake, intltool, gettext 2 + , libxml2, enchant2, isocodes, icu, libpthreadstubs 3 , pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon 4 , dbus, gtk2, gtk3, qt4, extra-cmake-modules 5 , xkeyboard_config, pcre, libuuid ··· 59 '' 60 ; 61 62 + patches = [ ./find-enchant-lib.patch ]; 63 + 64 postPatch = '' 65 substituteInPlace src/frontend/qt/CMakeLists.txt \ 66 --replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins ··· 71 nativeBuildInputs = [ cmake extra-cmake-modules intltool pkgconfig pcre ]; 72 73 buildInputs = [ 74 + xkeyboard_config enchant2 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile 75 libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid 76 ]; 77