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>
5 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages ibus)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system glib-or-gtk)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages anthy)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages databases)
33 #:use-module (gnu packages freedesktop)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages gnome)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages iso-codes)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages xorg))
49 (uri (string-append "https://github.com/ibus/ibus/"
51 version "/ibus-" version ".tar.gz"))
54 "06fj7lawww5d5w73pk249191lvmpz7shlxfxia74bjkpb42shiq3"))))
55 (build-system glib-or-gtk-build-system)
57 `(#:tests? #f ; tests fail because there's no connection to dbus
58 #:configure-flags '("--disable-emoji-dict" ; cannot find emoji.json path
62 (string-append "pyoverridesdir="
63 (assoc-ref %outputs "out")
64 "/lib/python2.7/site-packages/gi/overrides/")
65 (string-append "py2overridesdir="
66 (assoc-ref %outputs "out")
67 "/lib/python2.7/site-packages/gi/overrides/"))
69 (modify-phases %standard-phases
70 (add-before 'configure 'disable-dconf-update
72 (substitute* "data/dconf/Makefile.in"
73 (("dconf update") "echo dconf update"))
75 (add-after 'unpack 'delete-generated-files
77 (for-each (lambda (file)
78 (let ((c (string-append (string-drop-right file 4) "c")))
79 (when (file-exists? c)
80 (format #t "deleting ~a\n" c)
82 (find-files "." "\\.vala"))
84 (add-after 'unpack 'fix-paths
85 (lambda* (#:key inputs #:allow-other-keys)
86 (substitute* "src/ibusenginesimple.c"
87 (("/usr/share/X11/locale")
88 (string-append (assoc-ref inputs "libx11")
89 "/share/X11/locale")))
90 (substitute* "ui/gtk3/xkblayout.vala"
91 (("\"(setxkbmap|xmodmap)\"" _ prog)
92 (string-append "\"" (assoc-ref inputs prog) "\"")))
94 (add-after 'wrap-program 'wrap-with-additional-paths
95 (lambda* (#:key outputs #:allow-other-keys)
96 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
98 (let ((out (assoc-ref outputs "out")))
99 (wrap-program (string-append out "/bin/ibus-setup")
100 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
101 `("GI_TYPELIB_PATH" ":" prefix
102 (,(getenv "GI_TYPELIB_PATH")
103 ,(string-append out "/lib/girepository-1.0")))))
111 ("intltool" ,intltool)
112 ("json-glib" ,json-glib)
113 ("libnotify" ,libnotify)
115 ("setxkbmap" ,setxkbmap)
118 ("iso-codes" ,iso-codes)
119 ("pygobject2" ,python2-pygobject)
120 ("python2" ,python-2)))
122 `(("glib" ,glib "bin") ; for glib-genmarshal
123 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
125 ("pkg-config" ,pkg-config)))
127 (list (search-path-specification
128 (variable "IBUS_COMPONENT_PATH")
129 (files '("share/ibus/component")))))
130 (synopsis "Input method framework")
132 "IBus is an input framework providing a full-featured and user-friendly
133 input method user interface. It comes with multilingual input support. It
134 may also simplify input method development.")
135 (home-page "https://github.com/ibus/ibus/wiki")
138 (define-public ibus-libpinyin
140 (name "ibus-libpinyin")
144 (uri (string-append "https://github.com/libpinyin/"
145 "ibus-libpinyin/archive/" version ".tar.gz"))
146 (file-name (string-append name "-" version ".tar.gz"))
149 "0wpgs0m62l4zlis9f11b7xknhgnw2xw485nc2xrzk880s17pp1mr"))))
150 (build-system glib-or-gtk-build-system)
153 (modify-phases %standard-phases
154 (add-after 'unpack 'autogen
155 (lambda _ (and (zero? (system* "intltoolize"))
156 (zero? (system* "autoreconf" "-vif")))))
157 (add-after 'wrap-program 'wrap-with-additional-paths
158 (lambda* (#:key inputs outputs #:allow-other-keys)
159 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
160 ;; PYTHONPATH and GI_TYPELIB_PATH.
161 (let ((out (assoc-ref outputs "out")))
162 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
163 `("PYTHONPATH" ":" prefix
164 (,(getenv "PYTHONPATH")
165 ,(string-append (assoc-ref inputs "ibus")
166 "/lib/girepository-1.0")))
167 `("GI_TYPELIB_PATH" ":" prefix
168 (,(string-append (assoc-ref inputs "ibus")
169 "/lib/girepository-1.0"))))
173 ("libpinyin" ,libpinyin)
177 ("pyxdg" ,python-pyxdg)
180 `(("pkg-config" ,pkg-config)
181 ("intltool" ,intltool)
182 ("autoconf" ,autoconf)
183 ("automake" ,automake)
185 ("libtool" ,libtool)))
186 (synopsis "Chinese Pinyin and ZhuYin input methods for IBus")
188 "This package includes a Chinese Pinyin input method and a Chinese
189 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
190 (home-page "https://github.com/libpinyin/ibus-libpinyin")
193 (define-public libpinyin
200 "https://github.com/libpinyin/libpinyin/archive/"
202 (file-name (string-append name "-" version ".tar.gz"))
205 "1iijpin65cmgawfx7sfdw1anmabljva0af1f9gx8ad6b4slhvknn"))))
206 (build-system gnu-build-system)
209 (modify-phases %standard-phases
210 (add-before 'configure 'autogen
211 (lambda _ (zero? (system* "autoreconf" "-vif"))))
212 (add-after 'unpack 'unpack-model
213 (lambda* (#:key inputs #:allow-other-keys)
214 (zero? (system* "tar" "-xvf"
215 (assoc-ref inputs "model")
223 (uri (string-append "mirror://sourceforge/libpinyin/"
224 "models/model14.text.tar.gz"))
227 "0qqk30nflj07zjhs231c95ln4yj4ipzwxxiwrxazrg4hb8bhypqq"))))))
229 `(("pkg-config" ,pkg-config)
230 ("autoconf" ,autoconf)
231 ("automake" ,automake)
232 ("libtool" ,libtool)))
233 (synopsis "Library to handle Chinese Pinyin")
235 "The libpinyin C++ library provides algorithms needed for sentence-based
236 Chinese pinyin input methods.")
237 (home-page "https://github.com/libpinyin/libpinyin")
240 (define-public ibus-anthy
247 "https://github.com/ibus/ibus-anthy/releases/download/"
248 version "/ibus-anthy-" version ".tar.gz"))
251 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
252 (build-system gnu-build-system)
255 ;; Use absolute exec path in the anthy.xml.
256 (list (string-append "--libexecdir=" %output "/libexec"))
258 (modify-phases %standard-phases
259 (add-after 'install 'wrap-programs
260 (lambda* (#:key outputs #:allow-other-keys)
261 (let ((out (assoc-ref outputs "out")))
264 (wrap-program (string-append out "/libexec/" prog)
265 `("PYTHONPATH" ":" prefix
266 (,(getenv "PYTHONPATH")))
267 `("GI_TYPELIB_PATH" ":" prefix
268 (,(getenv "GI_TYPELIB_PATH")
269 ,(string-append out "/lib/girepository-1.0")))))
270 '("ibus-engine-anthy" "ibus-setup-anthy"))
273 `(("gettext" ,gettext-minimal)
274 ("intltool" ,intltool)
275 ("pkg-config" ,pkg-config)
281 ("gobject-introspection" ,gobject-introspection)
282 ("python-pygobject" ,python-pygobject)))
283 (synopsis "Anthy Japanese language input method for IBus")
284 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
285 adds the Anthy Japanese language input method to IBus. Because most graphical
286 applications allow text input via IBus, installing this package will enable
287 Japanese language input in most graphical applications.")
288 (home-page "https://github.com/fujiwarat/ibus-anthy")