gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / ibus.scm
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>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
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.
12 ;;;
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.
17 ;;;
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/>.
20
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))
41
42 (define-public ibus
43 (package
44 (name "ibus")
45 (version "1.5.14")
46 (source (origin
47 (method url-fetch)
48 (uri (string-append "https://github.com/ibus/ibus/"
49 "releases/download/"
50 version "/ibus-" version ".tar.gz"))
51 (sha256
52 (base32
53 "0g4x02d7j5w1lfn4zvmzsq93h17lajgn9d7hlvr6pws28vz40ax4"))))
54 (build-system glib-or-gtk-build-system)
55 (arguments
56 `(#:tests? #f ; tests fail because there's no connection to dbus
57 #:configure-flags '("--disable-emoji-dict") ; cannot find emoji.json path
58 #:make-flags
59 (list "CC=gcc"
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/"))
66 #:phases
67 (modify-phases %standard-phases
68 (add-before 'configure 'disable-dconf-update
69 (lambda _
70 (substitute* "data/dconf/Makefile.in"
71 (("dconf update") "echo dconf update"))
72 #t))
73 (add-after 'unpack 'delete-generated-files
74 (lambda _
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)
79 (delete-file c))))
80 (find-files "." "\\.vala"))
81 #t))
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) "\"")))
91 #t))
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
95 ;; GI_TYPELIB_PATH.
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")))))
102 #t)))))
103 (inputs
104 `(("dbus" ,dbus)
105 ("dconf" ,dconf)
106 ("gconf" ,gconf)
107 ("gtk2" ,gtk+-2)
108 ("gtk+" ,gtk+)
109 ("intltool" ,intltool)
110 ("json-glib" ,json-glib)
111 ("libnotify" ,libnotify)
112 ("libx11" ,libx11)
113 ("setxkbmap" ,setxkbmap)
114 ("xmodmap" ,xmodmap)
115 ("iso-codes" ,iso-codes)
116 ("pygobject2" ,python2-pygobject)
117 ("python2" ,python-2)))
118 (native-inputs
119 `(("glib" ,glib "bin") ; for glib-genmarshal
120 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
121 ("vala" ,vala)
122 ("pkg-config" ,pkg-config)))
123 (native-search-paths
124 (list (search-path-specification
125 (variable "IBUS_COMPONENT_PATH")
126 (files '("share/ibus/component")))))
127 (synopsis "Input method framework")
128 (description
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")
133 (license lgpl2.1+)))
134
135 (define-public ibus-libpinyin
136 (package
137 (name "ibus-libpinyin")
138 (version "1.7.2")
139 (source (origin
140 (method url-fetch)
141 (uri (string-append "https://github.com/libpinyin/"
142 "ibus-libpinyin/archive/" version ".tar.gz"))
143 (file-name (string-append name "-" version ".tar.gz"))
144 (sha256
145 (base32
146 "080ixx5lih9lr78b061y67dqmiyc7ij87jl1sa26hhs1dr28ihka"))))
147 (build-system glib-or-gtk-build-system)
148 (arguments
149 `(#:phases
150 (modify-phases %standard-phases
151 (add-before 'configure '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"))))
167 #t))))))
168 (inputs
169 `(("ibus" ,ibus)
170 ("libpinyin" ,libpinyin)
171 ("bdb" ,bdb)
172 ("sqlite" ,sqlite)
173 ("python" ,python-2)
174 ("pyxdg" ,python2-pyxdg)
175 ("gtk+" ,gtk+)))
176 (native-inputs
177 `(("pkg-config" ,pkg-config)
178 ("intltool" ,intltool)
179 ("autoconf" ,autoconf)
180 ("automake" ,automake)
181 ("glib" ,glib "bin")
182 ("libtool" ,libtool)))
183 (synopsis "Chinese Pinyin and ZhuYin input methods for IBus")
184 (description
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")
188 (license gpl2+)))
189
190 (define-public libpinyin
191 (package
192 (name "libpinyin")
193 (version "1.2.0")
194 (source (origin
195 (method url-fetch)
196 (uri (string-append
197 "https://github.com/libpinyin/libpinyin/archive/"
198 version ".tar.gz"))
199 (file-name (string-append name "-" version ".tar.gz"))
200 (sha256
201 (base32
202 "04didxd39vlry6nqy7xqynwc68ndajnhw334wahfmp7zjbbscs7p"))))
203 (build-system gnu-build-system)
204 (arguments
205 `(#:phases
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")
213 "-C" "data")))))))
214 (inputs
215 `(("glib" ,glib)
216 ("bdb" ,bdb)
217 ("model"
218 ,(origin
219 (method url-fetch)
220 (uri (string-append "mirror://sourceforge/libpinyin/"
221 "models/model10.text.tar.gz"))
222 (sha256
223 (base32
224 "0g489wqcfklxphhxpkh8i4qf9y8scmnmdbfrzdbrgf3rignbwyiw"))))))
225 (native-inputs
226 `(("pkg-config" ,pkg-config)
227 ("autoconf" ,autoconf)
228 ("automake" ,automake)
229 ("libtool" ,libtool)))
230 (synopsis "Library to handle Chinese Pinyin")
231 (description
232 "The libpinyin C++ library provides algorithms needed for sentence-based
233 Chinese pinyin input methods.")
234 (home-page "https://github.com/libpinyin/libpinyin")
235 (license gpl2+)))
236
237 (define-public ibus-anthy
238 (package
239 (name "ibus-anthy")
240 (version "1.5.8")
241 (source (origin
242 (method url-fetch)
243 (uri (string-append
244 "https://github.com/ibus/ibus-anthy/releases/download/"
245 version "/ibus-anthy-" version ".tar.gz"))
246 (sha256
247 (base32
248 "1aj7vnfky7izl23xyjky78z3qas3q72l3kr8dnql2lnivsrb8q1y"))))
249 (build-system gnu-build-system)
250 (arguments
251 '(#:configure-flags
252 ;; Use absolute exec path in the anthy.xml.
253 (list (string-append "--libexecdir=" %output "/libexec"))
254 #:phases
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")))
259 (for-each
260 (lambda (prog)
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"))
268 #t))))))
269 (native-inputs
270 `(("gettext" ,gettext-minimal)
271 ("intltool" ,intltool)
272 ("pkg-config" ,pkg-config)
273 ("python" ,python)))
274 (inputs
275 `(("anthy" ,anthy)
276 ("gtk+" ,gtk+)
277 ("ibus" ,ibus)
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")
286 (license gpl2+)))