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