unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add ibus-libpinyin.
@ 2015-09-09  6:14 Ricardo Wurmus
  2015-09-09 20:07 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2015-09-09  6:14 UTC (permalink / raw)
  To: guix-devel

[-- 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


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

* Re: [PATCH] Add ibus-libpinyin.
  2015-09-09  6:14 [PATCH] Add ibus-libpinyin Ricardo Wurmus
@ 2015-09-09 20:07 ` Ludovic Courtès
  2015-09-12 20:54   ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2015-09-09 20:07 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> skribis:

> 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.

[...]

> +        ,(origin
> +           (method url-fetch)
> +           (uri (string-append "http://downloads.sourceforge.net/libpinyin/"
> +                               "models/model10.text.tar.gz"))

Should be mirror://sourceforge/ if possible.

> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)
> +       ("tar" ,tar)

‘tar’ can be omitted, it’s an implicit input.

Otherwise OK.

> 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.

LGTM.

It’s a pity that no ‘make dist’ tarball is published; that would make
everbody’s lives easier.

Thanks,
Ludo’.

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

* Re: [PATCH] Add ibus-libpinyin.
  2015-09-09 20:07 ` Ludovic Courtès
@ 2015-09-12 20:54   ` Ricardo Wurmus
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-09-12 20:54 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> 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.
>
> [...]
>
>> +        ,(origin
>> +           (method url-fetch)
>> +           (uri (string-append "http://downloads.sourceforge.net/libpinyin/"
>> +                               "models/model10.text.tar.gz"))
>
> Should be mirror://sourceforge/ if possible.

Fixed.

>> +    (native-inputs
>> +     `(("pkg-config" ,pkg-config)
>> +       ("tar" ,tar)
>
> ‘tar’ can be omitted, it’s an implicit input.

Okay.

> It’s a pity that no ‘make dist’ tarball is published; that would make
> everbody’s lives easier.

Indeed.

I just pushed both updated patches.  Thanks!

~~ Ricardo

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

end of thread, other threads:[~2015-09-12 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-09  6:14 [PATCH] Add ibus-libpinyin Ricardo Wurmus
2015-09-09 20:07 ` Ludovic Courtès
2015-09-12 20:54   ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).