gnu: ibus: Use new ucd package.
[jackhill/guix/guix.git] / gnu / packages / ibus.scm
index b761060..c0766c0 100644 (file)
@@ -3,8 +3,9 @@
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019 Meiyo Peng <meiyo@disroot.org>
+;;; Copyright © 2020 kanichos <kanichos@yandex.ru>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages textutils)
+  #:use-module (gnu packages unicode)
   #:use-module (gnu packages xorg))
 
 (define-public ibus
   (package
     (name "ibus")
-    (version "1.5.20")
+    (version "1.5.21")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/ibus/ibus/"
                                   version "/ibus-" version ".tar.gz"))
               (sha256
                (base32
-                "0d6hcbw6ai91jl87lqnyn8bxi5y5kba5i9nz7knknyh69g5fbwac"))))
+                "1fd2d1jqpp1nn74x04zcilhhab0zar82n0kg614rma6n43kfbhdd"))))
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:tests? #f  ; tests fail because there's no connection to dbus
-       #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
-                           "--enable-python-library"
-                           ,(string-append "--with-ucd-dir="
-                                           (getcwd) "/ucd")
-                           "--enable-wayland")
+       #:parallel-build? #f ; race condition discovered with emoji support
+       #:configure-flags (list "--enable-python-library"
+                               (string-append
+                                "--with-unicode-emoji-dir="
+                                (assoc-ref %build-inputs "unicode-emoji")
+                                "/share/unicode/emoji")
+                               (string-append
+                                "--with-emoji-annotation-dir="
+                                (assoc-ref %build-inputs "unicode-cldr-common")
+                                "/share/unicode/cldr/common/annotations")
+                               (string-append "--with-ucd-dir="
+                                              (assoc-ref %build-inputs "ucd")
+                                              "/share/ucd")
+                               "--enable-wayland")
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'prepare-ucd-dir
-           (lambda* (#:key inputs #:allow-other-keys)
-             (mkdir-p "../ucd")
-             (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
-             (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
-             #t))
          (add-after 'unpack 'patch-python-target-directories
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((root (string-append (assoc-ref outputs "out")
                                "/share/X11/locale")))
              (substitute* "ui/gtk3/xkblayout.vala"
                (("\"(setxkbmap|xmodmap)\"" _ prog)
-                (string-append "\"" (assoc-ref inputs prog) "\"")))
+                (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\"")))
              #t))
          (add-after 'wrap-program 'wrap-with-additional-paths
            (lambda* (#:key outputs #:allow-other-keys)
     (native-inputs
      `(("glib" ,glib "bin") ; for glib-genmarshal
        ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
-
-       ;; XXX TODO: Move Unicode data to its own (versioned) package.
-       ("unicode-nameslist"
-        ,(origin
-           (method url-fetch)
-           (uri "https://www.unicode.org/Public/12.0.0/ucd/NamesList.txt")
-           (sha256
-            (base32 "0vsq8gx7hws8mvxy3nlglpwxw7ky57q0fs09d7w9xgb2ylk7fz61"))))
-       ("unicode-blocks"
-        ,(origin
-           (method url-fetch)
-           (uri "https://www.unicode.org/Public/12.0.0/ucd/Blocks.txt")
-           (sha256
-            (base32 "041sk54v6rjzb23b9x7yjdwzdp2wc7gvfz7ybavgg4gbh51wm8x1"))))
+       ("ucd" ,ucd)
+       ("unicode-emoji" ,unicode-emoji)
+       ("unicode-cldr-common" ,unicode-cldr-common)
        ("vala" ,vala)
        ("pkg-config" ,pkg-config)))
     (native-search-paths
@@ -179,7 +173,7 @@ may also simplify input method development.")
 (define-public ibus-libpinyin
   (package
     (name "ibus-libpinyin")
-    (version "1.11.0")
+    (version "1.11.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
@@ -187,7 +181,7 @@ may also simplify input method development.")
                                   "/ibus-libpinyin-" version ".tar.gz"))
               (sha256
                (base32
-                "1sypbr5n96sf7mgqhxrwbawdmszgb6yi28iqkmfmb8xr93pwq7fq"))))
+                "1bl1cgicd2df797dx1x0q904438bsn8i23djzcfcai4dp3631xc0"))))
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:phases
@@ -213,6 +207,7 @@ may also simplify input method development.")
        ("sqlite" ,sqlite)
        ("python" ,python)
        ("pyxdg" ,python-pyxdg)
+       ("pygobject2" ,python-pygobject)
        ("gtk+" ,gtk+)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
@@ -228,15 +223,15 @@ ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
 (define-public libpinyin
   (package
     (name "libpinyin")
-    (version "2.2.0")
+    (version "2.3.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/libpinyin/libpinyin/"
                                   "releases/download/" version
-                                  "/libpinyin-2.2.0.tar.gz"))
+                                  "/libpinyin-" version ".tar.gz"))
               (sha256
                (base32
-                "1c4wxvcvjxvk23mcwqvsfsv4nhimx4kpjhabxa28gx1ih10l88gj"))))
+                "14969v6w8n1aiqphl2386dws7dmsdwbzyqnlz4kr8ppm39m9rp5k"))))
     (build-system gnu-build-system)
     (inputs
      `(("glib" ,glib)
@@ -304,7 +299,7 @@ Japanese language input in most graphical applications.")
 (define-public librime
   (package
     (name "librime")
-    (version "1.4.0")
+    (version "1.5.3")
     (source
      (origin
        (method git-fetch)
@@ -314,7 +309,7 @@ Japanese language input in most graphical applications.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1zkx1wfbd94v55gfycyd2b94jxclfyk2zl7yw35pyjx63qdlb6sd"))
+         "0xskhdhk7dgpc71r39pfzxi5vrlzy90aqj1gzv8nnapq91p2awhv"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -667,6 +662,13 @@ Method Engine.")
                                (assoc-ref inputs "rime-data")
                                "/share/rime-data\"\n")))
              #t))
+         (add-after 'unpack 'fix-file-names
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; IBus uses the component file rime.xml to start the Rime
+             ;; engine.  It must be patched with appropriate file names.
+             (substitute* "rime.xml"
+               (("/usr") (assoc-ref outputs "out")))
+             #t))
          (delete 'configure))))
     (inputs
      `(("gdk-pixbuf" ,gdk-pixbuf)
@@ -676,7 +678,7 @@ Method Engine.")
        ("librime" ,librime)
        ("rime-data" ,rime-data)))
     (native-inputs
-     `(("cmake" ,cmake)
+     `(("cmake" ,cmake-minimal)
        ("pkg-config" ,pkg-config)))
     (home-page "https://rime.im/")
     (synopsis "Rime Input Method Engine for IBus")
@@ -687,3 +689,67 @@ input methods as well as those for Chinese dialects.  It has the ability to
 compose phrases and sentences intelligently and provide very accurate
 traditional Chinese output.")
     (license gpl3+)))
+
+(define-public libhangul
+  (package
+    (name "libhangul")
+    (version "0.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://kldp.net/hangul/release/"
+                           "3442-libhangul-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar"))))
+    (build-system gnu-build-system)
+    (home-page "https://github.com/libhangul/libhangul")
+    (synopsis "Library to support hangul input method logic")
+    (description
+     "This package provides a library to support hangul input method logic,
+hanja dictionary and small hangul character classification.")
+    (license lgpl2.1+)))
+
+(define-public ibus-libhangul
+  (package
+    (name "ibus-libhangul")
+    (version "1.5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/libhangul/ibus-hangul/"
+                           "releases/download/" version
+                           "/ibus-hangul-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (wrap-program (string-append (assoc-ref outputs "out")
+                                          "/libexec/ibus-setup-hangul")
+               `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
+               `("LD_LIBRARY_PATH" ":" prefix
+                 (,(string-append (assoc-ref inputs "libhangul") "/lib")))
+               `("GI_TYPELIB_PATH" ":" prefix
+                 (,(getenv "GI_TYPELIB_PATH"))))
+             #t)))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("gettext" ,gettext-minimal)
+       ("glib:bin" ,glib "bin")))
+    (inputs
+     `(("ibus" ,ibus)
+       ("glib" ,glib)
+       ("python-pygobject" ,python-pygobject)
+       ("gtk+" ,gtk+)
+       ("libhangul" ,libhangul)
+       ("python" ,python)))
+    (home-page "https://github.com/libhangul/ibus-hangul")
+    (synopsis "Hangul engine for IBus")
+    (description
+     "ibus-hangul is a Korean input method engine for IBus.")
+    (license gpl2+)))