[patch] Rime Input Method Engine

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Meiyo Peng
Owner
unassigned
Submitted by
Meiyo Peng
Severity
normal

Debbugs page

Meiyo Peng wrote 6 years ago
(address . guix-patches@gnu.org)
871s874i7x.fsf@gmail.com
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
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(+)

Toggle diff (58 lines)
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
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(+)

Toggle diff (41 lines)
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
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(+)

Toggle diff (76 lines)
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
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(+)

Toggle diff (76 lines)
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
Meiyo Peng wrote 6 years ago
(address . 33203@debbugs.gnu.org)
875zxispks.fsf@gmail.com
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
Meiyo Peng wrote 6 years ago
(address . 33203@debbugs.gnu.org)
874ld0stmw.fsf@gmail.com
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:

--
Meiyo Peng
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(+)

Toggle diff (58 lines)
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
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(+)

Toggle diff (41 lines)
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
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(+)

Toggle diff (76 lines)
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
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(+)

Toggle diff (76 lines)
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
Ludovic Courtès wrote 6 years ago
Re: [bug#33203] [patch] Rime Input Method Engine
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33203@debbugs.gnu.org)
87ftw8y7n4.fsf@gnu.org
Hi Meiyo,

Thanks for this patch series!

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

Toggle quote (7 lines)
> 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’.
Toggle diff (39 lines)
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
Ludovic Courtès wrote 6 years ago
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33203@debbugs.gnu.org)
87bm6wy7eo.fsf@gnu.org
Meiyo Peng <meiyo.peng@gmail.com> skribis:

Toggle quote (7 lines)
> 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’.
Toggle diff (19 lines)
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)))
Ludovic Courtès wrote 6 years ago
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33203@debbugs.gnu.org)
877ehky7d5.fsf@gnu.org
Meiyo Peng <meiyo.peng@gmail.com> skribis:

Toggle quote (7 lines)
> 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!
Ludovic Courtès wrote 6 years ago
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33203@debbugs.gnu.org)
87pnvcwqt5.fsf@gnu.org
Meiyo Peng <meiyo.peng@gmail.com> skribis:

Toggle quote (7 lines)
> 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!
Ludovic Courtès wrote 6 years ago
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33203@debbugs.gnu.org)
87lg60wqo9.fsf@gnu.org
Meiyo Peng <meiyo.peng@gmail.com> skribis:

Toggle quote (7 lines)
> 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!
Ludovic Courtès wrote 6 years ago
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33203-done@debbugs.gnu.org)
87h8gowqho.fsf@gnu.org
Meiyo Peng <meiyo.peng@gmail.com> skribis:

Toggle quote (7 lines)
> 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’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 33203@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 33203
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help