1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 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 "07py16jb81kd7vkqhcia9cb2avsbg5jswp2kzf0k4bprwkxppd9n"))))
54 (build-system glib-or-gtk-build-system)
56 `(#:tests? #f ; tests fail because there's no connection to dbus
57 #:configure-flags '("--disable-emoji-dict") ; cannot find emoji.json path
60 (string-append "pyoverridesdir="
61 (assoc-ref %outputs "out")
62 "/lib/python2.7/site-packages/gi/overrides/")
63 (string-append "py2overridesdir="
64 (assoc-ref %outputs "out")
65 "/lib/python2.7/site-packages/gi/overrides/"))
67 (modify-phases %standard-phases
68 (add-before 'configure 'disable-dconf-update
70 (substitute* "data/dconf/Makefile.in"
71 (("dconf update") "echo dconf update"))
73 (add-after 'unpack 'delete-generated-files
75 (for-each (lambda (file)
76 (let ((c (string-append (string-drop-right file 4) "c")))
77 (when (file-exists? c)
78 (format #t "deleting ~a\n" c)
80 (find-files "." "\\.vala"))
82 (add-after 'unpack 'fix-paths
83 (lambda* (#:key inputs #:allow-other-keys)
84 (substitute* "src/ibusenginesimple.c"
85 (("/usr/share/X11/locale")
86 (string-append (assoc-ref inputs "libx11")
87 "/share/X11/locale")))
88 (substitute* "ui/gtk3/xkblayout.vala"
89 (("\"(setxkbmap|xmodmap)\"" _ prog)
90 (string-append "\"" (assoc-ref inputs prog) "\"")))
92 (add-after 'wrap-program 'wrap-with-additional-paths
93 (lambda* (#:key outputs #:allow-other-keys)
94 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
96 (let ((out (assoc-ref outputs "out")))
97 (wrap-program (string-append out "/bin/ibus-setup")
98 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
99 `("GI_TYPELIB_PATH" ":" prefix
100 (,(getenv "GI_TYPELIB_PATH")
101 ,(string-append out "/lib/girepository-1.0")))))
109 ("intltool" ,intltool)
110 ("json-glib" ,json-glib)
111 ("libnotify" ,libnotify)
113 ("setxkbmap" ,setxkbmap)
115 ("iso-codes" ,iso-codes)
116 ("pygobject2" ,python2-pygobject)
117 ("python2" ,python-2)))
119 `(("glib" ,glib "bin") ; for glib-genmarshal
120 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
122 ("pkg-config" ,pkg-config)))
124 (list (search-path-specification
125 (variable "IBUS_COMPONENT_PATH")
126 (files '("share/ibus/component")))))
127 (synopsis "Input method framework")
129 "IBus is an input framework providing a full-featured and user-friendly
130 input method user interface. It comes with multilingual input support. It
131 may also simplify input method development.")
132 (home-page "https://github.com/ibus/ibus/wiki")
135 (define-public ibus-libpinyin
137 (name "ibus-libpinyin")
141 (uri (string-append "https://github.com/libpinyin/"
142 "ibus-libpinyin/archive/" version ".tar.gz"))
143 (file-name (string-append name "-" version ".tar.gz"))
146 "0gly314z6zn2fv52jw0764k66ry97llk009bk1q1iwf6rr829v68"))))
147 (build-system glib-or-gtk-build-system)
150 (modify-phases %standard-phases
151 (add-after 'unpack 'autogen
152 (lambda _ (and (zero? (system* "intltoolize"))
153 (zero? (system* "autoreconf" "-vif")))))
154 (add-after 'wrap-program 'wrap-with-additional-paths
155 (lambda* (#:key inputs outputs #:allow-other-keys)
156 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
157 ;; PYTHONPATH and GI_TYPELIB_PATH.
158 (let ((out (assoc-ref outputs "out")))
159 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
160 `("PYTHONPATH" ":" prefix
161 (,(getenv "PYTHONPATH")
162 ,(string-append (assoc-ref inputs "ibus")
163 "/lib/girepository-1.0")))
164 `("GI_TYPELIB_PATH" ":" prefix
165 (,(string-append (assoc-ref inputs "ibus")
166 "/lib/girepository-1.0"))))
170 ("libpinyin" ,libpinyin)
174 ("pyxdg" ,python2-pyxdg)
177 `(("pkg-config" ,pkg-config)
178 ("intltool" ,intltool)
179 ("autoconf" ,autoconf)
180 ("automake" ,automake)
182 ("libtool" ,libtool)))
183 (synopsis "Chinese Pinyin and ZhuYin input methods for IBus")
185 "This package includes a Chinese Pinyin input method and a Chinese
186 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
187 (home-page "https://github.com/libpinyin/ibus-libpinyin")
190 (define-public libpinyin
197 "https://github.com/libpinyin/libpinyin/archive/"
199 (file-name (string-append name "-" version ".tar.gz"))
202 "17fibx9psrxfiznm4yw8klgbnh3ksyisx0pm1n59kxkrq61v8y0b"))))
203 (build-system gnu-build-system)
206 (modify-phases %standard-phases
207 (add-before 'configure 'autogen
208 (lambda _ (zero? (system* "autoreconf" "-vif"))))
209 (add-after 'unpack 'unpack-model
210 (lambda* (#:key inputs #:allow-other-keys)
211 (zero? (system* "tar" "-xvf"
212 (assoc-ref inputs "model")
220 (uri (string-append "mirror://sourceforge/libpinyin/"
221 "models/model14.text.tar.gz"))
224 "0qqk30nflj07zjhs231c95ln4yj4ipzwxxiwrxazrg4hb8bhypqq"))))))
226 `(("pkg-config" ,pkg-config)
227 ("autoconf" ,autoconf)
228 ("automake" ,automake)
229 ("libtool" ,libtool)))
230 (synopsis "Library to handle Chinese Pinyin")
232 "The libpinyin C++ library provides algorithms needed for sentence-based
233 Chinese pinyin input methods.")
234 (home-page "https://github.com/libpinyin/libpinyin")
237 (define-public ibus-anthy
244 "https://github.com/ibus/ibus-anthy/releases/download/"
245 version "/ibus-anthy-" version ".tar.gz"))
248 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
249 (build-system gnu-build-system)
252 ;; Use absolute exec path in the anthy.xml.
253 (list (string-append "--libexecdir=" %output "/libexec"))
255 (modify-phases %standard-phases
256 (add-after 'install 'wrap-programs
257 (lambda* (#:key outputs #:allow-other-keys)
258 (let ((out (assoc-ref outputs "out")))
261 (wrap-program (string-append out "/libexec/" prog)
262 `("PYTHONPATH" ":" prefix
263 (,(getenv "PYTHONPATH")))
264 `("GI_TYPELIB_PATH" ":" prefix
265 (,(getenv "GI_TYPELIB_PATH")
266 ,(string-append out "/lib/girepository-1.0")))))
267 '("ibus-engine-anthy" "ibus-setup-anthy"))
270 `(("gettext" ,gettext-minimal)
271 ("intltool" ,intltool)
272 ("pkg-config" ,pkg-config)
278 ("gobject-introspection" ,gobject-introspection)
279 ("python-pygobject" ,python-pygobject)))
280 (synopsis "Anthy Japanese language input method for IBus")
281 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
282 adds the Anthy Japanese language input method to IBus. Because most graphical
283 applications allow text input via IBus, installing this package will enable
284 Japanese language input in most graphical applications.")
285 (home-page "https://github.com/fujiwarat/ibus-anthy")