summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorGabriel Ebner <gebner@gebner.org>2019-09-10 22:50:45 +0100
committerGitHub <noreply@github.com>2019-09-10 22:50:45 +0100
commit9c71e5f5948581797117652839cbad8ad4e1a8de (patch)
tree730c0ebdb8ee9312128445d6fed46c6e4bbb17cd /pkgs/tools
parent93bf6e26485280e9cfe811e4e5b6f30673e31347 (diff)
parentc055ac14a507fed407eb0361e13e0cc332d80ebe (diff)
downloadnixpkgs-9c71e5f5948581797117652839cbad8ad4e1a8de.tar
nixpkgs-9c71e5f5948581797117652839cbad8ad4e1a8de.tar.gz
nixpkgs-9c71e5f5948581797117652839cbad8ad4e1a8de.tar.bz2
nixpkgs-9c71e5f5948581797117652839cbad8ad4e1a8de.tar.lz
nixpkgs-9c71e5f5948581797117652839cbad8ad4e1a8de.tar.xz
nixpkgs-9c71e5f5948581797117652839cbad8ad4e1a8de.tar.zst
nixpkgs-9c71e5f5948581797117652839cbad8ad4e1a8de.zip
Merge pull request #67856 from averelld/fcitx-use-enchant2
fcitx: use enchant2
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch42
-rw-r--r--pkgs/tools/inputmethods/fcitx/unwrapped.nix6
2 files changed, 46 insertions, 2 deletions
diff --git a/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch b/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch
new file mode 100644
index 00000000000..90c9c79aa73
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch
@@ -0,0 +1,42 @@
+diff --git a/cmake/FindEnchant.cmake b/cmake/FindEnchant.cmake
+index 7c182e6a..5537595e 100644
+--- a/cmake/FindEnchant.cmake
++++ b/cmake/FindEnchant.cmake
+@@ -16,7 +16,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ endif(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ 
+ find_package(PkgConfig)
+-pkg_check_modules(PC_ENCHANT enchant)
++pkg_check_modules(PC_ENCHANT enchant-2)
+ 
+ find_path(ENCHANT_INCLUDE_DIR
+   NAMES enchant.h
+@@ -24,7 +24,7 @@ find_path(ENCHANT_INCLUDE_DIR
+   PATH_SUFFIXES "enchant")
+ 
+ find_library(ENCHANT_LIBRARIES
+-  NAMES enchant
++  NAMES enchant-2
+   HINTS ${PC_ENCHANT_LIBRARY_DIRS})
+ 
+ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+@@ -39,7 +39,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+   #include <stdlib.h>
+   #include <stddef.h>
+   #include <string.h>
+-  #include <enchant/enchant.h>
++  #include <enchant-2/enchant.h>
+ 
+   EnchantBroker *enchant_broker_init();
+   char **enchant_dict_suggest(EnchantDict *dict, const char *str,
+@@ -78,6 +78,10 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
+ endif()
+ 
++if(ENCHANT_API_COMPATIBLE)
++  set(ENCHANT_LIBRARY_FILENAME ${ENCHANT_LIBRARIES})
++endif(ENCHANT_API_COMPATIBLE)
++
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Enchant DEFAULT_MSG ENCHANT_LIBRARIES
+   ENCHANT_INCLUDE_DIR ENCHANT_API_COMPATIBLE)
diff --git a/pkgs/tools/inputmethods/fcitx/unwrapped.nix b/pkgs/tools/inputmethods/fcitx/unwrapped.nix
index 34dd3ac3509..636cb518fd2 100644
--- a/pkgs/tools/inputmethods/fcitx/unwrapped.nix
+++ b/pkgs/tools/inputmethods/fcitx/unwrapped.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, cmake, intltool, gettext
-, libxml2, enchant1, isocodes, icu, libpthreadstubs
+, libxml2, enchant2, isocodes, icu, libpthreadstubs
 , pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon
 , dbus, gtk2, gtk3, qt4, extra-cmake-modules
 , xkeyboard_config, pcre, libuuid
@@ -59,6 +59,8 @@ stdenv.mkDerivation rec {
   ''
   ;
 
+  patches = [ ./find-enchant-lib.patch ];
+
   postPatch = ''
     substituteInPlace src/frontend/qt/CMakeLists.txt \
       --replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins
@@ -69,7 +71,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake extra-cmake-modules intltool pkgconfig pcre ];
 
   buildInputs = [
-    xkeyboard_config enchant1 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile
+    xkeyboard_config enchant2 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile
     libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid
   ];