all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#33203] [patch] Rime Input Method Engine
@ 2018-10-30 14:33 Meiyo Peng
  2018-10-31  4:33 ` Meiyo Peng
  0 siblings, 1 reply; 9+ messages in thread
From: Meiyo Peng @ 2018-10-30 14:33 UTC (permalink / raw)
  To: 33203

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

Hi,

These patches add Rime Input Method Engine to guix.

Rime Input Method Engine is a lightweight, extensible input method
engine supporting various input schemas including glyph-based input
methods, romanization-based 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.

Rime is very popular among Chinese users. I prefer it over libpinyin.
But sadly, libpinyin (both in ibus and fcitx) is the only option for
pinyin in guix.

I have already tested these patches on my computer. It works fine.
Please inform me if there is any issue with the code.

--
Meiyo Peng


[-- Attachment #2: 0001-gnu-Add-marisa.patch --]
[-- Type: text/x-patch, Size: 2502 bytes --]

From 3395d2d7642eacfea05446d3bf47b9bf8e12c1bb Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:17:50 +0800
Subject: [PATCH 1/6] gnu: Add marisa.

* gnu/packages/datastructures.scm (marisa): New variable.
---
 gnu/packages/datastructures.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm
index 8517654de..e021cc6a6 100644
--- a/gnu/packages/datastructures.scm
+++ b/gnu/packages/datastructures.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (gnu packages datastructures)
   #:use-module (gnu packages)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages autotools)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -48,6 +50,35 @@ binary trees, binary search trees, red-black trees, 2D arrays, permutations
 and heaps.")
     (license license:gpl2+)))
 
+(define-public marisa
+  (package
+    (name "marisa")
+    (version "0.2.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/s-yata/marisa-trie"
+                           "/releases/download/v" version "/" name "-"
+                           version ".tar.gz"))
+       (sha256
+        (base32 "19ifrcmnbr9whaaf4ly3s9ndyiq9sjqhnfkrxbz9zsb44w2n36hf"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autoreconf
+           (lambda _
+             (invoke "autoreconf" "-i"))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (home-page "https://github.com/s-yata/marisa-trie")
+    (synopsis "Matching Algorithm with Recursively Implemented StorAge")
+    (description "Matching Algorithm with Recursively Implemented
+StorAge (MARISA) is a static and space-efficient trie data structure.")
+    (license (list license:bsd-2 license:lgpl2.1+))))
+
 (define-public sparsehash
   (package
     (name "sparsehash")
-- 
2.19.1


[-- Attachment #3: 0002-gnu-Add-opencc.patch --]
[-- Type: text/x-patch, Size: 1927 bytes --]

From 957248cfe9e4b7d14a47e06e37a8dede625eab36 Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:22:55 +0800
Subject: [PATCH 2/6] gnu: Add opencc.

* gnu/packages/textutils.scm (opencc): New variable.
---
 gnu/packages/textutils.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 8780bb282..852b5110e 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -756,3 +757,26 @@ indentation.
 @end itemize\n")
     (home-page "http://docx2txt.sourceforge.net")
     (license license:gpl3+)))
+
+(define-public opencc
+  (package
+    (name "opencc")
+    (version "1.0.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/BYVoid/OpenCC"
+                           "/archive/ver." version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "01870gbkf711msirf3206k0ajaabypjhnx3fny5wikw0ladn9q8w"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("python" ,python-2)))
+    (home-page "https://github.com/BYVoid/OpenCC")
+    (synopsis "Open Chinese Convert")
+    (description "Open Chinese Convert (OpenCC) is an opensource project for
+conversion between Traditional Chinese and Simplified Chinese, supporting
+character-level conversion, phrase-level conversion, variant conversion and
+regional idioms among Mainland China, Taiwan and Hong kong.")
+    (license license:asl2.0)))
-- 
2.19.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-ibus-Indent-code-properly.patch --]
[-- Type: text/x-patch, Size: 14152 bytes --]

From 5c02ffb1abc0debd917d1c347badbbb3077f440b Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 13:20:18 +0800
Subject: [PATCH 3/6] gnu: ibus: Indent code properly.

* gnu/packages/ibus.scm (ibus, ibus-libpinyin): Indent code properly.
---
 gnu/packages/ibus.scm | 308 +++++++++++++++++++++---------------------
 1 file changed, 154 insertions(+), 154 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 08fce5f6f..40fa93029 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -43,166 +43,166 @@
 
 (define-public ibus
   (package
-   (name "ibus")
-   (version "1.5.19")
-   (source (origin
-             (method url-fetch)
-             (uri (string-append "https://github.com/ibus/ibus/"
-                                 "releases/download/"
-                                 version "/ibus-" version ".tar.gz"))
-             (sha256
-              (base32
-               "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
-   (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
-                          "--disable-python2"
-                          "--enable-python-library"
-                          ,(string-append "--with-ucd-dir="
-                                          (getcwd) "/ucd")
-                          "--enable-wayland")
-      #:make-flags
-      (list "CC=gcc"
-            (string-append "pyoverridesdir="
-                           (assoc-ref %outputs "out")
-                           "/lib/python3.6/site-packages/gi/overrides/"))
-      #: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-before 'configure 'disable-dconf-update
-          (lambda _
-            (substitute* "data/dconf/Makefile.in"
-              (("dconf update") "echo dconf update"))
-            #t))
-        (add-after 'unpack 'delete-generated-files
-          (lambda _
-            (for-each (lambda (file)
-                        (let ((c (string-append (string-drop-right file 4) "c")))
-                          (when (file-exists? c)
-                            (format #t "deleting ~a\n" c)
-                            (delete-file c))))
-                      (find-files "." "\\.vala"))
-            #t))
-        (add-after 'unpack 'fix-paths
-          (lambda* (#:key inputs #:allow-other-keys)
-            (substitute* "src/ibusenginesimple.c"
-              (("/usr/share/X11/locale")
-               (string-append (assoc-ref inputs "libx11")
-                              "/share/X11/locale")))
-            (substitute* "ui/gtk3/xkblayout.vala"
-              (("\"(setxkbmap|xmodmap)\"" _ prog)
-               (string-append "\"" (assoc-ref inputs prog) "\"")))
-            #t))
-        (add-after 'wrap-program 'wrap-with-additional-paths
-          (lambda* (#:key outputs #:allow-other-keys)
-            ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
-            ;; GI_TYPELIB_PATH.
-            (let ((out (assoc-ref outputs "out")))
-              (wrap-program (string-append out "/bin/ibus-setup")
-                `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
-                `("GI_TYPELIB_PATH" ":" prefix
-                  (,(getenv "GI_TYPELIB_PATH")
-                   ,(string-append out "/lib/girepository-1.0")))))
-            #t)))))
-   (inputs
-    `(("dbus" ,dbus)
-      ("dconf" ,dconf)
-      ("gconf" ,gconf)
-      ("gtk2" ,gtk+-2)
-      ("gtk+" ,gtk+)
-      ("intltool" ,intltool)
-      ("json-glib" ,json-glib)
-      ("libnotify" ,libnotify)
-      ("libx11" ,libx11)
-      ("setxkbmap" ,setxkbmap)
-      ("wayland" ,wayland)
-      ("xmodmap" ,xmodmap)
-      ("iso-codes" ,iso-codes)
-      ("pygobject2" ,python-pygobject)
-      ("python" ,python)))
-   (native-inputs
-    `(("glib" ,glib "bin") ; for glib-genmarshal
-      ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
-      ("unicode-nameslist"
-       ,(origin
-          (method url-fetch)
-          (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
-          (sha256
-           (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
-      ("unicode-blocks"
-       ,(origin
-          (method url-fetch)
-          (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
-          (sha256
-           (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
-      ("vala" ,vala)
-      ("pkg-config" ,pkg-config)))
-   (native-search-paths
-    (list (search-path-specification
-           (variable "IBUS_COMPONENT_PATH")
-           (files '("share/ibus/component")))))
-   (synopsis "Input method framework")
-   (description
-    "IBus is an input framework providing a full-featured and user-friendly
+    (name "ibus")
+    (version "1.5.19")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/ibus/ibus/"
+                                  "releases/download/"
+                                  version "/ibus-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
+    (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
+                           "--disable-python2"
+                           "--enable-python-library"
+                           ,(string-append "--with-ucd-dir="
+                                           (getcwd) "/ucd")
+                           "--enable-wayland")
+       #:make-flags
+       (list "CC=gcc"
+             (string-append "pyoverridesdir="
+                            (assoc-ref %outputs "out")
+                            "/lib/python3.6/site-packages/gi/overrides/"))
+       #: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-before 'configure 'disable-dconf-update
+           (lambda _
+             (substitute* "data/dconf/Makefile.in"
+               (("dconf update") "echo dconf update"))
+             #t))
+         (add-after 'unpack 'delete-generated-files
+           (lambda _
+             (for-each (lambda (file)
+                         (let ((c (string-append (string-drop-right file 4) "c")))
+                           (when (file-exists? c)
+                             (format #t "deleting ~a\n" c)
+                             (delete-file c))))
+                       (find-files "." "\\.vala"))
+             #t))
+         (add-after 'unpack 'fix-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/ibusenginesimple.c"
+               (("/usr/share/X11/locale")
+                (string-append (assoc-ref inputs "libx11")
+                               "/share/X11/locale")))
+             (substitute* "ui/gtk3/xkblayout.vala"
+               (("\"(setxkbmap|xmodmap)\"" _ prog)
+                (string-append "\"" (assoc-ref inputs prog) "\"")))
+             #t))
+         (add-after 'wrap-program 'wrap-with-additional-paths
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
+             ;; GI_TYPELIB_PATH.
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/bin/ibus-setup")
+                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
+                 `("GI_TYPELIB_PATH" ":" prefix
+                   (,(getenv "GI_TYPELIB_PATH")
+                    ,(string-append out "/lib/girepository-1.0")))))
+             #t)))))
+    (inputs
+     `(("dbus" ,dbus)
+       ("dconf" ,dconf)
+       ("gconf" ,gconf)
+       ("gtk2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("intltool" ,intltool)
+       ("json-glib" ,json-glib)
+       ("libnotify" ,libnotify)
+       ("libx11" ,libx11)
+       ("setxkbmap" ,setxkbmap)
+       ("wayland" ,wayland)
+       ("xmodmap" ,xmodmap)
+       ("iso-codes" ,iso-codes)
+       ("pygobject2" ,python-pygobject)
+       ("python" ,python)))
+    (native-inputs
+     `(("glib" ,glib "bin") ; for glib-genmarshal
+       ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
+       ("unicode-nameslist"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
+           (sha256
+            (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
+       ("unicode-blocks"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
+           (sha256
+            (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
+       ("vala" ,vala)
+       ("pkg-config" ,pkg-config)))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "IBUS_COMPONENT_PATH")
+            (files '("share/ibus/component")))))
+    (synopsis "Input method framework")
+    (description
+     "IBus is an input framework providing a full-featured and user-friendly
 input method user interface.  It comes with multilingual input support.  It
 may also simplify input method development.")
-   (home-page "https://github.com/ibus/ibus/wiki")
-   (license lgpl2.1+)))
+    (home-page "https://github.com/ibus/ibus/wiki")
+    (license lgpl2.1+)))
 
 (define-public ibus-libpinyin
   (package
-   (name "ibus-libpinyin")
-   (version "1.10.0")
-   (source (origin
-             (method url-fetch)
-             (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
-                                 "releases/download/" version
-                                 "/ibus-libpinyin-" version ".tar.gz"))
-             (sha256
-              (base32
-               "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
-   (build-system glib-or-gtk-build-system)
-   (arguments
-    `(#:phases
-      (modify-phases %standard-phases
-        (add-after 'wrap-program 'wrap-with-additional-paths
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            ;; Make sure 'ibus-setup-libpinyin' runs with the correct
-            ;; PYTHONPATH and GI_TYPELIB_PATH.
-            (let ((out (assoc-ref outputs "out")))
-              (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
-                `("PYTHONPATH" ":" prefix
-                  (,(getenv "PYTHONPATH")
-                   ,(string-append (assoc-ref inputs "ibus")
-                                   "/lib/girepository-1.0")))
-                `("GI_TYPELIB_PATH" ":" prefix
-                  (,(string-append (assoc-ref inputs "ibus")
-                                   "/lib/girepository-1.0"))))
-              #t))))))
-   (inputs
-    `(("ibus" ,ibus)
-      ("libpinyin" ,libpinyin)
-      ("bdb" ,bdb)
-      ("sqlite" ,sqlite)
-      ("python" ,python)
-      ("pyxdg" ,python-pyxdg)
-      ("gtk+" ,gtk+)))
-   (native-inputs
-    `(("pkg-config" ,pkg-config)
-      ("intltool" ,intltool)
-      ("glib" ,glib "bin")))
-   (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
-   (description
-    "This package includes a Chinese pinyin input method and a Chinese
+    (name "ibus-libpinyin")
+    (version "1.10.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
+                                  "releases/download/" version
+                                  "/ibus-libpinyin-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'wrap-program 'wrap-with-additional-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Make sure 'ibus-setup-libpinyin' runs with the correct
+             ;; PYTHONPATH and GI_TYPELIB_PATH.
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
+                 `("PYTHONPATH" ":" prefix
+                   (,(getenv "PYTHONPATH")
+                    ,(string-append (assoc-ref inputs "ibus")
+                                    "/lib/girepository-1.0")))
+                 `("GI_TYPELIB_PATH" ":" prefix
+                   (,(string-append (assoc-ref inputs "ibus")
+                                    "/lib/girepository-1.0"))))
+               #t))))))
+    (inputs
+     `(("ibus" ,ibus)
+       ("libpinyin" ,libpinyin)
+       ("bdb" ,bdb)
+       ("sqlite" ,sqlite)
+       ("python" ,python)
+       ("pyxdg" ,python-pyxdg)
+       ("gtk+" ,gtk+)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("intltool" ,intltool)
+       ("glib" ,glib "bin")))
+    (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
+    (description
+     "This package includes a Chinese pinyin input method and a Chinese
 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
-   (home-page "https://github.com/libpinyin/ibus-libpinyin")
-   (license gpl2+)))
+    (home-page "https://github.com/libpinyin/ibus-libpinyin")
+    (license gpl2+)))
 
 (define-public libpinyin
   (package
-- 
2.19.1


[-- Attachment #5: 0004-gnu-Add-librime.patch --]
[-- Type: text/x-patch, Size: 3300 bytes --]

From 1bbc5928dd09caee09804cf7eb226b329e76c2bf Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:29:33 +0800
Subject: [PATCH 4/6] gnu: Add librime.

* gnu/packages/ibus.scm (librime): New variable.
---
 gnu/packages/ibus.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 40fa93029..f689c02ba 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,21 +25,27 @@
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (gnu packages)
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages datastructures)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages logging)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages serialization)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages xorg))
 
 (define-public ibus
@@ -279,3 +286,33 @@ applications allow text input via IBus, installing this package will enable
 Japanese language input in most graphical applications.")
     (home-page "https://github.com/fujiwarat/ibus-anthy")
     (license gpl2+)))
+
+(define-public librime
+  (package
+    (name "librime")
+    (version "1.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/rime/" name
+                           "/archive/" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0qh0hy8bvj17bnzaxk0bmv4gsnbsd6jx8csr84936xmhkrysdday"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("boost" ,boost)
+       ("glog" ,glog)
+       ("leveldb" ,leveldb)
+       ("marisa" ,marisa)
+       ("opencc" ,opencc)
+       ("yaml-cpp" ,yaml-cpp)))
+    (home-page "https://rime.im/")
+    (synopsis "The core library of Rime Input Method Engine")
+    (description "@dfn{librime} is the core library of Rime Input Method
+Engine, which is a lightweight, extensible input method engine supporting
+various input schemas including glyph-based input methods, romanization-based
+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 bsd-3)))
-- 
2.19.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-gnu-Add-rime-data.patch --]
[-- Type: text/x-patch, Size: 11746 bytes --]

From 3b97eb42afdef0e95573a0ab3eebe6959386b7bb Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:35:20 +0800
Subject: [PATCH 5/6] gnu: Add rime-data.

* gnu/packages/ibus.scm (rime-data): New variable.
---
 gnu/packages/ibus.scm | 270 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 270 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index f689c02ba..870d28562 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -25,6 +25,7 @@
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
@@ -316,3 +317,272 @@ 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 bsd-3)))
+
+(define-public rime-data
+  (package
+    (name "rime-data")
+    (version "0.38.20181029")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rime/plum.git")
+             (commit "fb4f829da2007f2dbb37d60a79bc67c25ea16568")))
+       (file-name "plum-checkout")
+       (sha256
+        (base32 "1m1wiv9j5bay4saga58c7dj4h8gqivsbyp16y245ifvxvp9czj67"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                  ; no tests
+       #:parallel-build? #f         ; rime_deployer failed with parallel build
+       #:make-flags (list (string-append "PREFIX=" %output)
+                          "all-bin")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-packages
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((dest-dir "package/rime"))
+               (mkdir-p dest-dir)
+               (for-each (lambda (pkg)
+                           (copy-recursively (assoc-ref inputs pkg)
+                                             (string-append dest-dir "/" pkg)))
+                         '("array"
+                           "bopomofo"
+                           "cangjie"
+                           "combo-pinyin"
+                           "double-pinyin"
+                           "emoji"
+                           "essay"
+                           "ipa"
+                           "jyutping"
+                           "luna-pinyin"
+                           "middle-chinese"
+                           "pinyin-simp"
+                           "prelude"
+                           "quick"
+                           "scj"
+                           "soutzoe"
+                           "stenotype"
+                           "stroke"
+                           "terra-pinyin"
+                           "wubi"
+                           "wugniu")))
+             #t))
+         (delete 'configure))))
+    (native-inputs
+     `(("librime" ,librime)
+       ("array"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-array.git")
+                 (commit "906e923902147584b0b0247028a782abbfbfd8a0")))
+           (file-name "rime-array-checkout")
+           (sha256
+            (base32
+             "1alk6ghn4ji4kvp7lfm57bwm2gjh99i79r0w9naz6wkdim8idvb1"))))
+       ("bopomofo"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-bopomofo.git")
+                 (commit "8dc44ca1b6ef4e45b452e070b9da737f5da165e3")))
+           (file-name "rime-bopomofo-checkout")
+           (sha256
+            (base32
+             "16k6wfhcrw3a77rmbrp21ca0gmsmb3f68s193c1cfwr8i68k46nf"))))
+       ("cangjie"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-cangjie.git")
+                 (commit "ab085e90856b3399b374dc3c8b4cb40d11f307a8")))
+           (file-name "rime-cangjie-checkout")
+           (sha256
+            (base32
+             "11fgj0rbv9nyzfijwm2l8pm8fznhif4h27ndrrcaaylkp7p5zsx2"))))
+       ("combo-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-combo-pinyin.git")
+                 (commit "f1bae63f20504f2b8113c5cbdf2700e858aa91eb")))
+           (file-name "rime-combo-pinyin-checkout")
+           (sha256
+            (base32
+             "1l1079akwm1hw4kkn0q6x9fpylnl2ka6z2fn7lmdpfpsr0xgn0n7"))))
+       ("double-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-double-pinyin.git")
+                 (commit "2101a5cd40e511ec38835769aa66d2dddf059c2e")))
+           (file-name "rime-double-pinyin-checkout")
+           (sha256
+            (base32
+             "19hh2qm0njbfk2js678hfm2hw9b796s43vs11yy3m1v9m0gk2vi7"))))
+       ("emoji"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-emoji.git")
+                 (commit "6e6611b315f03ee4c33f958f9dbe960b13a0ed19")))
+           (file-name "rime-emoji-checkout")
+           (sha256
+            (base32
+             "1brfs3214w36j3345di9ygp468hbvbqdqpkjxxs1dbp437rayhyy"))))
+       ("essay"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-essay.git")
+                 (commit "5e5c7a0ef41c9b030abdad81a9df07b56b1661e9")))
+           (file-name "rime-essay-checkout")
+           (sha256
+            (base32
+             "0ana9is0zhh79m4gjshvmaxbrg3jiqysydx5bpm151i7i6vw5y1i"))))
+       ("ipa"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-ipa.git")
+                 (commit "02a9e2c181921a2e95e1a81f88188c41132755c3")))
+           (file-name "rime-ipa-checkout")
+           (sha256
+            (base32
+             "1szrxgvqlgmxapj2aflw2cvbv0p6pl0sw0gyxa13dvdhhf7s9rvr"))))
+       ("jyutping"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-jyutping.git")
+                 (commit "1402ec3d6cc0973f952fe3f9ef531294e4ffe9e0")))
+           (file-name "rime-jyutping-checkout")
+           (sha256
+            (base32
+             "17g03dy4gw6vyc9da1wjn3iy9hx64dfnwiwsfc7bkzan22x2m4dv"))))
+       ("luna-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-luna-pinyin.git")
+                 (commit "3b05132576f5c347ff8a70857d2dae080936ac3b")))
+           (file-name "rime-luna-pinyin-checkout")
+           (sha256
+            (base32
+             "0kgnpxjn10dm2d9718r12rdjlwqd2s2h84jvkhxhh5v0dkv1anl2"))))
+       ("middle-chinese"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-middle-chinese.git")
+                 (commit "9ba8d70330654b9a730f882d35cfad7dbeddfd75")))
+           (file-name "rime-middle-chinese-checkout")
+           (sha256
+            (base32
+             "0hwg5zby5kphh0bcfay8mfxwr5bwqhamiw3cmmmf7kp9fbns5s23"))))
+       ("pinyin-simp"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-pinyin-simp.git")
+                 (commit "74357ffd62c05fb60edf6eab5b86bc8c8c1907d0")))
+           (file-name "rime-pinyin-simp-checkout")
+           (sha256
+            (base32
+             "1paw3c7pv5bl54abnp9pidfxrkchdacyxy5m9zb311p5sgm7fhxh"))))
+       ("prelude"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-prelude.git")
+                 (commit "33040568c3ddb2ee6340c9b669494317db21b77c")))
+           (file-name "rime-prelude-checkout")
+           (sha256
+            (base32
+             "1gwcasyyg6f0ib6s4qsrrjcqr1lcs7j3xqxl65rznsw44nhnbwwq"))))
+       ("quick"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-quick.git")
+                 (commit "910a97d403ad8e72f322488da146da79c19d623f")))
+           (file-name "rime-quick-checkout")
+           (sha256
+            (base32
+             "0yrq3gbfmm29xlr52rmxc41mqfrb0295q7sdhbc3ax71677mpr0y"))))
+       ("scj"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-scj.git")
+                 (commit "e0eae889f4376d2a434ac3b38523e0da7400db68")))
+           (file-name "rime-scj-checkout")
+           (sha256
+            (base32
+             "1whnv9zs349kvy0zi7dnmpqwil8i6gqwrzvhy3qdrjzy58y6gwxn"))))
+       ("soutzoe"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-soutzoe.git")
+                 (commit "e47841a8ad6341731c41cdb814b7a25c837603c4")))
+           (file-name "rime-soutzoe-checkout")
+           (sha256
+            (base32
+             "1rgpmkxa72jy6gyy44fn8azpk3amk9s9lrdf7za03nv95d0fvm0p"))))
+       ("stenotype"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-stenotype.git")
+                 (commit "d4ff379314fd95283853d1734854979cf3cbd287")))
+           (file-name "rime-stenotype-checkout")
+           (sha256
+            (base32
+             "1kckpi4l4884hvydr3d6vid3v7rsc1app29kmk7v8jf8vn16afhl"))))
+       ("stroke"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-stroke.git")
+                 (commit "cfd29c675c46cf70b7a7f0a3836a913059316a0a")))
+           (file-name "rime-stroke-checkout")
+           (sha256
+            (base32
+             "135is9c1p4lm98fd9l1gxyflkm69cv5an129ka7sk614bq84m08d"))))
+       ("terra-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-terra-pinyin.git")
+                 (commit "15b5c73a796571cd6f9ef6c89f96656cb9df86f9")))
+           (file-name "rime-terra-pinyin-checkout")
+           (sha256
+            (base32
+             "1xsd84h1zw417h5hr4dbgyk5009zi7q2p9774w3ccr5sxgc3i3cm"))))
+       ("wubi"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-wubi.git")
+                 (commit "d44403728a0b1cd8b47cb1f81b83f58e5f790b74")))
+           (file-name "rime-wubi-checkout")
+           (sha256
+            (base32
+             "0ld31bdn94lncxd1ka44w4sbl03skh08mc927dhdmwq5bpvrgn36"))))
+       ("wugniu"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-wugniu.git")
+                 (commit "65bcc354ada3839591d7546a64c71dbdd0592b02")))
+           (file-name "rime-wugniu-checkout")
+           (sha256
+            (base32
+             "0g31awp40s778sp5c290x40s8np86n8aw011s17sslxrqhhb0bkx"))))))
+    (home-page "https://rime.im/")
+    (synopsis "Schema data of Rime Input Method Engine")
+    (description "@dfn{rime-data} provides the schema data of Rime Input
+Method Engine.")
+    (license lgpl3+)))
-- 
2.19.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: 0006-gnu-Add-ibus-rime.patch --]
[-- Type: text/x-patch, Size: 3477 bytes --]

From 80a75361b8c47e80495a068c810a5f5ff0a845b0 Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:46:03 +0800
Subject: [PATCH 6/6] gnu: Add ibus-rime.

* gnu/packages/ibus.scm (ibus-rime): New variable.
---
 gnu/packages/ibus.scm | 59 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 870d28562..0a07b5190 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages datastructures)
   #:use-module (gnu packages freedesktop)
@@ -586,3 +587,61 @@ traditional Chinese output.")
     (description "@dfn{rime-data} provides the schema data of Rime Input
 Method Engine.")
     (license lgpl3+)))
+
+(define-public ibus-rime
+  (package
+    (name "ibus-rime")
+    (version "1.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/rime/" name
+                           "/archive/" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0mfbz0vwky7n4wvxrwabnn1i9n9adnql0dd1rx57w1anaslr5amj"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; no tests
+       #:make-flags (list (string-append "PREFIX=" %output))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Define RIME_DATA_DIR. It's required but not used by the code.
+             (substitute* "Makefile"
+               (("cmake")
+                (string-append "cmake -DRIME_DATA_DIR="
+                               (assoc-ref inputs "rime-data")
+                               "/share/rime-data")))
+             (substitute* "rime_config.h"
+               (("#define IBUS_RIME_INSTALL_PREFIX .*")
+                (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
+                               (assoc-ref outputs "out")
+                               "\"\n")))
+             ;; rime_config.h defines the actual data directory.
+             (substitute* "rime_config.h"
+               (("#define IBUS_RIME_SHARED_DATA_DIR .*")
+                (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
+                               (assoc-ref inputs "rime-data")
+                               "/share/rime-data\"\n")))
+             #t))
+         (delete 'configure))))
+    (inputs
+     `(("gdk-pixbuf" ,gdk-pixbuf)
+       ("glib" ,glib)
+       ("ibus" ,ibus)
+       ("libnotify" ,libnotify)
+       ("librime" ,librime)
+       ("rime-data" ,rime-data)))
+    (native-inputs
+     `(("cmake" ,cmake)
+       ("pkg-config" ,pkg-config)))
+    (home-page "https://rime.im/")
+    (synopsis "Rime Input Method Engine for IBus")
+    (description "@dfn{Rime} Input Method Engine is a lightweight, extensible
+input method engine supporting various input schemas including glyph-based
+input methods, romanization-based 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+)))
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#33203] [patch] Rime Input Method Engine
  2018-10-30 14:33 [bug#33203] [patch] Rime Input Method Engine Meiyo Peng
@ 2018-10-31  4:33 ` Meiyo Peng
  2018-11-01 15:29   ` Meiyo Peng
  0 siblings, 1 reply; 9+ messages in thread
From: Meiyo Peng @ 2018-10-31  4:33 UTC (permalink / raw)
  To: 33203

Hi,

Hold on, please.

The output of rime-data is not deterministic. I'll investigate into
this.

#+BEGIN_EXAMPLE
  guix build: error: build failed: derivation `/gnu/store/mca8qb66dfjzhqqjm2cl3ayjwz7pd5cq-rime-data-0.38.20181029.drv' may not be deterministic: output `/gnu/store/iw354qfwd3mz5x34w99qz73n1fmc1gyz-rime-data-0.38.20181029' differs
#+END_EXAMPLE

--
Meiyo Peng

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#33203] [patch] Rime Input Method Engine
  2018-10-31  4:33 ` Meiyo Peng
@ 2018-11-01 15:29   ` Meiyo Peng
  2018-11-10 20:55     ` Ludovic Courtès
                       ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Meiyo Peng @ 2018-11-01 15:29 UTC (permalink / raw)
  To: 33203

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Hi,

I have fixed the non-deterministic issue of rime-data and made some
minor changes to other packages. Please use the patches attached to this
email instead of the previous email.

The previous version of rime-data contains both YAML format schema data
and binary format schema data. Binary schema data are generated from
YAML schema data. They are used to accelerate Rime's startup time. But
this generation process is not reproducible. I contacted Rime's author
on github but still have no feedback, so I removed binary schema data
from rime-data package's output. This will make users first time startup
a little longer, but it's bearable and happens only once.

Patches are attached. You can also view my code on github:
https://github.com/meiyopeng/guix/tree/rime

--
Meiyo Peng



[-- Attachment #2: 0001-gnu-Add-marisa.patch --]
[-- Type: text/x-patch, Size: 2502 bytes --]

From 0435a5d28299f1355eb6ac8d9e7f4520756e179d Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:17:50 +0800
Subject: [PATCH 1/6] gnu: Add marisa.

* gnu/packages/datastructures.scm (marisa): New variable.
---
 gnu/packages/datastructures.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm
index 8517654de..e021cc6a6 100644
--- a/gnu/packages/datastructures.scm
+++ b/gnu/packages/datastructures.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (gnu packages datastructures)
   #:use-module (gnu packages)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages autotools)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -48,6 +50,35 @@ binary trees, binary search trees, red-black trees, 2D arrays, permutations
 and heaps.")
     (license license:gpl2+)))
 
+(define-public marisa
+  (package
+    (name "marisa")
+    (version "0.2.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/s-yata/marisa-trie"
+                           "/releases/download/v" version "/" name "-"
+                           version ".tar.gz"))
+       (sha256
+        (base32 "19ifrcmnbr9whaaf4ly3s9ndyiq9sjqhnfkrxbz9zsb44w2n36hf"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autoreconf
+           (lambda _
+             (invoke "autoreconf" "-i"))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (home-page "https://github.com/s-yata/marisa-trie")
+    (synopsis "Matching Algorithm with Recursively Implemented StorAge")
+    (description "Matching Algorithm with Recursively Implemented
+StorAge (MARISA) is a static and space-efficient trie data structure.")
+    (license (list license:bsd-2 license:lgpl2.1+))))
+
 (define-public sparsehash
   (package
     (name "sparsehash")
-- 
2.19.1


[-- Attachment #3: 0002-gnu-Add-opencc.patch --]
[-- Type: text/x-patch, Size: 1933 bytes --]

From 17a253ac1b8e7bc9a7a97338463c526a61d51730 Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:22:55 +0800
Subject: [PATCH 2/6] gnu: Add opencc.

* gnu/packages/textutils.scm (opencc): New variable.
---
 gnu/packages/textutils.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 8780bb282..029a05052 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -756,3 +757,26 @@ indentation.
 @end itemize\n")
     (home-page "http://docx2txt.sourceforge.net")
     (license license:gpl3+)))
+
+(define-public opencc
+  (package
+    (name "opencc")
+    (version "1.0.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/BYVoid/OpenCC"
+                           "/archive/ver." version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "01870gbkf711msirf3206k0ajaabypjhnx3fny5wikw0ladn9q8w"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("python" ,python-wrapper)))
+    (home-page "https://github.com/BYVoid/OpenCC")
+    (synopsis "Open Chinese Convert")
+    (description "Open Chinese Convert (OpenCC) is an opensource project for
+conversion between Traditional Chinese and Simplified Chinese, supporting
+character-level conversion, phrase-level conversion, variant conversion and
+regional idioms among Mainland China, Taiwan and Hong kong.")
+    (license license:asl2.0)))
-- 
2.19.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-ibus-Indent-code-properly.patch --]
[-- Type: text/x-patch, Size: 14152 bytes --]

From d550f8b9ab2e16e7a01f42433111dac37b7f2b41 Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 13:20:18 +0800
Subject: [PATCH 3/6] gnu: ibus: Indent code properly.

* gnu/packages/ibus.scm (ibus, ibus-libpinyin): Indent code properly.
---
 gnu/packages/ibus.scm | 308 +++++++++++++++++++++---------------------
 1 file changed, 154 insertions(+), 154 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 08fce5f6f..40fa93029 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -43,166 +43,166 @@
 
 (define-public ibus
   (package
-   (name "ibus")
-   (version "1.5.19")
-   (source (origin
-             (method url-fetch)
-             (uri (string-append "https://github.com/ibus/ibus/"
-                                 "releases/download/"
-                                 version "/ibus-" version ".tar.gz"))
-             (sha256
-              (base32
-               "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
-   (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
-                          "--disable-python2"
-                          "--enable-python-library"
-                          ,(string-append "--with-ucd-dir="
-                                          (getcwd) "/ucd")
-                          "--enable-wayland")
-      #:make-flags
-      (list "CC=gcc"
-            (string-append "pyoverridesdir="
-                           (assoc-ref %outputs "out")
-                           "/lib/python3.6/site-packages/gi/overrides/"))
-      #: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-before 'configure 'disable-dconf-update
-          (lambda _
-            (substitute* "data/dconf/Makefile.in"
-              (("dconf update") "echo dconf update"))
-            #t))
-        (add-after 'unpack 'delete-generated-files
-          (lambda _
-            (for-each (lambda (file)
-                        (let ((c (string-append (string-drop-right file 4) "c")))
-                          (when (file-exists? c)
-                            (format #t "deleting ~a\n" c)
-                            (delete-file c))))
-                      (find-files "." "\\.vala"))
-            #t))
-        (add-after 'unpack 'fix-paths
-          (lambda* (#:key inputs #:allow-other-keys)
-            (substitute* "src/ibusenginesimple.c"
-              (("/usr/share/X11/locale")
-               (string-append (assoc-ref inputs "libx11")
-                              "/share/X11/locale")))
-            (substitute* "ui/gtk3/xkblayout.vala"
-              (("\"(setxkbmap|xmodmap)\"" _ prog)
-               (string-append "\"" (assoc-ref inputs prog) "\"")))
-            #t))
-        (add-after 'wrap-program 'wrap-with-additional-paths
-          (lambda* (#:key outputs #:allow-other-keys)
-            ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
-            ;; GI_TYPELIB_PATH.
-            (let ((out (assoc-ref outputs "out")))
-              (wrap-program (string-append out "/bin/ibus-setup")
-                `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
-                `("GI_TYPELIB_PATH" ":" prefix
-                  (,(getenv "GI_TYPELIB_PATH")
-                   ,(string-append out "/lib/girepository-1.0")))))
-            #t)))))
-   (inputs
-    `(("dbus" ,dbus)
-      ("dconf" ,dconf)
-      ("gconf" ,gconf)
-      ("gtk2" ,gtk+-2)
-      ("gtk+" ,gtk+)
-      ("intltool" ,intltool)
-      ("json-glib" ,json-glib)
-      ("libnotify" ,libnotify)
-      ("libx11" ,libx11)
-      ("setxkbmap" ,setxkbmap)
-      ("wayland" ,wayland)
-      ("xmodmap" ,xmodmap)
-      ("iso-codes" ,iso-codes)
-      ("pygobject2" ,python-pygobject)
-      ("python" ,python)))
-   (native-inputs
-    `(("glib" ,glib "bin") ; for glib-genmarshal
-      ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
-      ("unicode-nameslist"
-       ,(origin
-          (method url-fetch)
-          (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
-          (sha256
-           (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
-      ("unicode-blocks"
-       ,(origin
-          (method url-fetch)
-          (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
-          (sha256
-           (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
-      ("vala" ,vala)
-      ("pkg-config" ,pkg-config)))
-   (native-search-paths
-    (list (search-path-specification
-           (variable "IBUS_COMPONENT_PATH")
-           (files '("share/ibus/component")))))
-   (synopsis "Input method framework")
-   (description
-    "IBus is an input framework providing a full-featured and user-friendly
+    (name "ibus")
+    (version "1.5.19")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/ibus/ibus/"
+                                  "releases/download/"
+                                  version "/ibus-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
+    (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
+                           "--disable-python2"
+                           "--enable-python-library"
+                           ,(string-append "--with-ucd-dir="
+                                           (getcwd) "/ucd")
+                           "--enable-wayland")
+       #:make-flags
+       (list "CC=gcc"
+             (string-append "pyoverridesdir="
+                            (assoc-ref %outputs "out")
+                            "/lib/python3.6/site-packages/gi/overrides/"))
+       #: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-before 'configure 'disable-dconf-update
+           (lambda _
+             (substitute* "data/dconf/Makefile.in"
+               (("dconf update") "echo dconf update"))
+             #t))
+         (add-after 'unpack 'delete-generated-files
+           (lambda _
+             (for-each (lambda (file)
+                         (let ((c (string-append (string-drop-right file 4) "c")))
+                           (when (file-exists? c)
+                             (format #t "deleting ~a\n" c)
+                             (delete-file c))))
+                       (find-files "." "\\.vala"))
+             #t))
+         (add-after 'unpack 'fix-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/ibusenginesimple.c"
+               (("/usr/share/X11/locale")
+                (string-append (assoc-ref inputs "libx11")
+                               "/share/X11/locale")))
+             (substitute* "ui/gtk3/xkblayout.vala"
+               (("\"(setxkbmap|xmodmap)\"" _ prog)
+                (string-append "\"" (assoc-ref inputs prog) "\"")))
+             #t))
+         (add-after 'wrap-program 'wrap-with-additional-paths
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
+             ;; GI_TYPELIB_PATH.
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/bin/ibus-setup")
+                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
+                 `("GI_TYPELIB_PATH" ":" prefix
+                   (,(getenv "GI_TYPELIB_PATH")
+                    ,(string-append out "/lib/girepository-1.0")))))
+             #t)))))
+    (inputs
+     `(("dbus" ,dbus)
+       ("dconf" ,dconf)
+       ("gconf" ,gconf)
+       ("gtk2" ,gtk+-2)
+       ("gtk+" ,gtk+)
+       ("intltool" ,intltool)
+       ("json-glib" ,json-glib)
+       ("libnotify" ,libnotify)
+       ("libx11" ,libx11)
+       ("setxkbmap" ,setxkbmap)
+       ("wayland" ,wayland)
+       ("xmodmap" ,xmodmap)
+       ("iso-codes" ,iso-codes)
+       ("pygobject2" ,python-pygobject)
+       ("python" ,python)))
+    (native-inputs
+     `(("glib" ,glib "bin") ; for glib-genmarshal
+       ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
+       ("unicode-nameslist"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
+           (sha256
+            (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
+       ("unicode-blocks"
+        ,(origin
+           (method url-fetch)
+           (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
+           (sha256
+            (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
+       ("vala" ,vala)
+       ("pkg-config" ,pkg-config)))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "IBUS_COMPONENT_PATH")
+            (files '("share/ibus/component")))))
+    (synopsis "Input method framework")
+    (description
+     "IBus is an input framework providing a full-featured and user-friendly
 input method user interface.  It comes with multilingual input support.  It
 may also simplify input method development.")
-   (home-page "https://github.com/ibus/ibus/wiki")
-   (license lgpl2.1+)))
+    (home-page "https://github.com/ibus/ibus/wiki")
+    (license lgpl2.1+)))
 
 (define-public ibus-libpinyin
   (package
-   (name "ibus-libpinyin")
-   (version "1.10.0")
-   (source (origin
-             (method url-fetch)
-             (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
-                                 "releases/download/" version
-                                 "/ibus-libpinyin-" version ".tar.gz"))
-             (sha256
-              (base32
-               "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
-   (build-system glib-or-gtk-build-system)
-   (arguments
-    `(#:phases
-      (modify-phases %standard-phases
-        (add-after 'wrap-program 'wrap-with-additional-paths
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            ;; Make sure 'ibus-setup-libpinyin' runs with the correct
-            ;; PYTHONPATH and GI_TYPELIB_PATH.
-            (let ((out (assoc-ref outputs "out")))
-              (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
-                `("PYTHONPATH" ":" prefix
-                  (,(getenv "PYTHONPATH")
-                   ,(string-append (assoc-ref inputs "ibus")
-                                   "/lib/girepository-1.0")))
-                `("GI_TYPELIB_PATH" ":" prefix
-                  (,(string-append (assoc-ref inputs "ibus")
-                                   "/lib/girepository-1.0"))))
-              #t))))))
-   (inputs
-    `(("ibus" ,ibus)
-      ("libpinyin" ,libpinyin)
-      ("bdb" ,bdb)
-      ("sqlite" ,sqlite)
-      ("python" ,python)
-      ("pyxdg" ,python-pyxdg)
-      ("gtk+" ,gtk+)))
-   (native-inputs
-    `(("pkg-config" ,pkg-config)
-      ("intltool" ,intltool)
-      ("glib" ,glib "bin")))
-   (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
-   (description
-    "This package includes a Chinese pinyin input method and a Chinese
+    (name "ibus-libpinyin")
+    (version "1.10.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
+                                  "releases/download/" version
+                                  "/ibus-libpinyin-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'wrap-program 'wrap-with-additional-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Make sure 'ibus-setup-libpinyin' runs with the correct
+             ;; PYTHONPATH and GI_TYPELIB_PATH.
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
+                 `("PYTHONPATH" ":" prefix
+                   (,(getenv "PYTHONPATH")
+                    ,(string-append (assoc-ref inputs "ibus")
+                                    "/lib/girepository-1.0")))
+                 `("GI_TYPELIB_PATH" ":" prefix
+                   (,(string-append (assoc-ref inputs "ibus")
+                                    "/lib/girepository-1.0"))))
+               #t))))))
+    (inputs
+     `(("ibus" ,ibus)
+       ("libpinyin" ,libpinyin)
+       ("bdb" ,bdb)
+       ("sqlite" ,sqlite)
+       ("python" ,python)
+       ("pyxdg" ,python-pyxdg)
+       ("gtk+" ,gtk+)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("intltool" ,intltool)
+       ("glib" ,glib "bin")))
+    (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
+    (description
+     "This package includes a Chinese pinyin input method and a Chinese
 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
-   (home-page "https://github.com/libpinyin/ibus-libpinyin")
-   (license gpl2+)))
+    (home-page "https://github.com/libpinyin/ibus-libpinyin")
+    (license gpl2+)))
 
 (define-public libpinyin
   (package
-- 
2.19.1


[-- Attachment #5: 0004-gnu-Add-librime.patch --]
[-- Type: text/x-patch, Size: 3300 bytes --]

From 64171e63c129c89149dd5248737fa2c32468796f Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:29:33 +0800
Subject: [PATCH 4/6] gnu: Add librime.

* gnu/packages/ibus.scm (librime): New variable.
---
 gnu/packages/ibus.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 40fa93029..f689c02ba 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,21 +25,27 @@
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (gnu packages)
   #:use-module (gnu packages anthy)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages datastructures)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages logging)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages serialization)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages xorg))
 
 (define-public ibus
@@ -279,3 +286,33 @@ applications allow text input via IBus, installing this package will enable
 Japanese language input in most graphical applications.")
     (home-page "https://github.com/fujiwarat/ibus-anthy")
     (license gpl2+)))
+
+(define-public librime
+  (package
+    (name "librime")
+    (version "1.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/rime/" name
+                           "/archive/" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0qh0hy8bvj17bnzaxk0bmv4gsnbsd6jx8csr84936xmhkrysdday"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("boost" ,boost)
+       ("glog" ,glog)
+       ("leveldb" ,leveldb)
+       ("marisa" ,marisa)
+       ("opencc" ,opencc)
+       ("yaml-cpp" ,yaml-cpp)))
+    (home-page "https://rime.im/")
+    (synopsis "The core library of Rime Input Method Engine")
+    (description "@dfn{librime} is the core library of Rime Input Method
+Engine, which is a lightweight, extensible input method engine supporting
+various input schemas including glyph-based input methods, romanization-based
+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 bsd-3)))
-- 
2.19.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-gnu-Add-rime-data.patch --]
[-- Type: text/x-patch, Size: 12040 bytes --]

From deb0028e5300ef29c5af751e4df22b78e0b6986c Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:35:20 +0800
Subject: [PATCH 5/6] gnu: Add rime-data.

* gnu/packages/ibus.scm (rime-data): New variable.
---
 gnu/packages/ibus.scm | 277 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 277 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index f689c02ba..afb760293 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -25,6 +25,7 @@
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
@@ -316,3 +317,279 @@ 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 bsd-3)))
+
+(define-public rime-data
+  (package
+    (name "rime-data")
+    (version "0.38.20181029")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rime/plum.git")
+             (commit "fb4f829da2007f2dbb37d60a79bc67c25ea16568")))
+       (file-name "plum-checkout")
+       (sha256
+        (base32 "1m1wiv9j5bay4saga58c7dj4h8gqivsbyp16y245ifvxvp9czj67"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                  ; no tests
+       #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+                          "no_update=1")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda _
+             ;; Set .DEFAULT_GOAL to `all'.
+             ;; Don't build binary schemas. The output is not deterministic.
+             (substitute* "Makefile"
+               (("^\\.DEFAULT_GOAL := preset")
+                ".DEFAULT_GOAL := all"))
+             #t))
+         ;; Add schema packages into "package/rime" directory.
+         (add-after 'unpack 'add-packages
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((dest-dir "package/rime"))
+               (mkdir-p dest-dir)
+               (for-each (lambda (pkg)
+                           (symlink (assoc-ref inputs pkg)
+                                    (string-append dest-dir "/" pkg)))
+                         '("array"
+                           "bopomofo"
+                           "cangjie"
+                           "combo-pinyin"
+                           "double-pinyin"
+                           "emoji"
+                           "essay"
+                           "ipa"
+                           "jyutping"
+                           "luna-pinyin"
+                           "middle-chinese"
+                           "pinyin-simp"
+                           "prelude"
+                           "quick"
+                           "scj"
+                           "soutzoe"
+                           "stenotype"
+                           "stroke"
+                           "terra-pinyin"
+                           "wubi"
+                           "wugniu")))
+             #t))
+         (delete 'configure))))
+    (native-inputs
+     `(("array"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-array.git")
+                 (commit "906e923902147584b0b0247028a782abbfbfd8a0")))
+           (file-name "rime-array-checkout")
+           (sha256
+            (base32
+             "1alk6ghn4ji4kvp7lfm57bwm2gjh99i79r0w9naz6wkdim8idvb1"))))
+       ("bopomofo"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-bopomofo.git")
+                 (commit "8dc44ca1b6ef4e45b452e070b9da737f5da165e3")))
+           (file-name "rime-bopomofo-checkout")
+           (sha256
+            (base32
+             "16k6wfhcrw3a77rmbrp21ca0gmsmb3f68s193c1cfwr8i68k46nf"))))
+       ("cangjie"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-cangjie.git")
+                 (commit "ab085e90856b3399b374dc3c8b4cb40d11f307a8")))
+           (file-name "rime-cangjie-checkout")
+           (sha256
+            (base32
+             "11fgj0rbv9nyzfijwm2l8pm8fznhif4h27ndrrcaaylkp7p5zsx2"))))
+       ("combo-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-combo-pinyin.git")
+                 (commit "f1bae63f20504f2b8113c5cbdf2700e858aa91eb")))
+           (file-name "rime-combo-pinyin-checkout")
+           (sha256
+            (base32
+             "1l1079akwm1hw4kkn0q6x9fpylnl2ka6z2fn7lmdpfpsr0xgn0n7"))))
+       ("double-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-double-pinyin.git")
+                 (commit "2101a5cd40e511ec38835769aa66d2dddf059c2e")))
+           (file-name "rime-double-pinyin-checkout")
+           (sha256
+            (base32
+             "19hh2qm0njbfk2js678hfm2hw9b796s43vs11yy3m1v9m0gk2vi7"))))
+       ("emoji"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-emoji.git")
+                 (commit "6e6611b315f03ee4c33f958f9dbe960b13a0ed19")))
+           (file-name "rime-emoji-checkout")
+           (sha256
+            (base32
+             "1brfs3214w36j3345di9ygp468hbvbqdqpkjxxs1dbp437rayhyy"))))
+       ("essay"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-essay.git")
+                 (commit "5e5c7a0ef41c9b030abdad81a9df07b56b1661e9")))
+           (file-name "rime-essay-checkout")
+           (sha256
+            (base32
+             "0ana9is0zhh79m4gjshvmaxbrg3jiqysydx5bpm151i7i6vw5y1i"))))
+       ("ipa"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-ipa.git")
+                 (commit "02a9e2c181921a2e95e1a81f88188c41132755c3")))
+           (file-name "rime-ipa-checkout")
+           (sha256
+            (base32
+             "1szrxgvqlgmxapj2aflw2cvbv0p6pl0sw0gyxa13dvdhhf7s9rvr"))))
+       ("jyutping"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-jyutping.git")
+                 (commit "1402ec3d6cc0973f952fe3f9ef531294e4ffe9e0")))
+           (file-name "rime-jyutping-checkout")
+           (sha256
+            (base32
+             "17g03dy4gw6vyc9da1wjn3iy9hx64dfnwiwsfc7bkzan22x2m4dv"))))
+       ("luna-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-luna-pinyin.git")
+                 (commit "3b05132576f5c347ff8a70857d2dae080936ac3b")))
+           (file-name "rime-luna-pinyin-checkout")
+           (sha256
+            (base32
+             "0kgnpxjn10dm2d9718r12rdjlwqd2s2h84jvkhxhh5v0dkv1anl2"))))
+       ("middle-chinese"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-middle-chinese.git")
+                 (commit "9ba8d70330654b9a730f882d35cfad7dbeddfd75")))
+           (file-name "rime-middle-chinese-checkout")
+           (sha256
+            (base32
+             "0hwg5zby5kphh0bcfay8mfxwr5bwqhamiw3cmmmf7kp9fbns5s23"))))
+       ("pinyin-simp"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-pinyin-simp.git")
+                 (commit "74357ffd62c05fb60edf6eab5b86bc8c8c1907d0")))
+           (file-name "rime-pinyin-simp-checkout")
+           (sha256
+            (base32
+             "1paw3c7pv5bl54abnp9pidfxrkchdacyxy5m9zb311p5sgm7fhxh"))))
+       ("prelude"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-prelude.git")
+                 (commit "33040568c3ddb2ee6340c9b669494317db21b77c")))
+           (file-name "rime-prelude-checkout")
+           (sha256
+            (base32
+             "1gwcasyyg6f0ib6s4qsrrjcqr1lcs7j3xqxl65rznsw44nhnbwwq"))))
+       ("quick"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-quick.git")
+                 (commit "910a97d403ad8e72f322488da146da79c19d623f")))
+           (file-name "rime-quick-checkout")
+           (sha256
+            (base32
+             "0yrq3gbfmm29xlr52rmxc41mqfrb0295q7sdhbc3ax71677mpr0y"))))
+       ("scj"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-scj.git")
+                 (commit "e0eae889f4376d2a434ac3b38523e0da7400db68")))
+           (file-name "rime-scj-checkout")
+           (sha256
+            (base32
+             "1whnv9zs349kvy0zi7dnmpqwil8i6gqwrzvhy3qdrjzy58y6gwxn"))))
+       ("soutzoe"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-soutzoe.git")
+                 (commit "e47841a8ad6341731c41cdb814b7a25c837603c4")))
+           (file-name "rime-soutzoe-checkout")
+           (sha256
+            (base32
+             "1rgpmkxa72jy6gyy44fn8azpk3amk9s9lrdf7za03nv95d0fvm0p"))))
+       ("stenotype"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-stenotype.git")
+                 (commit "d4ff379314fd95283853d1734854979cf3cbd287")))
+           (file-name "rime-stenotype-checkout")
+           (sha256
+            (base32
+             "1kckpi4l4884hvydr3d6vid3v7rsc1app29kmk7v8jf8vn16afhl"))))
+       ("stroke"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-stroke.git")
+                 (commit "cfd29c675c46cf70b7a7f0a3836a913059316a0a")))
+           (file-name "rime-stroke-checkout")
+           (sha256
+            (base32
+             "135is9c1p4lm98fd9l1gxyflkm69cv5an129ka7sk614bq84m08d"))))
+       ("terra-pinyin"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-terra-pinyin.git")
+                 (commit "15b5c73a796571cd6f9ef6c89f96656cb9df86f9")))
+           (file-name "rime-terra-pinyin-checkout")
+           (sha256
+            (base32
+             "1xsd84h1zw417h5hr4dbgyk5009zi7q2p9774w3ccr5sxgc3i3cm"))))
+       ("wubi"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-wubi.git")
+                 (commit "d44403728a0b1cd8b47cb1f81b83f58e5f790b74")))
+           (file-name "rime-wubi-checkout")
+           (sha256
+            (base32
+             "0ld31bdn94lncxd1ka44w4sbl03skh08mc927dhdmwq5bpvrgn36"))))
+       ("wugniu"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/rime/rime-wugniu.git")
+                 (commit "65bcc354ada3839591d7546a64c71dbdd0592b02")))
+           (file-name "rime-wugniu-checkout")
+           (sha256
+            (base32
+             "0g31awp40s778sp5c290x40s8np86n8aw011s17sslxrqhhb0bkx"))))))
+    (home-page "https://rime.im/")
+    (synopsis "Schema data of Rime Input Method Engine")
+    (description "@dfn{rime-data} provides the schema data of Rime Input
+Method Engine.")
+    (license lgpl3+)))
-- 
2.19.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: 0006-gnu-Add-ibus-rime.patch --]
[-- Type: text/x-patch, Size: 3496 bytes --]

From 6f4dff509ac17ce28709959876a9280a172296d4 Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Mon, 29 Oct 2018 11:46:03 +0800
Subject: [PATCH 6/6] gnu: Add ibus-rime.

* gnu/packages/ibus.scm (ibus-rime): New variable.
---
 gnu/packages/ibus.scm | 59 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index afb760293..8ad1e0985 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages datastructures)
   #:use-module (gnu packages freedesktop)
@@ -593,3 +594,61 @@ traditional Chinese output.")
     (description "@dfn{rime-data} provides the schema data of Rime Input
 Method Engine.")
     (license lgpl3+)))
+
+(define-public ibus-rime
+  (package
+    (name "ibus-rime")
+    (version "1.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/rime/" name
+                           "/archive/" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0mfbz0vwky7n4wvxrwabnn1i9n9adnql0dd1rx57w1anaslr5amj"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; no tests
+       #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Define RIME_DATA_DIR. It's required but not used by the code.
+             (substitute* "Makefile"
+               (("cmake")
+                (string-append "cmake -DRIME_DATA_DIR="
+                               (assoc-ref inputs "rime-data")
+                               "/share/rime-data")))
+             ;; rime_config.h defines the actual data directory.
+             (substitute* "rime_config.h"
+               (("^#define IBUS_RIME_INSTALL_PREFIX .*$")
+                (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
+                               (assoc-ref outputs "out")
+                               "\"\n"))
+               (("^#define IBUS_RIME_SHARED_DATA_DIR .*$")
+                (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
+                               (assoc-ref inputs "rime-data")
+                               "/share/rime-data\"\n")))
+             #t))
+         (delete 'configure))))
+    (inputs
+     `(("gdk-pixbuf" ,gdk-pixbuf)
+       ("glib" ,glib)
+       ("ibus" ,ibus)
+       ("libnotify" ,libnotify)
+       ("librime" ,librime)
+       ("rime-data" ,rime-data)))
+    (native-inputs
+     `(("cmake" ,cmake)
+       ("pkg-config" ,pkg-config)))
+    (home-page "https://rime.im/")
+    (synopsis "Rime Input Method Engine for IBus")
+    (description "@dfn{ibus-rime} provides the Rime input method engine for
+IBus.  Rime is a lightweight, extensible input method engine supporting
+various input schemas including glyph-based input methods, romanization-based
+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+)))
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#33203] [patch] Rime Input Method Engine
  2018-11-01 15:29   ` Meiyo Peng
@ 2018-11-10 20:55     ` Ludovic Courtès
  2018-11-10 21:00     ` Ludovic Courtès
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-11-10 20:55 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: 33203

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

Hi Meiyo,

Thanks for this patch series!

Meiyo Peng <meiyo.peng@gmail.com> skribis:

> From 0435a5d28299f1355eb6ac8d9e7f4520756e179d Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Mon, 29 Oct 2018 11:17:50 +0800
> Subject: [PATCH 1/6] gnu: Add marisa.
>
> * gnu/packages/datastructures.scm (marisa): New variable.

Applied with the changes below.  Thanks!

(Looking at the other patches now…)

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1544 bytes --]

diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm
index e021cc6a6c..4e5e59a2e3 100644
--- a/gnu/packages/datastructures.scm
+++ b/gnu/packages/datastructures.scm
@@ -21,7 +21,6 @@
 (define-module (gnu packages datastructures)
   #:use-module (gnu packages)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages autotools)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -63,20 +62,14 @@ and heaps.")
        (sha256
         (base32 "19ifrcmnbr9whaaf4ly3s9ndyiq9sjqhnfkrxbz9zsb44w2n36hf"))))
     (build-system gnu-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'autoreconf
-           (lambda _
-             (invoke "autoreconf" "-i"))))))
-    (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("libtool" ,libtool)))
     (home-page "https://github.com/s-yata/marisa-trie")
-    (synopsis "Matching Algorithm with Recursively Implemented StorAge")
+    (synopsis "Trie data structure C++ library")
     (description "Matching Algorithm with Recursively Implemented
-StorAge (MARISA) is a static and space-efficient trie data structure.")
+StorAge (MARISA) is a static and space-efficient trie data structure C++
+library.")
+
+    ;; Dual-licensed, according to docs/readme.en.html (source files lack
+    ;; copyright/license headers.)
     (license (list license:bsd-2 license:lgpl2.1+))))
 
 (define-public sparsehash

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#33203] [patch] Rime Input Method Engine
  2018-11-01 15:29   ` Meiyo Peng
  2018-11-10 20:55     ` Ludovic Courtès
@ 2018-11-10 21:00     ` Ludovic Courtès
  2018-11-10 21:01     ` Ludovic Courtès
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-11-10 21:00 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: 33203

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

Meiyo Peng <meiyo.peng@gmail.com> skribis:

> From 17a253ac1b8e7bc9a7a97338463c526a61d51730 Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Mon, 29 Oct 2018 11:22:55 +0800
> Subject: [PATCH 2/6] gnu: Add opencc.
>
> * gnu/packages/textutils.scm (opencc): New variable.

Applied with the minor changes below: we don’t mention that the program
is free since every package is free in Guix.

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1018 bytes --]

diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 8fd0570f1c..1d498b5a75 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -774,9 +774,9 @@ indentation.
     (native-inputs
      `(("python" ,python-wrapper)))
     (home-page "https://github.com/BYVoid/OpenCC")
-    (synopsis "Open Chinese Convert")
-    (description "Open Chinese Convert (OpenCC) is an opensource project for
-conversion between Traditional Chinese and Simplified Chinese, supporting
-character-level conversion, phrase-level conversion, variant conversion and
-regional idioms among Mainland China, Taiwan and Hong kong.")
+    (synopsis "Convert between Traditional Chinese and Simplified Chinese")
+    (description "Open Chinese Convert (OpenCC) converts between Traditional
+Chinese and Simplified Chinese, supporting character-level conversion,
+phrase-level conversion, variant conversion, and regional idioms among
+Mainland China, Taiwan, and Hong-Kong.")
     (license license:asl2.0)))

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#33203] [patch] Rime Input Method Engine
  2018-11-01 15:29   ` Meiyo Peng
  2018-11-10 20:55     ` Ludovic Courtès
  2018-11-10 21:00     ` Ludovic Courtès
@ 2018-11-10 21:01     ` Ludovic Courtès
  2018-11-10 21:44     ` Ludovic Courtès
                       ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-11-10 21:01 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: 33203

Meiyo Peng <meiyo.peng@gmail.com> skribis:

> From d550f8b9ab2e16e7a01f42433111dac37b7f2b41 Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Mon, 29 Oct 2018 13:20:18 +0800
> Subject: [PATCH 3/6] gnu: ibus: Indent code properly.
>
> * gnu/packages/ibus.scm (ibus, ibus-libpinyin): Indent code properly.

OK!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#33203] [patch] Rime Input Method Engine
  2018-11-01 15:29   ` Meiyo Peng
                       ` (2 preceding siblings ...)
  2018-11-10 21:01     ` Ludovic Courtès
@ 2018-11-10 21:44     ` Ludovic Courtès
  2018-11-10 21:47     ` Ludovic Courtès
  2018-11-10 21:51     ` bug#33203: " Ludovic Courtès
  5 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-11-10 21:44 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: 33203

Meiyo Peng <meiyo.peng@gmail.com> skribis:

> From 64171e63c129c89149dd5248737fa2c32468796f Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Mon, 29 Oct 2018 11:29:33 +0800
> Subject: [PATCH 4/6] gnu: Add librime.
>
> * gnu/packages/ibus.scm (librime): New variable.

Applied!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#33203] [patch] Rime Input Method Engine
  2018-11-01 15:29   ` Meiyo Peng
                       ` (3 preceding siblings ...)
  2018-11-10 21:44     ` Ludovic Courtès
@ 2018-11-10 21:47     ` Ludovic Courtès
  2018-11-10 21:51     ` bug#33203: " Ludovic Courtès
  5 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-11-10 21:47 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: 33203

Meiyo Peng <meiyo.peng@gmail.com> skribis:

> From deb0028e5300ef29c5af751e4df22b78e0b6986c Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Mon, 29 Oct 2018 11:35:20 +0800
> Subject: [PATCH 5/6] gnu: Add rime-data.
>
> * gnu/packages/ibus.scm (rime-data): New variable.

Applied!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33203: [patch] Rime Input Method Engine
  2018-11-01 15:29   ` Meiyo Peng
                       ` (4 preceding siblings ...)
  2018-11-10 21:47     ` Ludovic Courtès
@ 2018-11-10 21:51     ` Ludovic Courtès
  5 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2018-11-10 21:51 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: 33203-done

Meiyo Peng <meiyo.peng@gmail.com> skribis:

> From 6f4dff509ac17ce28709959876a9280a172296d4 Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Mon, 29 Oct 2018 11:46:03 +0800
> Subject: [PATCH 6/6] gnu: Add ibus-rime.
>
> * gnu/packages/ibus.scm (ibus-rime): New variable.

Applied, thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-10 21:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-30 14:33 [bug#33203] [patch] Rime Input Method Engine Meiyo Peng
2018-10-31  4:33 ` Meiyo Peng
2018-11-01 15:29   ` Meiyo Peng
2018-11-10 20:55     ` Ludovic Courtès
2018-11-10 21:00     ` Ludovic Courtès
2018-11-10 21:01     ` Ludovic Courtès
2018-11-10 21:44     ` Ludovic Courtès
2018-11-10 21:47     ` Ludovic Courtès
2018-11-10 21:51     ` bug#33203: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.