summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2015-09-09 07:27:18 +0200
committerRicardo Wurmus <rekado@elephly.net>2015-09-12 22:51:44 +0200
commit12edffe4292587ef4f7050a8dd69387d2e3ee72f (patch)
tree90c8a853edbed82db2701c67e89ea05e362f2921 /gnu
parent5708a92acec622693129cc1e6b3843ba781c314e (diff)
downloadguix-12edffe4292587ef4f7050a8dd69387d2e3ee72f.tar.gz
gnu: Add libpinyin.
* gnu/packages/ibus.scm (libpinyin): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ibus.scm49
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index b2d3fa5808..124bac5609 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -24,6 +24,8 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
@@ -98,3 +100,50 @@ input method user interface.  It comes with multilingual input support.  It
 may also simplify input method development.")
    (home-page "http://ibus.googlecode.com/")
    (license lgpl2.1+)))
+
+(define-public libpinyin
+  (package
+    (name "libpinyin")
+    (version "1.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/libpinyin/libpinyin/archive/"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "04didxd39vlry6nqy7xqynwc68ndajnhw334wahfmp7zjbbscs7p"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autogen
+          (lambda _ (zero? (system* "autoreconf" "-vif"))))
+         (add-after 'unpack 'unpack-model
+          (lambda* (#:key inputs #:allow-other-keys)
+            (zero? (system* "tar" "-xvf"
+                            (assoc-ref inputs "model")
+                            "-C" "data")))))))
+    (inputs
+     `(("glib" ,glib)
+       ("bdb" ,bdb)
+       ("model"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append "mirror://sourceforge/libpinyin/"
+                               "models/model10.text.tar.gz"))
+           (sha256
+            (base32
+             "0g489wqcfklxphhxpkh8i4qf9y8scmnmdbfrzdbrgf3rignbwyiw"))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
+    (synopsis "Library to handle Chinese Pinyin")
+    (description
+     "The libpinyin C++ library provides algorithms needed for sentence-based
+Chinese pinyin input methods.")
+    (home-page "https://github.com/libpinyin/libpinyin")
+    (license gpl2+)))