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