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>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages ibus)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system glib-or-gtk)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages anthy)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages freedesktop)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gnome)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages iso-codes)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages xorg))
50 (uri (string-append "https://github.com/ibus/ibus/"
52 version "/ibus-" version ".tar.gz"))
55 "06fj7lawww5d5w73pk249191lvmpz7shlxfxia74bjkpb42shiq3"))))
56 (build-system glib-or-gtk-build-system)
58 `(#:tests? #f ; tests fail because there's no connection to dbus
59 #:configure-flags '("--disable-emoji-dict" ; cannot find emoji.json path
63 (string-append "pyoverridesdir="
64 (assoc-ref %outputs "out")
65 "/lib/python2.7/site-packages/gi/overrides/")
66 (string-append "py2overridesdir="
67 (assoc-ref %outputs "out")
68 "/lib/python2.7/site-packages/gi/overrides/"))
70 (modify-phases %standard-phases
71 (add-before 'configure 'disable-dconf-update
73 (substitute* "data/dconf/Makefile.in"
74 (("dconf update") "echo dconf update"))
76 (add-after 'unpack 'delete-generated-files
78 (for-each (lambda (file)
79 (let ((c (string-append (string-drop-right file 4) "c")))
80 (when (file-exists? c)
81 (format #t "deleting ~a\n" c)
83 (find-files "." "\\.vala"))
85 (add-after 'unpack 'fix-paths
86 (lambda* (#:key inputs #:allow-other-keys)
87 (substitute* "src/ibusenginesimple.c"
88 (("/usr/share/X11/locale")
89 (string-append (assoc-ref inputs "libx11")
90 "/share/X11/locale")))
91 (substitute* "ui/gtk3/xkblayout.vala"
92 (("\"(setxkbmap|xmodmap)\"" _ prog)
93 (string-append "\"" (assoc-ref inputs prog) "\"")))
95 (add-after 'wrap-program 'wrap-with-additional-paths
96 (lambda* (#:key outputs #:allow-other-keys)
97 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
99 (let ((out (assoc-ref outputs "out")))
100 (wrap-program (string-append out "/bin/ibus-setup")
101 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
102 `("GI_TYPELIB_PATH" ":" prefix
103 (,(getenv "GI_TYPELIB_PATH")
104 ,(string-append out "/lib/girepository-1.0")))))
112 ("intltool" ,intltool)
113 ("json-glib" ,json-glib)
114 ("libnotify" ,libnotify)
116 ("setxkbmap" ,setxkbmap)
119 ("iso-codes" ,iso-codes)
120 ("pygobject2" ,python2-pygobject)
121 ("python2" ,python-2)))
123 `(("glib" ,glib "bin") ; for glib-genmarshal
124 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
126 ("pkg-config" ,pkg-config)))
128 (list (search-path-specification
129 (variable "IBUS_COMPONENT_PATH")
130 (files '("share/ibus/component")))))
131 (synopsis "Input method framework")
133 "IBus is an input framework providing a full-featured and user-friendly
134 input method user interface. It comes with multilingual input support. It
135 may also simplify input method development.")
136 (home-page "https://github.com/ibus/ibus/wiki")
139 (define-public ibus-libpinyin
141 (name "ibus-libpinyin")
145 (uri (string-append "https://github.com/libpinyin/"
146 "ibus-libpinyin/archive/" version ".tar.gz"))
147 (file-name (string-append name "-" version ".tar.gz"))
150 "0wpgs0m62l4zlis9f11b7xknhgnw2xw485nc2xrzk880s17pp1mr"))))
151 (build-system glib-or-gtk-build-system)
154 (modify-phases %standard-phases
155 (add-after 'unpack 'autogen
156 (lambda _ (and (zero? (system* "intltoolize"))
157 (zero? (system* "autoreconf" "-vif")))))
158 (add-after 'wrap-program 'wrap-with-additional-paths
159 (lambda* (#:key inputs outputs #:allow-other-keys)
160 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
161 ;; PYTHONPATH and GI_TYPELIB_PATH.
162 (let ((out (assoc-ref outputs "out")))
163 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
164 `("PYTHONPATH" ":" prefix
165 (,(getenv "PYTHONPATH")
166 ,(string-append (assoc-ref inputs "ibus")
167 "/lib/girepository-1.0")))
168 `("GI_TYPELIB_PATH" ":" prefix
169 (,(string-append (assoc-ref inputs "ibus")
170 "/lib/girepository-1.0"))))
174 ("libpinyin" ,libpinyin)
178 ("pyxdg" ,python-pyxdg)
181 `(("pkg-config" ,pkg-config)
182 ("intltool" ,intltool)
183 ("autoconf" ,autoconf)
184 ("automake" ,automake)
186 ("libtool" ,libtool)))
187 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
189 "This package includes a Chinese pinyin input method and a Chinese
190 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
191 (home-page "https://github.com/libpinyin/ibus-libpinyin")
194 (define-public libpinyin
201 "https://github.com/libpinyin/libpinyin/archive/"
203 (file-name (string-append name "-" version ".tar.gz"))
206 "1yr4zyz3rwvmvj6bh8pc54hbp4rd2xk3g06y38z220fshx2l8pwf"))))
207 (build-system gnu-build-system)
210 (modify-phases %standard-phases
211 (add-before 'configure 'autogen
212 (lambda _ (zero? (system* "autoreconf" "-vif"))))
213 (add-after 'unpack 'unpack-model
214 (lambda* (#:key inputs #:allow-other-keys)
215 (zero? (system* "tar" "-xvf"
216 (assoc-ref inputs "model")
224 (uri (string-append "mirror://sourceforge/libpinyin/"
225 "models/model14.text.tar.gz"))
228 "0qqk30nflj07zjhs231c95ln4yj4ipzwxxiwrxazrg4hb8bhypqq"))))))
230 `(("pkg-config" ,pkg-config)
231 ("autoconf" ,autoconf)
232 ("automake" ,automake)
233 ("libtool" ,libtool)))
234 (synopsis "Library to handle Chinese pinyin")
236 "The libpinyin C++ library provides algorithms needed for sentence-based
237 Chinese pinyin input methods.")
238 (home-page "https://github.com/libpinyin/libpinyin")
241 (define-public ibus-anthy
248 "https://github.com/ibus/ibus-anthy/releases/download/"
249 version "/ibus-anthy-" version ".tar.gz"))
252 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
253 (build-system gnu-build-system)
256 ;; Use absolute exec path in the anthy.xml.
257 (list (string-append "--libexecdir=" %output "/libexec"))
259 (modify-phases %standard-phases
260 (add-after 'install 'wrap-programs
261 (lambda* (#:key outputs #:allow-other-keys)
262 (let ((out (assoc-ref outputs "out")))
265 (wrap-program (string-append out "/libexec/" prog)
266 `("PYTHONPATH" ":" prefix
267 (,(getenv "PYTHONPATH")))
268 `("GI_TYPELIB_PATH" ":" prefix
269 (,(getenv "GI_TYPELIB_PATH")
270 ,(string-append out "/lib/girepository-1.0")))))
271 '("ibus-engine-anthy" "ibus-setup-anthy"))
274 `(("gettext" ,gettext-minimal)
275 ("intltool" ,intltool)
276 ("pkg-config" ,pkg-config)
282 ("gobject-introspection" ,gobject-introspection)
283 ("python-pygobject" ,python-pygobject)))
284 (synopsis "Anthy Japanese language input method for IBus")
285 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
286 adds the Anthy Japanese language input method to IBus. Because most graphical
287 applications allow text input via IBus, installing this package will enable
288 Japanese language input in most graphical applications.")
289 (home-page "https://github.com/fujiwarat/ibus-anthy")