From: Ricardo Wurmus <rekado@elephly.net>
To: guix-devel <guix-devel@gnu.org>
Subject: [PATCH] Add ibus-libpinyin.
Date: Wed, 09 Sep 2015 08:14:36 +0200 [thread overview]
Message-ID: <874mj4azlf.fsf@elephly.net> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-libpinyin.patch --]
[-- Type: text/x-patch, Size: 2802 bytes --]
From 984245dcc1359c4de3ff3a26c0d1d6427a88b6fa Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Wed, 9 Sep 2015 07:27:18 +0200
Subject: [PATCH 1/2] gnu: Add libpinyin.
* gnu/packages/ibus.scm (libpinyin): New variable.
---
gnu/packages/ibus.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index b2d3fa5..6b8d262 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,51 @@ 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 "http://downloads.sourceforge.net/libpinyin/"
+ "models/model10.text.tar.gz"))
+ (sha256
+ (base32
+ "0g489wqcfklxphhxpkh8i4qf9y8scmnmdbfrzdbrgf3rignbwyiw"))))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("tar" ,tar)
+ ("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+)))
--
2.5.0
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-ibus-libpinyin.patch --]
[-- Type: text/x-patch, Size: 3249 bytes --]
From d474729c8f8951e2c7e45cc7dba1b1542ab0e5a8 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Wed, 9 Sep 2015 07:28:23 +0200
Subject: [PATCH 2/2] gnu: Add ibus-libpinyin.
* gnu/packages/ibus.scm (ibus-libpinyin): New variable.
---
gnu/packages/ibus.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 6b8d262..7eb9e60 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -26,6 +26,8 @@
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
+ #:use-module (gnu packages databases)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gtk)
@@ -101,6 +103,59 @@ may also simplify input method development.")
(home-page "http://ibus.googlecode.com/")
(license lgpl2.1+)))
+(define-public ibus-libpinyin
+ (package
+ (name "ibus-libpinyin")
+ (version "1.7.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/libpinyin/"
+ "ibus-libpinyin/archive/" version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "080ixx5lih9lr78b061y67dqmiyc7ij87jl1sa26hhs1dr28ihka"))))
+ (build-system glib-or-gtk-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'autogen
+ (lambda _ (and (zero? (system* "intltoolize"))
+ (zero? (system* "autoreconf" "-vif")))))
+ (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-2)
+ ("pyxdg" ,python2-pyxdg)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("intltool" ,intltool)
+ ("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
+ (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+)))
+
(define-public libpinyin
(package
(name "libpinyin")
--
2.5.0
next reply other threads:[~2015-09-09 6:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 6:14 Ricardo Wurmus [this message]
2015-09-09 20:07 ` [PATCH] Add ibus-libpinyin Ludovic Courtès
2015-09-12 20:54 ` Ricardo Wurmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874mj4azlf.fsf@elephly.net \
--to=rekado@elephly.net \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.