1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages ibus)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system glib-or-gtk)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages anthy)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages databases)
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages gnome)
36 #:use-module (gnu packages gtk)
37 #:use-module (gnu packages iso-codes)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages xorg))
48 (uri (string-append "https://github.com/ibus/ibus/"
50 version "/ibus-" version ".tar.gz"))
53 "1g26llizd26h9sfz4xdq8krhz19hn08pirvfbkk3g89ri8lmm6a9"))))
54 (build-system glib-or-gtk-build-system)
56 `(#:tests? #f ; tests fail because there's no connection to dbus
59 (string-append "pyoverridesdir="
60 (assoc-ref %outputs "out")
61 "/lib/python2.7/site-packages/gi/overrides/")
62 (string-append "py2overridesdir="
63 (assoc-ref %outputs "out")
64 "/lib/python2.7/site-packages/gi/overrides/"))
66 (modify-phases %standard-phases
67 (add-before 'configure 'disable-dconf-update
69 (substitute* "data/dconf/Makefile.in"
70 (("dconf update") "echo dconf update"))
72 (add-after 'unpack 'delete-generated-files
74 (for-each (lambda (file)
75 (let ((c (string-append (string-drop-right file 4) "c")))
76 (when (file-exists? c)
77 (format #t "deleting ~a\n" c)
79 (find-files "." "\\.vala"))
81 (add-after 'unpack 'fix-paths
82 (lambda* (#:key inputs #:allow-other-keys)
83 (substitute* "src/ibusenginesimple.c"
84 (("/usr/share/X11/locale")
85 (string-append (assoc-ref inputs "libx11")
86 "/share/X11/locale")))
87 (substitute* "ui/gtk3/xkblayout.vala"
88 (("\"(setxkbmap|xmodmap)\"" _ prog)
89 (string-append "\"" (assoc-ref inputs prog) "\"")))
91 (add-after 'wrap-program 'wrap-with-additional-paths
92 (lambda* (#:key outputs #:allow-other-keys)
93 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
95 (let ((out (assoc-ref outputs "out")))
96 (wrap-program (string-append out "/bin/ibus-setup")
97 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
98 `("GI_TYPELIB_PATH" ":" prefix
99 (,(getenv "GI_TYPELIB_PATH")
100 ,(string-append out "/lib/girepository-1.0")))))
108 ("intltool" ,intltool)
109 ("libnotify" ,libnotify)
111 ("setxkbmap" ,setxkbmap)
113 ("iso-codes" ,iso-codes)
114 ("pygobject2" ,python2-pygobject)
115 ("python2" ,python-2)))
117 `(("glib" ,glib "bin") ; for glib-genmarshal
118 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
120 ("pkg-config" ,pkg-config)))
122 (list (search-path-specification
123 (variable "IBUS_COMPONENT_PATH")
124 (files '("share/ibus/component")))))
125 (synopsis "Input method framework")
127 "IBus is an input framework providing a full-featured and user-friendly
128 input method user interface. It comes with multilingual input support. It
129 may also simplify input method development.")
130 (home-page "http://ibus.googlecode.com/")
133 (define-public ibus-libpinyin
135 (name "ibus-libpinyin")
139 (uri (string-append "https://github.com/libpinyin/"
140 "ibus-libpinyin/archive/" version ".tar.gz"))
141 (file-name (string-append name "-" version ".tar.gz"))
144 "080ixx5lih9lr78b061y67dqmiyc7ij87jl1sa26hhs1dr28ihka"))))
145 (build-system glib-or-gtk-build-system)
148 (modify-phases %standard-phases
149 (add-before 'configure 'autogen
150 (lambda _ (and (zero? (system* "intltoolize"))
151 (zero? (system* "autoreconf" "-vif")))))
152 (add-after 'wrap-program 'wrap-with-additional-paths
153 (lambda* (#:key inputs outputs #:allow-other-keys)
154 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
155 ;; PYTHONPATH and GI_TYPELIB_PATH.
156 (let ((out (assoc-ref outputs "out")))
157 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
158 `("PYTHONPATH" ":" prefix
159 (,(getenv "PYTHONPATH")
160 ,(string-append (assoc-ref inputs "ibus")
161 "/lib/girepository-1.0")))
162 `("GI_TYPELIB_PATH" ":" prefix
163 (,(string-append (assoc-ref inputs "ibus")
164 "/lib/girepository-1.0"))))
168 ("libpinyin" ,libpinyin)
172 ("pyxdg" ,python2-pyxdg)
175 `(("pkg-config" ,pkg-config)
176 ("intltool" ,intltool)
177 ("autoconf" ,autoconf)
178 ("automake" ,automake)
180 ("libtool" ,libtool)))
181 (synopsis "Chinese Pinyin and ZhuYin input methods for IBus")
183 "This package includes a Chinese Pinyin input method and a Chinese
184 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
185 (home-page "https://github.com/libpinyin/ibus-libpinyin")
188 (define-public libpinyin
195 "https://github.com/libpinyin/libpinyin/archive/"
197 (file-name (string-append name "-" version ".tar.gz"))
200 "04didxd39vlry6nqy7xqynwc68ndajnhw334wahfmp7zjbbscs7p"))))
201 (build-system gnu-build-system)
204 (modify-phases %standard-phases
205 (add-before 'configure 'autogen
206 (lambda _ (zero? (system* "autoreconf" "-vif"))))
207 (add-after 'unpack 'unpack-model
208 (lambda* (#:key inputs #:allow-other-keys)
209 (zero? (system* "tar" "-xvf"
210 (assoc-ref inputs "model")
218 (uri (string-append "mirror://sourceforge/libpinyin/"
219 "models/model10.text.tar.gz"))
222 "0g489wqcfklxphhxpkh8i4qf9y8scmnmdbfrzdbrgf3rignbwyiw"))))))
224 `(("pkg-config" ,pkg-config)
225 ("autoconf" ,autoconf)
226 ("automake" ,automake)
227 ("libtool" ,libtool)))
228 (synopsis "Library to handle Chinese Pinyin")
230 "The libpinyin C++ library provides algorithms needed for sentence-based
231 Chinese pinyin input methods.")
232 (home-page "https://github.com/libpinyin/libpinyin")
235 (define-public ibus-anthy
242 "https://github.com/ibus/ibus-anthy/releases/download/"
243 version "/ibus-anthy-" version ".tar.gz"))
246 "1aj7vnfky7izl23xyjky78z3qas3q72l3kr8dnql2lnivsrb8q1y"))))
247 (build-system gnu-build-system)
250 ;; Use absolute exec path in the anthy.xml.
251 (list (string-append "--libexecdir=" %output "/libexec"))
253 (modify-phases %standard-phases
254 (add-after 'install 'wrap-programs
255 (lambda* (#:key outputs #:allow-other-keys)
256 (let ((out (assoc-ref outputs "out")))
259 (wrap-program (string-append out "/libexec/" prog)
260 `("PYTHONPATH" ":" prefix
261 (,(getenv "PYTHONPATH")))
262 `("GI_TYPELIB_PATH" ":" prefix
263 (,(getenv "GI_TYPELIB_PATH")
264 ,(string-append out "/lib/girepository-1.0")))))
265 '("ibus-engine-anthy" "ibus-setup-anthy"))
268 `(("gettext" ,gnu-gettext)
269 ("intltool" ,intltool)
270 ("pkg-config" ,pkg-config)
276 ("gobject-introspection" ,gobject-introspection)
277 ("python-pygobject" ,python-pygobject)))
278 (synopsis "Anthy Japanese language input method for IBus")
279 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
280 adds the Anthy Japanese language input method to IBus. Because most graphical
281 applications allow text input via IBus, installing this package will enable
282 Japanese language input in most graphical applications.")
283 (home-page "https://github.com/fujiwarat/ibus-anthy")