Merge branch 'master' into core-updates
[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 ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages ibus)
25 #:use-module (guix licenses)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages anthy)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages cmake)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages datastructures)
40 #:use-module (gnu packages freedesktop)
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages gnome)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages iso-codes)
46 #:use-module (gnu packages logging)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages serialization)
50 #:use-module (gnu packages textutils)
51 #:use-module (gnu packages xorg))
52
53 (define-public ibus
54 (package
55 (name "ibus")
56 (version "1.5.19")
57 (source (origin
58 (method url-fetch)
59 (uri (string-append "https://github.com/ibus/ibus/"
60 "releases/download/"
61 version "/ibus-" version ".tar.gz"))
62 (sha256
63 (base32
64 "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
65 (build-system glib-or-gtk-build-system)
66 (arguments
67 `(#:tests? #f ; tests fail because there's no connection to dbus
68 #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
69 "--disable-python2"
70 "--enable-python-library"
71 ,(string-append "--with-ucd-dir="
72 (getcwd) "/ucd")
73 "--enable-wayland")
74 #:make-flags
75 (list "CC=gcc"
76 (string-append "pyoverridesdir="
77 (assoc-ref %outputs "out")
78 "/lib/python3.6/site-packages/gi/overrides/"))
79 #:phases
80 (modify-phases %standard-phases
81 (add-after 'unpack 'prepare-ucd-dir
82 (lambda* (#:key inputs #:allow-other-keys)
83 (mkdir-p "../ucd")
84 (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
85 (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
86 #t))
87 (add-before 'configure 'disable-dconf-update
88 (lambda _
89 (substitute* "data/dconf/Makefile.in"
90 (("dconf update") "echo dconf update"))
91 #t))
92 (add-after 'unpack 'delete-generated-files
93 (lambda _
94 (for-each (lambda (file)
95 (let ((c (string-append (string-drop-right file 4) "c")))
96 (when (file-exists? c)
97 (format #t "deleting ~a\n" c)
98 (delete-file c))))
99 (find-files "." "\\.vala"))
100 #t))
101 (add-after 'unpack 'fix-paths
102 (lambda* (#:key inputs #:allow-other-keys)
103 (substitute* "src/ibusenginesimple.c"
104 (("/usr/share/X11/locale")
105 (string-append (assoc-ref inputs "libx11")
106 "/share/X11/locale")))
107 (substitute* "ui/gtk3/xkblayout.vala"
108 (("\"(setxkbmap|xmodmap)\"" _ prog)
109 (string-append "\"" (assoc-ref inputs prog) "\"")))
110 #t))
111 (add-after 'wrap-program 'wrap-with-additional-paths
112 (lambda* (#:key outputs #:allow-other-keys)
113 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
114 ;; GI_TYPELIB_PATH.
115 (let ((out (assoc-ref outputs "out")))
116 (wrap-program (string-append out "/bin/ibus-setup")
117 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
118 `("GI_TYPELIB_PATH" ":" prefix
119 (,(getenv "GI_TYPELIB_PATH")
120 ,(string-append out "/lib/girepository-1.0")))))
121 #t)))))
122 (inputs
123 `(("dbus" ,dbus)
124 ("dconf" ,dconf)
125 ("gconf" ,gconf)
126 ("gtk2" ,gtk+-2)
127 ("gtk+" ,gtk+)
128 ("intltool" ,intltool)
129 ("json-glib" ,json-glib)
130 ("libnotify" ,libnotify)
131 ("libx11" ,libx11)
132 ("setxkbmap" ,setxkbmap)
133 ("wayland" ,wayland)
134 ("xmodmap" ,xmodmap)
135 ("iso-codes" ,iso-codes)
136 ("pygobject2" ,python-pygobject)
137 ("python" ,python)))
138 (native-inputs
139 `(("glib" ,glib "bin") ; for glib-genmarshal
140 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
141 ("unicode-nameslist"
142 ,(origin
143 (method url-fetch)
144 (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
145 (sha256
146 (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
147 ("unicode-blocks"
148 ,(origin
149 (method url-fetch)
150 (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
151 (sha256
152 (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
153 ("vala" ,vala)
154 ("pkg-config" ,pkg-config)))
155 (native-search-paths
156 (list (search-path-specification
157 (variable "IBUS_COMPONENT_PATH")
158 (files '("share/ibus/component")))))
159 (synopsis "Input method framework")
160 (description
161 "IBus is an input framework providing a full-featured and user-friendly
162 input method user interface. It comes with multilingual input support. It
163 may also simplify input method development.")
164 (home-page "https://github.com/ibus/ibus/wiki")
165 (license lgpl2.1+)))
166
167 (define-public ibus-libpinyin
168 (package
169 (name "ibus-libpinyin")
170 (version "1.10.0")
171 (source (origin
172 (method url-fetch)
173 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
174 "releases/download/" version
175 "/ibus-libpinyin-" version ".tar.gz"))
176 (sha256
177 (base32
178 "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
179 (build-system glib-or-gtk-build-system)
180 (arguments
181 `(#:phases
182 (modify-phases %standard-phases
183 (add-after 'wrap-program 'wrap-with-additional-paths
184 (lambda* (#:key inputs outputs #:allow-other-keys)
185 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
186 ;; PYTHONPATH and GI_TYPELIB_PATH.
187 (let ((out (assoc-ref outputs "out")))
188 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
189 `("PYTHONPATH" ":" prefix
190 (,(getenv "PYTHONPATH")
191 ,(string-append (assoc-ref inputs "ibus")
192 "/lib/girepository-1.0")))
193 `("GI_TYPELIB_PATH" ":" prefix
194 (,(string-append (assoc-ref inputs "ibus")
195 "/lib/girepository-1.0"))))
196 #t))))))
197 (inputs
198 `(("ibus" ,ibus)
199 ("libpinyin" ,libpinyin)
200 ("bdb" ,bdb)
201 ("sqlite" ,sqlite)
202 ("python" ,python)
203 ("pyxdg" ,python-pyxdg)
204 ("gtk+" ,gtk+)))
205 (native-inputs
206 `(("pkg-config" ,pkg-config)
207 ("intltool" ,intltool)
208 ("glib" ,glib "bin")))
209 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
210 (description
211 "This package includes a Chinese pinyin input method and a Chinese
212 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
213 (home-page "https://github.com/libpinyin/ibus-libpinyin")
214 (license gpl2+)))
215
216 (define-public libpinyin
217 (package
218 (name "libpinyin")
219 (version "2.2.0")
220 (source (origin
221 (method url-fetch)
222 (uri (string-append "https://github.com/libpinyin/libpinyin/"
223 "releases/download/" version
224 "/libpinyin-2.2.0.tar.gz"))
225 (sha256
226 (base32
227 "1c4wxvcvjxvk23mcwqvsfsv4nhimx4kpjhabxa28gx1ih10l88gj"))))
228 (build-system gnu-build-system)
229 (inputs
230 `(("glib" ,glib)
231 ("bdb" ,bdb)))
232 (native-inputs
233 `(("pkg-config" ,pkg-config)))
234 (synopsis "Library to handle Chinese pinyin")
235 (description
236 "The libpinyin C++ library provides algorithms needed for sentence-based
237 Chinese pinyin input methods.")
238 (home-page "https://github.com/libpinyin/libpinyin")
239 (license gpl2+)))
240
241 (define-public ibus-anthy
242 (package
243 (name "ibus-anthy")
244 (version "1.5.9")
245 (source (origin
246 (method url-fetch)
247 (uri (string-append
248 "https://github.com/ibus/ibus-anthy/releases/download/"
249 version "/ibus-anthy-" version ".tar.gz"))
250 (sha256
251 (base32
252 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
253 (build-system gnu-build-system)
254 (arguments
255 '(#:configure-flags
256 ;; Use absolute exec path in the anthy.xml.
257 (list (string-append "--libexecdir=" %output "/libexec"))
258 #:phases
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")))
263 (for-each
264 (lambda (prog)
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"))
272 #t))))))
273 (native-inputs
274 `(("gettext" ,gettext-minimal)
275 ("intltool" ,intltool)
276 ("pkg-config" ,pkg-config)
277 ("python" ,python)))
278 (inputs
279 `(("anthy" ,anthy)
280 ("gtk+" ,gtk+)
281 ("ibus" ,ibus)
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")
290 (license gpl2+)))
291
292 (define-public librime
293 (package
294 (name "librime")
295 (version "1.3.1")
296 (source
297 (origin
298 (method git-fetch)
299 (uri (git-reference
300 (url "https://github.com/rime/librime.git")
301 (commit version)))
302 (file-name (git-file-name name version))
303 (sha256
304 (base32 "1y0h3nnz97smx9z8h5fzk4c27mvrwv8kajxffqc43bhyvxvb2jd6"))))
305 (build-system cmake-build-system)
306 (inputs
307 `(("boost" ,boost)
308 ("glog" ,glog)
309 ("leveldb" ,leveldb)
310 ("marisa" ,marisa)
311 ("opencc" ,opencc)
312 ("yaml-cpp" ,yaml-cpp)))
313 (home-page "https://rime.im/")
314 (synopsis "The core library of Rime Input Method Engine")
315 (description "@dfn{librime} is the core library of Rime Input Method
316 Engine, which is a lightweight, extensible input method engine supporting
317 various input schemas including glyph-based input methods, romanization-based
318 input methods as well as those for Chinese dialects. It has the ability to
319 compose phrases and sentences intelligently and provide very accurate
320 traditional Chinese output.")
321 (license bsd-3)))
322
323 (define-public rime-data
324 (package
325 (name "rime-data")
326 (version "0.38.20181029")
327 (source
328 (origin
329 (method git-fetch)
330 (uri (git-reference
331 (url "https://github.com/rime/plum.git")
332 (commit "fb4f829da2007f2dbb37d60a79bc67c25ea16568")))
333 (file-name "plum-checkout")
334 (sha256
335 (base32 "1m1wiv9j5bay4saga58c7dj4h8gqivsbyp16y245ifvxvp9czj67"))))
336 (build-system gnu-build-system)
337 (arguments
338 `(#:tests? #f ; no tests
339 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
340 "no_update=1")
341 #:phases
342 (modify-phases %standard-phases
343 (add-after 'unpack 'patch-source
344 (lambda _
345 ;; Set .DEFAULT_GOAL to `all'.
346 ;; Don't build binary schemas. The output is not deterministic.
347 (substitute* "Makefile"
348 (("^\\.DEFAULT_GOAL := preset")
349 ".DEFAULT_GOAL := all"))
350 #t))
351 ;; Add schema packages into "package/rime" directory.
352 (add-after 'unpack 'add-packages
353 (lambda* (#:key inputs #:allow-other-keys)
354 (let* ((dest-dir "package/rime"))
355 (mkdir-p dest-dir)
356 (for-each (lambda (pkg)
357 (symlink (assoc-ref inputs pkg)
358 (string-append dest-dir "/" pkg)))
359 '("array"
360 "bopomofo"
361 "cangjie"
362 "combo-pinyin"
363 "double-pinyin"
364 "emoji"
365 "essay"
366 "ipa"
367 "jyutping"
368 "luna-pinyin"
369 "middle-chinese"
370 "pinyin-simp"
371 "prelude"
372 "quick"
373 "scj"
374 "soutzoe"
375 "stenotype"
376 "stroke"
377 "terra-pinyin"
378 "wubi"
379 "wugniu")))
380 #t))
381 (delete 'configure))))
382 (native-inputs
383 `(("array"
384 ,(origin
385 (method git-fetch)
386 (uri (git-reference
387 (url "https://github.com/rime/rime-array.git")
388 (commit "906e923902147584b0b0247028a782abbfbfd8a0")))
389 (file-name "rime-array-checkout")
390 (sha256
391 (base32
392 "1alk6ghn4ji4kvp7lfm57bwm2gjh99i79r0w9naz6wkdim8idvb1"))))
393 ("bopomofo"
394 ,(origin
395 (method git-fetch)
396 (uri (git-reference
397 (url "https://github.com/rime/rime-bopomofo.git")
398 (commit "8dc44ca1b6ef4e45b452e070b9da737f5da165e3")))
399 (file-name "rime-bopomofo-checkout")
400 (sha256
401 (base32
402 "16k6wfhcrw3a77rmbrp21ca0gmsmb3f68s193c1cfwr8i68k46nf"))))
403 ("cangjie"
404 ,(origin
405 (method git-fetch)
406 (uri (git-reference
407 (url "https://github.com/rime/rime-cangjie.git")
408 (commit "ab085e90856b3399b374dc3c8b4cb40d11f307a8")))
409 (file-name "rime-cangjie-checkout")
410 (sha256
411 (base32
412 "11fgj0rbv9nyzfijwm2l8pm8fznhif4h27ndrrcaaylkp7p5zsx2"))))
413 ("combo-pinyin"
414 ,(origin
415 (method git-fetch)
416 (uri (git-reference
417 (url "https://github.com/rime/rime-combo-pinyin.git")
418 (commit "f1bae63f20504f2b8113c5cbdf2700e858aa91eb")))
419 (file-name "rime-combo-pinyin-checkout")
420 (sha256
421 (base32
422 "1l1079akwm1hw4kkn0q6x9fpylnl2ka6z2fn7lmdpfpsr0xgn0n7"))))
423 ("double-pinyin"
424 ,(origin
425 (method git-fetch)
426 (uri (git-reference
427 (url "https://github.com/rime/rime-double-pinyin.git")
428 (commit "2101a5cd40e511ec38835769aa66d2dddf059c2e")))
429 (file-name "rime-double-pinyin-checkout")
430 (sha256
431 (base32
432 "19hh2qm0njbfk2js678hfm2hw9b796s43vs11yy3m1v9m0gk2vi7"))))
433 ("emoji"
434 ,(origin
435 (method git-fetch)
436 (uri (git-reference
437 (url "https://github.com/rime/rime-emoji.git")
438 (commit "6e6611b315f03ee4c33f958f9dbe960b13a0ed19")))
439 (file-name "rime-emoji-checkout")
440 (sha256
441 (base32
442 "1brfs3214w36j3345di9ygp468hbvbqdqpkjxxs1dbp437rayhyy"))))
443 ("essay"
444 ,(origin
445 (method git-fetch)
446 (uri (git-reference
447 (url "https://github.com/rime/rime-essay.git")
448 (commit "5e5c7a0ef41c9b030abdad81a9df07b56b1661e9")))
449 (file-name "rime-essay-checkout")
450 (sha256
451 (base32
452 "0ana9is0zhh79m4gjshvmaxbrg3jiqysydx5bpm151i7i6vw5y1i"))))
453 ("ipa"
454 ,(origin
455 (method git-fetch)
456 (uri (git-reference
457 (url "https://github.com/rime/rime-ipa.git")
458 (commit "02a9e2c181921a2e95e1a81f88188c41132755c3")))
459 (file-name "rime-ipa-checkout")
460 (sha256
461 (base32
462 "1szrxgvqlgmxapj2aflw2cvbv0p6pl0sw0gyxa13dvdhhf7s9rvr"))))
463 ("jyutping"
464 ,(origin
465 (method git-fetch)
466 (uri (git-reference
467 (url "https://github.com/rime/rime-jyutping.git")
468 (commit "1402ec3d6cc0973f952fe3f9ef531294e4ffe9e0")))
469 (file-name "rime-jyutping-checkout")
470 (sha256
471 (base32
472 "17g03dy4gw6vyc9da1wjn3iy9hx64dfnwiwsfc7bkzan22x2m4dv"))))
473 ("luna-pinyin"
474 ,(origin
475 (method git-fetch)
476 (uri (git-reference
477 (url "https://github.com/rime/rime-luna-pinyin.git")
478 (commit "3b05132576f5c347ff8a70857d2dae080936ac3b")))
479 (file-name "rime-luna-pinyin-checkout")
480 (sha256
481 (base32
482 "0kgnpxjn10dm2d9718r12rdjlwqd2s2h84jvkhxhh5v0dkv1anl2"))))
483 ("middle-chinese"
484 ,(origin
485 (method git-fetch)
486 (uri (git-reference
487 (url "https://github.com/rime/rime-middle-chinese.git")
488 (commit "9ba8d70330654b9a730f882d35cfad7dbeddfd75")))
489 (file-name "rime-middle-chinese-checkout")
490 (sha256
491 (base32
492 "0hwg5zby5kphh0bcfay8mfxwr5bwqhamiw3cmmmf7kp9fbns5s23"))))
493 ("pinyin-simp"
494 ,(origin
495 (method git-fetch)
496 (uri (git-reference
497 (url "https://github.com/rime/rime-pinyin-simp.git")
498 (commit "74357ffd62c05fb60edf6eab5b86bc8c8c1907d0")))
499 (file-name "rime-pinyin-simp-checkout")
500 (sha256
501 (base32
502 "1paw3c7pv5bl54abnp9pidfxrkchdacyxy5m9zb311p5sgm7fhxh"))))
503 ("prelude"
504 ,(origin
505 (method git-fetch)
506 (uri (git-reference
507 (url "https://github.com/rime/rime-prelude.git")
508 (commit "33040568c3ddb2ee6340c9b669494317db21b77c")))
509 (file-name "rime-prelude-checkout")
510 (sha256
511 (base32
512 "1gwcasyyg6f0ib6s4qsrrjcqr1lcs7j3xqxl65rznsw44nhnbwwq"))))
513 ("quick"
514 ,(origin
515 (method git-fetch)
516 (uri (git-reference
517 (url "https://github.com/rime/rime-quick.git")
518 (commit "910a97d403ad8e72f322488da146da79c19d623f")))
519 (file-name "rime-quick-checkout")
520 (sha256
521 (base32
522 "0yrq3gbfmm29xlr52rmxc41mqfrb0295q7sdhbc3ax71677mpr0y"))))
523 ("scj"
524 ,(origin
525 (method git-fetch)
526 (uri (git-reference
527 (url "https://github.com/rime/rime-scj.git")
528 (commit "e0eae889f4376d2a434ac3b38523e0da7400db68")))
529 (file-name "rime-scj-checkout")
530 (sha256
531 (base32
532 "1whnv9zs349kvy0zi7dnmpqwil8i6gqwrzvhy3qdrjzy58y6gwxn"))))
533 ("soutzoe"
534 ,(origin
535 (method git-fetch)
536 (uri (git-reference
537 (url "https://github.com/rime/rime-soutzoe.git")
538 (commit "e47841a8ad6341731c41cdb814b7a25c837603c4")))
539 (file-name "rime-soutzoe-checkout")
540 (sha256
541 (base32
542 "1rgpmkxa72jy6gyy44fn8azpk3amk9s9lrdf7za03nv95d0fvm0p"))))
543 ("stenotype"
544 ,(origin
545 (method git-fetch)
546 (uri (git-reference
547 (url "https://github.com/rime/rime-stenotype.git")
548 (commit "d4ff379314fd95283853d1734854979cf3cbd287")))
549 (file-name "rime-stenotype-checkout")
550 (sha256
551 (base32
552 "1kckpi4l4884hvydr3d6vid3v7rsc1app29kmk7v8jf8vn16afhl"))))
553 ("stroke"
554 ,(origin
555 (method git-fetch)
556 (uri (git-reference
557 (url "https://github.com/rime/rime-stroke.git")
558 (commit "cfd29c675c46cf70b7a7f0a3836a913059316a0a")))
559 (file-name "rime-stroke-checkout")
560 (sha256
561 (base32
562 "135is9c1p4lm98fd9l1gxyflkm69cv5an129ka7sk614bq84m08d"))))
563 ("terra-pinyin"
564 ,(origin
565 (method git-fetch)
566 (uri (git-reference
567 (url "https://github.com/rime/rime-terra-pinyin.git")
568 (commit "15b5c73a796571cd6f9ef6c89f96656cb9df86f9")))
569 (file-name "rime-terra-pinyin-checkout")
570 (sha256
571 (base32
572 "1xsd84h1zw417h5hr4dbgyk5009zi7q2p9774w3ccr5sxgc3i3cm"))))
573 ("wubi"
574 ,(origin
575 (method git-fetch)
576 (uri (git-reference
577 (url "https://github.com/rime/rime-wubi.git")
578 (commit "d44403728a0b1cd8b47cb1f81b83f58e5f790b74")))
579 (file-name "rime-wubi-checkout")
580 (sha256
581 (base32
582 "0ld31bdn94lncxd1ka44w4sbl03skh08mc927dhdmwq5bpvrgn36"))))
583 ("wugniu"
584 ,(origin
585 (method git-fetch)
586 (uri (git-reference
587 (url "https://github.com/rime/rime-wugniu.git")
588 (commit "65bcc354ada3839591d7546a64c71dbdd0592b02")))
589 (file-name "rime-wugniu-checkout")
590 (sha256
591 (base32
592 "0g31awp40s778sp5c290x40s8np86n8aw011s17sslxrqhhb0bkx"))))))
593 (home-page "https://rime.im/")
594 (synopsis "Schema data of Rime Input Method Engine")
595 (description "@dfn{rime-data} provides the schema data of Rime Input
596 Method Engine.")
597 (license lgpl3+)))
598
599 (define-public ibus-rime
600 (package
601 (name "ibus-rime")
602 (version "1.3.0")
603 (source
604 (origin
605 (method git-fetch)
606 (uri (git-reference
607 (url "https://github.com/rime/ibus-rime.git")
608 (commit version)))
609 (file-name (git-file-name name version))
610 (sha256
611 (base32 "1nqi7ymv34a9kx24say3xj98lkrs9nkpv1n2ijb91wdz3cr012ly"))))
612 (build-system gnu-build-system)
613 (arguments
614 `(#:tests? #f ; no tests
615 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
616 #:phases
617 (modify-phases %standard-phases
618 (add-after 'unpack 'patch-source
619 (lambda* (#:key inputs outputs #:allow-other-keys)
620 ;; Define RIME_DATA_DIR. It's required but not used by the code.
621 (substitute* "Makefile"
622 (("cmake")
623 (string-append "cmake -DRIME_DATA_DIR="
624 (assoc-ref inputs "rime-data")
625 "/share/rime-data")))
626 ;; rime_config.h defines the actual data directory.
627 (substitute* "rime_config.h"
628 (("^#define IBUS_RIME_INSTALL_PREFIX .*$")
629 (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
630 (assoc-ref outputs "out")
631 "\"\n"))
632 (("^#define IBUS_RIME_SHARED_DATA_DIR .*$")
633 (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
634 (assoc-ref inputs "rime-data")
635 "/share/rime-data\"\n")))
636 #t))
637 (delete 'configure))))
638 (inputs
639 `(("gdk-pixbuf" ,gdk-pixbuf)
640 ("glib" ,glib)
641 ("ibus" ,ibus)
642 ("libnotify" ,libnotify)
643 ("librime" ,librime)
644 ("rime-data" ,rime-data)))
645 (native-inputs
646 `(("cmake" ,cmake)
647 ("pkg-config" ,pkg-config)))
648 (home-page "https://rime.im/")
649 (synopsis "Rime Input Method Engine for IBus")
650 (description "@dfn{ibus-rime} provides the Rime input method engine for
651 IBus. Rime is a lightweight, extensible input method engine supporting
652 various input schemas including glyph-based input methods, romanization-based
653 input methods as well as those for Chinese dialects. It has the ability to
654 compose phrases and sentences intelligently and provide very accurate
655 traditional Chinese output.")
656 (license gpl3+)))