gnu: ibus: Update to 1.5.19.
[jackhill/guix/guix.git] / gnu / packages / ibus.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018 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>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
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.
14 ;;;
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.
19 ;;;
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/>.
22
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))
43
44 (define-public ibus
45 (package
46 (name "ibus")
47 (version "1.5.19")
48 (source (origin
49 (method url-fetch)
50 (uri (string-append "https://github.com/ibus/ibus/"
51 "releases/download/"
52 version "/ibus-" version ".tar.gz"))
53 (sha256
54 (base32
55 "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
56 (build-system glib-or-gtk-build-system)
57 (arguments
58 `(#:tests? #f ; tests fail because there's no connection to dbus
59 #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
60 "--disable-python2"
61 "--enable-python-library"
62 ,(string-append "--with-ucd-dir="
63 (getcwd) "/ucd")
64 "--enable-wayland")
65 #:make-flags
66 (list "CC=gcc"
67 (string-append "pyoverridesdir="
68 (assoc-ref %outputs "out")
69 "/lib/python3.6/site-packages/gi/overrides/"))
70 #:phases
71 (modify-phases %standard-phases
72 (add-after 'unpack 'prepare-ucd-dir
73 (lambda* (#:key inputs #:allow-other-keys)
74 (mkdir-p "../ucd")
75 (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
76 (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
77 #t))
78 (add-before 'configure 'disable-dconf-update
79 (lambda _
80 (substitute* "data/dconf/Makefile.in"
81 (("dconf update") "echo dconf update"))
82 #t))
83 (add-after 'unpack 'delete-generated-files
84 (lambda _
85 (for-each (lambda (file)
86 (let ((c (string-append (string-drop-right file 4) "c")))
87 (when (file-exists? c)
88 (format #t "deleting ~a\n" c)
89 (delete-file c))))
90 (find-files "." "\\.vala"))
91 #t))
92 (add-after 'unpack 'fix-paths
93 (lambda* (#:key inputs #:allow-other-keys)
94 (substitute* "src/ibusenginesimple.c"
95 (("/usr/share/X11/locale")
96 (string-append (assoc-ref inputs "libx11")
97 "/share/X11/locale")))
98 (substitute* "ui/gtk3/xkblayout.vala"
99 (("\"(setxkbmap|xmodmap)\"" _ prog)
100 (string-append "\"" (assoc-ref inputs prog) "\"")))
101 #t))
102 (add-after 'wrap-program 'wrap-with-additional-paths
103 (lambda* (#:key outputs #:allow-other-keys)
104 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
105 ;; GI_TYPELIB_PATH.
106 (let ((out (assoc-ref outputs "out")))
107 (wrap-program (string-append out "/bin/ibus-setup")
108 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
109 `("GI_TYPELIB_PATH" ":" prefix
110 (,(getenv "GI_TYPELIB_PATH")
111 ,(string-append out "/lib/girepository-1.0")))))
112 #t)))))
113 (inputs
114 `(("dbus" ,dbus)
115 ("dconf" ,dconf)
116 ("gconf" ,gconf)
117 ("gtk2" ,gtk+-2)
118 ("gtk+" ,gtk+)
119 ("intltool" ,intltool)
120 ("json-glib" ,json-glib)
121 ("libnotify" ,libnotify)
122 ("libx11" ,libx11)
123 ("setxkbmap" ,setxkbmap)
124 ("wayland" ,wayland)
125 ("xmodmap" ,xmodmap)
126 ("iso-codes" ,iso-codes)
127 ("pygobject2" ,python-pygobject)
128 ("python" ,python)))
129 (native-inputs
130 `(("glib" ,glib "bin") ; for glib-genmarshal
131 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
132 ("unicode-nameslist"
133 ,(origin
134 (method url-fetch)
135 (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
136 (sha256
137 (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
138 ("unicode-blocks"
139 ,(origin
140 (method url-fetch)
141 (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
142 (sha256
143 (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
144 ("vala" ,vala)
145 ("pkg-config" ,pkg-config)))
146 (native-search-paths
147 (list (search-path-specification
148 (variable "IBUS_COMPONENT_PATH")
149 (files '("share/ibus/component")))))
150 (synopsis "Input method framework")
151 (description
152 "IBus is an input framework providing a full-featured and user-friendly
153 input method user interface. It comes with multilingual input support. It
154 may also simplify input method development.")
155 (home-page "https://github.com/ibus/ibus/wiki")
156 (license lgpl2.1+)))
157
158 (define-public ibus-libpinyin
159 (package
160 (name "ibus-libpinyin")
161 (version "1.10.0")
162 (source (origin
163 (method url-fetch)
164 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
165 "releases/download/" version
166 "/ibus-libpinyin-" version ".tar.gz"))
167 (sha256
168 (base32
169 "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
170 (build-system glib-or-gtk-build-system)
171 (arguments
172 `(#:phases
173 (modify-phases %standard-phases
174 (add-after 'wrap-program 'wrap-with-additional-paths
175 (lambda* (#:key inputs outputs #:allow-other-keys)
176 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
177 ;; PYTHONPATH and GI_TYPELIB_PATH.
178 (let ((out (assoc-ref outputs "out")))
179 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
180 `("PYTHONPATH" ":" prefix
181 (,(getenv "PYTHONPATH")
182 ,(string-append (assoc-ref inputs "ibus")
183 "/lib/girepository-1.0")))
184 `("GI_TYPELIB_PATH" ":" prefix
185 (,(string-append (assoc-ref inputs "ibus")
186 "/lib/girepository-1.0"))))
187 #t))))))
188 (inputs
189 `(("ibus" ,ibus)
190 ("libpinyin" ,libpinyin)
191 ("bdb" ,bdb)
192 ("sqlite" ,sqlite)
193 ("python" ,python)
194 ("pyxdg" ,python-pyxdg)
195 ("gtk+" ,gtk+)))
196 (native-inputs
197 `(("pkg-config" ,pkg-config)
198 ("intltool" ,intltool)
199 ("glib" ,glib "bin")))
200 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
201 (description
202 "This package includes a Chinese pinyin input method and a Chinese
203 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
204 (home-page "https://github.com/libpinyin/ibus-libpinyin")
205 (license gpl2+)))
206
207 (define-public libpinyin
208 (package
209 (name "libpinyin")
210 (version "2.2.0")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "https://github.com/libpinyin/libpinyin/"
214 "releases/download/" version
215 "/libpinyin-2.2.0.tar.gz"))
216 (sha256
217 (base32
218 "1c4wxvcvjxvk23mcwqvsfsv4nhimx4kpjhabxa28gx1ih10l88gj"))))
219 (build-system gnu-build-system)
220 (inputs
221 `(("glib" ,glib)
222 ("bdb" ,bdb)))
223 (native-inputs
224 `(("pkg-config" ,pkg-config)))
225 (synopsis "Library to handle Chinese pinyin")
226 (description
227 "The libpinyin C++ library provides algorithms needed for sentence-based
228 Chinese pinyin input methods.")
229 (home-page "https://github.com/libpinyin/libpinyin")
230 (license gpl2+)))
231
232 (define-public ibus-anthy
233 (package
234 (name "ibus-anthy")
235 (version "1.5.9")
236 (source (origin
237 (method url-fetch)
238 (uri (string-append
239 "https://github.com/ibus/ibus-anthy/releases/download/"
240 version "/ibus-anthy-" version ".tar.gz"))
241 (sha256
242 (base32
243 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
244 (build-system gnu-build-system)
245 (arguments
246 '(#:configure-flags
247 ;; Use absolute exec path in the anthy.xml.
248 (list (string-append "--libexecdir=" %output "/libexec"))
249 #:phases
250 (modify-phases %standard-phases
251 (add-after 'install 'wrap-programs
252 (lambda* (#:key outputs #:allow-other-keys)
253 (let ((out (assoc-ref outputs "out")))
254 (for-each
255 (lambda (prog)
256 (wrap-program (string-append out "/libexec/" prog)
257 `("PYTHONPATH" ":" prefix
258 (,(getenv "PYTHONPATH")))
259 `("GI_TYPELIB_PATH" ":" prefix
260 (,(getenv "GI_TYPELIB_PATH")
261 ,(string-append out "/lib/girepository-1.0")))))
262 '("ibus-engine-anthy" "ibus-setup-anthy"))
263 #t))))))
264 (native-inputs
265 `(("gettext" ,gettext-minimal)
266 ("intltool" ,intltool)
267 ("pkg-config" ,pkg-config)
268 ("python" ,python)))
269 (inputs
270 `(("anthy" ,anthy)
271 ("gtk+" ,gtk+)
272 ("ibus" ,ibus)
273 ("gobject-introspection" ,gobject-introspection)
274 ("python-pygobject" ,python-pygobject)))
275 (synopsis "Anthy Japanese language input method for IBus")
276 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
277 adds the Anthy Japanese language input method to IBus. Because most graphical
278 applications allow text input via IBus, installing this package will enable
279 Japanese language input in most graphical applications.")
280 (home-page "https://github.com/fujiwarat/ibus-anthy")
281 (license gpl2+)))