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