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