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