summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-09-03 14:39:08 +0200
committerJan Tojnar <jtojnar@gmail.com>2019-09-03 15:46:20 +0200
commitb73406d863bc666509766409693ef383f043a828 (patch)
tree5f9d6ed9c9f838582c29fcfeb6d9d2af537d6010
parent743a62673f4e00ae74b826643b1445371e0378fe (diff)
downloadnixpkgs-b73406d863bc666509766409693ef383f043a828.tar
nixpkgs-b73406d863bc666509766409693ef383f043a828.tar.gz
nixpkgs-b73406d863bc666509766409693ef383f043a828.tar.bz2
nixpkgs-b73406d863bc666509766409693ef383f043a828.tar.lz
nixpkgs-b73406d863bc666509766409693ef383f043a828.tar.xz
nixpkgs-b73406d863bc666509766409693ef383f043a828.tar.zst
nixpkgs-b73406d863bc666509766409693ef383f043a828.zip
ibus-engines.hangul: fix ibus-setup-hangul
Closes: https://github.com/NixOS/nixpkgs/issues/27619
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix17
-rw-r--r--pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch13
2 files changed, 27 insertions, 3 deletions
diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
index 9d1c8c5cc1b..0a38ccfa3bd 100644
--- a/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
@@ -1,7 +1,9 @@
 { stdenv
 , fetchurl
+, substituteAll
 , intltool
 , pkgconfig
+, wrapGAppsHook
 , gtk3
 , ibus
 , libhangul
@@ -17,21 +19,30 @@ stdenv.mkDerivation rec {
     sha256 = "0gha8dfdf54rx8fv3yfikbgdg6lqq6l883lhg7q68ybvkjx9bwbs";
   };
 
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      libhangul = "${libhangul}/lib/libhangul.so.1";
+    })
+  ];
+
   nativeBuildInputs = [
     intltool
     pkgconfig
     python3.pkgs.wrapPython
+    wrapGAppsHook
   ];
 
   buildInputs = [
     gtk3
     ibus
     libhangul
-    python3
+    (python3.withPackages (pypkgs: with pypkgs; [
+      pygobject3
+      (toPythonModule ibus)
+    ]))
   ];
 
-  postFixup = "wrapPythonPrograms";
-
   meta = with stdenv.lib; {
     isIbusEngine = true;
     description = "Ibus Hangul engine";
diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch
new file mode 100644
index 00000000000..7487d074d55
--- /dev/null
+++ b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/setup/main.py b/setup/main.py
+index 8d581cd..2ac47b9 100644
+--- a/setup/main.py
++++ b/setup/main.py
+@@ -37,7 +37,7 @@
+ 
+ def get_hangul_keyboard_list():
+     from ctypes import CDLL, c_int, c_char_p
+-    libhangul = CDLL('libhangul.so.1')
++    libhangul = CDLL('@libhangul@')
+     libhangul.hangul_ic_get_n_keyboards.argtypes = []
+     libhangul.hangul_ic_get_n_keyboards.restype = c_int
+     libhangul.hangul_ic_get_keyboard_id.argtypes = [c_int]