gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / ibus.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 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, 2020 Peng Mei Yu <i@pengmeiyu.com>
8 ;;; Copyright © 2020 kanichos <kanichos@yandex.ru>
9 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages ibus)
27 #:use-module (guix licenses)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system glib-or-gtk)
34 #:use-module (guix utils)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages anthy)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages boost)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages cmake)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages datastructures)
44 #:use-module (gnu packages dbm)
45 #:use-module (gnu packages freedesktop)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages gtk)
50 #:use-module (gnu packages iso-codes)
51 #:use-module (gnu packages logging)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages serialization)
55 #:use-module (gnu packages sqlite)
56 #:use-module (gnu packages textutils)
57 #:use-module (gnu packages unicode)
58 #:use-module (gnu packages xorg))
59
60 (define-public ibus
61 (package
62 (name "ibus")
63 (version "1.5.22")
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "https://github.com/ibus/ibus/"
67 "releases/download/"
68 version "/ibus-" version ".tar.gz"))
69 (sha256
70 (base32
71 "0jmy2w01phpmqnjnfnak7nvfna57mpgfnl87jwc4iai8ijjynw41"))))
72 (build-system glib-or-gtk-build-system)
73 (arguments
74 `(#:tests? #f ; tests fail because there's no connection to dbus
75 #:parallel-build? #f ; race condition discovered with emoji support
76 #:configure-flags (list "--enable-python-library"
77 (string-append
78 "--with-unicode-emoji-dir="
79 (assoc-ref %build-inputs "unicode-emoji")
80 "/share/unicode/emoji")
81 (string-append
82 "--with-emoji-annotation-dir="
83 (assoc-ref %build-inputs "unicode-cldr-common")
84 "/share/unicode/cldr/common/annotations")
85 (string-append "--with-ucd-dir="
86 (assoc-ref %build-inputs "ucd")
87 "/share/ucd")
88 "--enable-wayland")
89 #:phases
90 (modify-phases %standard-phases
91 (add-after 'unpack 'patch-python-target-directories
92 (lambda* (#:key outputs #:allow-other-keys)
93 (let ((root (string-append (assoc-ref outputs "out")
94 "/lib/python"
95 ,(version-major+minor (package-version python))
96 "/site-packages")))
97 (substitute* "configure"
98 (("(py2?overridesdir)=.*" _ var)
99 (string-append var "=" root "/gi/overrides/"))
100 (("(pkgpython2dir=).*" _ var)
101 (string-append var root "/ibus"))))
102 #t))
103 (add-before 'configure 'disable-dconf-update
104 (lambda _
105 (substitute* "data/dconf/Makefile.in"
106 (("dconf update") "echo dconf update"))
107 #t))
108 (add-after 'unpack 'delete-generated-files
109 (lambda _
110 (for-each (lambda (file)
111 (let ((c (string-append (string-drop-right file 4) "c")))
112 (when (file-exists? c)
113 (format #t "deleting ~a\n" c)
114 (delete-file c))))
115 (find-files "." "\\.vala"))
116 #t))
117 (add-after 'unpack 'fix-paths
118 (lambda* (#:key inputs #:allow-other-keys)
119 (substitute* "src/ibusenginesimple.c"
120 (("/usr/share/X11/locale")
121 (string-append (assoc-ref inputs "libx11")
122 "/share/X11/locale")))
123 (substitute* "ui/gtk3/xkblayout.vala"
124 (("\"(setxkbmap|xmodmap)\"" _ prog)
125 (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\"")))
126 #t))
127 (add-after 'wrap-program 'wrap-with-additional-paths
128 (lambda* (#:key outputs #:allow-other-keys)
129 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
130 ;; GI_TYPELIB_PATH.
131 (let ((out (assoc-ref outputs "out")))
132 (wrap-program (string-append out "/bin/ibus-setup")
133 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
134 `("GI_TYPELIB_PATH" ":" prefix
135 (,(getenv "GI_TYPELIB_PATH")
136 ,(string-append out "/lib/girepository-1.0")))))
137 #t)))))
138 (inputs
139 `(("dbus" ,dbus)
140 ("dconf" ,dconf)
141 ("gconf" ,gconf)
142 ("gtk2" ,gtk+-2)
143 ("gtk+" ,gtk+)
144 ("json-glib" ,json-glib)
145 ("libnotify" ,libnotify)
146 ("libx11" ,libx11)
147 ("setxkbmap" ,setxkbmap)
148 ("wayland" ,wayland)
149 ("xmodmap" ,xmodmap)
150 ("iso-codes" ,iso-codes)
151 ("pygobject2" ,python-pygobject)
152 ("python" ,python)))
153 (native-inputs
154 `(("glib" ,glib "bin") ; for glib-genmarshal
155 ("gettext" ,gettext-minimal)
156 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
157 ("ucd" ,ucd)
158 ("unicode-emoji" ,unicode-emoji)
159 ("unicode-cldr-common" ,unicode-cldr-common)
160 ("vala" ,vala)
161 ("pkg-config" ,pkg-config)))
162 (native-search-paths
163 (list (search-path-specification
164 (variable "IBUS_COMPONENT_PATH")
165 (files '("share/ibus/component")))))
166 (synopsis "Input method framework")
167 (description
168 "IBus is an input framework providing a full-featured and user-friendly
169 input method user interface. It comes with multilingual input support. It
170 may also simplify input method development.")
171 (home-page "https://github.com/ibus/ibus/wiki")
172 (license lgpl2.1+)))
173
174 (define-public ibus-libpinyin
175 (package
176 (name "ibus-libpinyin")
177 (version "1.12.0")
178 (source (origin
179 (method url-fetch)
180 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
181 "releases/download/" version
182 "/ibus-libpinyin-" version ".tar.gz"))
183 (sha256
184 (base32
185 "0xl2lmffy42f6h6za05z4vpazpza1a9gsrva65giwyv3kpf652dd"))))
186 (build-system glib-or-gtk-build-system)
187 (arguments
188 `(#:configure-flags
189 '("--enable-opencc")
190 #:phases
191 (modify-phases %standard-phases
192 (add-after 'wrap-program 'wrap-with-additional-paths
193 (lambda* (#:key inputs outputs #:allow-other-keys)
194 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
195 ;; PYTHONPATH and GI_TYPELIB_PATH.
196 (let ((out (assoc-ref outputs "out")))
197 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
198 `("PYTHONPATH" ":" =
199 (,(getenv "PYTHONPATH")
200 ,(string-append (assoc-ref inputs "ibus")
201 "/lib/girepository-1.0")
202 ,(string-append (assoc-ref outputs "out")
203 "/share/ibus-libpinyin/setup/")))
204 `("GI_TYPELIB_PATH" ":" prefix
205 (,(string-append (assoc-ref inputs "ibus")
206 "/lib/girepository-1.0")
207 ,(string-append (assoc-ref outputs "out")
208 "/share/ibus-libpinyin/setup/"))))
209 #t))))))
210 (inputs
211 `(("ibus" ,ibus)
212 ("libpinyin" ,libpinyin)
213 ("bdb" ,bdb)
214 ("sqlite" ,sqlite)
215 ("opencc" ,opencc)
216 ("python" ,python)
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 gpl3+)))
229
230 (define-public libpinyin
231 (package
232 (name "libpinyin")
233 (version "2.6.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 "10h5mjgv4ibhispvr3s1k36a4aclx4dcvcc2knd4sg1xibw0dp4w"))))
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.6.1")
310 (source
311 (origin
312 (method git-fetch)
313 (uri (git-reference
314 (url "https://github.com/rime/librime")
315 (commit version)))
316 (file-name (git-file-name name version))
317 (sha256
318 (base32
319 "1avmy2yyag22cl2j8085n5czsk93sxv440pdb3a2diwcxwwmzm9v"))
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 ("capnproto" ,capnproto)
340 ("glog" ,glog)
341 ("leveldb" ,leveldb)
342 ("marisa" ,marisa)
343 ("opencc" ,opencc)
344 ("yaml-cpp" ,yaml-cpp)))
345 (native-inputs
346 `(("googletest" ,googletest)
347 ("pkg-config" ,pkg-config)
348 ("xorgproto" ,xorgproto))) ; keysym.h
349 (home-page "https://rime.im/")
350 (synopsis "The core library of Rime Input Method Engine")
351 (description "@dfn{librime} is the core library of Rime Input Method
352 Engine, which is a lightweight, extensible input method engine supporting
353 various input schemas including glyph-based input methods, romanization-based
354 input methods as well as those for Chinese dialects. It has the ability to
355 compose phrases and sentences intelligently and provide very accurate
356 traditional Chinese output.")
357 (license bsd-3)))
358
359 (define-public rime-data
360 (package
361 (name "rime-data")
362 (version "0.38.20200623")
363 (source
364 (origin
365 (method git-fetch)
366 (uri (git-reference
367 (url "https://github.com/rime/plum")
368 (commit "397d601dd22cfc857613973724724b8f44db9f9c")))
369 (file-name "plum-checkout")
370 (sha256
371 (base32 "06ad5c4m7xsfr4if5ywshfj2aj5g5b5hwzh38dzccn7c1l2ibi0z"))))
372 (build-system gnu-build-system)
373 (arguments
374 `(#:modules ((ice-9 match)
375 ,@%gnu-build-system-modules)
376 #:tests? #f ; no tests
377 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
378 "no_update=1")
379 #:phases
380 (modify-phases %standard-phases
381 (add-after 'unpack 'patch-source
382 (lambda _
383 ;; Don't build binary Rime schema. The binary Rime schema files
384 ;; are platform dependent and contains timestamp information.
385 ;; Thus they are not reproducible.
386
387 ;; Change `.DEFAULT_GOAL' to `all'.
388 (substitute* "Makefile"
389 (("^\\.DEFAULT_GOAL := preset")
390 ".DEFAULT_GOAL := all"))
391 ;; Disable git operations.
392 (substitute* "scripts/install-packages.sh"
393 ((".*update-package\\.sh.*") ""))
394 #t))
395 ;; Copy Rime schemas into the "package/rime" directory.
396 (add-after 'unpack 'copy-rime-schemas
397 (lambda* (#:key inputs #:allow-other-keys)
398 (let ((dest-dir "package/rime"))
399 (mkdir-p dest-dir)
400 (for-each
401 (match-lambda
402 ((name . path)
403 (if (string-prefix? "rime-" name)
404 (let ((schema (substring name (string-length "rime-"))))
405 (symlink path (string-append dest-dir "/" schema))))))
406 inputs))
407 #t))
408 (delete 'configure))))
409 (inputs
410 `(("rime-array"
411 ,(origin
412 (method git-fetch)
413 (uri (git-reference
414 (url "https://github.com/rime/rime-array")
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")
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")
435 (commit "5fd8ce6f64039e505ca02655a621f2e830b97c19")))
436 (file-name "rime-cangjie-checkout")
437 (sha256
438 (base32
439 "1gf6r0q593ixar6v0jyvs56cik2gjp7pf9v799rfd2yydyia3bfg"))))
440 ("rime-cantonese"
441 ,(origin
442 (method git-fetch)
443 (uri (git-reference
444 (url "https://github.com/rime/rime-cantonese")
445 (commit "e06fe8e79d7d64db2f2b6339aabc004d8cbc1f67")))
446 (file-name "rime-cantonese-checkout")
447 (sha256
448 (base32
449 "0j6kbhdfj7dx812yzykndzbk53s2v1rsaa2jlyma03hz7qlnnl0s"))))
450 ("rime-combo-pinyin"
451 ,(origin
452 (method git-fetch)
453 (uri (git-reference
454 (url "https://github.com/rime/rime-combo-pinyin")
455 (commit "67b29cdc786928ea46b43a9c660dee3db8f1adff")))
456 (file-name "rime-combo-pinyin-checkout")
457 (sha256
458 (base32
459 "1v6ax51xll2aizbz1xzjyk6p3lmq8cyzbxkrwcffa723zaj0zz4l"))))
460 ("rime-double-pinyin"
461 ,(origin
462 (method git-fetch)
463 (uri (git-reference
464 (url "https://github.com/rime/rime-double-pinyin")
465 (commit "69bf85d4dfe8bac139c36abbd68d530b8b6622ea")))
466 (file-name "rime-double-pinyin-checkout")
467 (sha256
468 (base32
469 "093wif5avvvw45fqbwj5wkbxrychy4pagl4mwsmbrayc8jkp69ak"))))
470 ("rime-emoji"
471 ,(origin
472 (method git-fetch)
473 (uri (git-reference
474 (url "https://github.com/rime/rime-emoji")
475 (commit "c99d34e4a837349e4679a110bb4b94f71fe015ae")))
476 (file-name "rime-emoji-checkout")
477 (sha256
478 (base32
479 "1wiwlxjjml9xfgg7z1wzaf4b1bsg81dkwvsfff2b61fwxq61zkgw"))))
480 ("rime-essay"
481 ,(origin
482 (method git-fetch)
483 (uri (git-reference
484 (url "https://github.com/rime/rime-essay")
485 (commit "88055afa3752e4582fa887765d962a30e02bb1fa")))
486 (file-name "rime-essay-checkout")
487 (sha256
488 (base32
489 "0ap7xqv6v0x6mdkw2cv93cbr6qhpla3803z04522wb8l9hr7iryg"))))
490 ("rime-ipa"
491 ,(origin
492 (method git-fetch)
493 (uri (git-reference
494 (url "https://github.com/rime/rime-ipa")
495 (commit "22b71710e029bcb412e9197192a638ab11bc2abf")))
496 (file-name "rime-ipa-checkout")
497 (sha256
498 (base32
499 "0zdk4f9qkfj3q5hmjnairj1lv6f6y27mic12k886n6sxywwbwr2k"))))
500 ("rime-jyutping"
501 ,(origin
502 (method git-fetch)
503 (uri (git-reference
504 (url "https://github.com/rime/rime-jyutping")
505 (commit "6fe0d727b3178feabd0f01e6cd82599202764735")))
506 (file-name "rime-jyutping-checkout")
507 (sha256
508 (base32
509 "0wz6d3pmi72ysh2c0nml3rsz9hd2vazsyhnz34gq26yf4j85phfs"))))
510 ("rime-luna-pinyin"
511 ,(origin
512 (method git-fetch)
513 (uri (git-reference
514 (url "https://github.com/rime/rime-luna-pinyin")
515 (commit "f1268e192ca88b9526467ce04ac3e47c837891ad")))
516 (file-name "rime-luna-pinyin-checkout")
517 (sha256
518 (base32
519 "0nxnjp1ybcrsan1mxnzwbkfhwl99kza6i9k1s7m9wzmhv7x7zahg"))))
520 ("rime-middle-chinese"
521 ,(origin
522 (method git-fetch)
523 (uri (git-reference
524 (url "https://github.com/rime/rime-middle-chinese")
525 (commit "ed6d44f8d0bedf6e0c1c3183a270f8f01a211a40")))
526 (file-name "rime-middle-chinese-checkout")
527 (sha256
528 (base32
529 "09mql88lsrxa99pyllby5z22kaiwwa037ha8gwaxjnnlsjgvz7zx"))))
530 ("rime-pinyin-simp"
531 ,(origin
532 (method git-fetch)
533 (uri (git-reference
534 (url "https://github.com/rime/rime-pinyin-simp")
535 (commit "b73df7fc0994912ce785462b3be569ae81258ac2")))
536 (file-name "rime-pinyin-simp-checkout")
537 (sha256
538 (base32
539 "1m9hchnj1xf5s5185qm66ja0g1324drc98b2jjhnqgcp47bwz9fx"))))
540 ("rime-prelude"
541 ,(origin
542 (method git-fetch)
543 (uri (git-reference
544 (url "https://github.com/rime/rime-prelude")
545 (commit "8a52b4f86a59f3eb602f9a4cf6a680a67c15df8c")))
546 (file-name "rime-prelude-checkout")
547 (sha256
548 (base32
549 "039fr3996vfxzn2milaq1f5fw08f6zgjsxsql6cfhsc5b55fidm7"))))
550 ("rime-quick"
551 ,(origin
552 (method git-fetch)
553 (uri (git-reference
554 (url "https://github.com/rime/rime-quick")
555 (commit "3fe5911ba608cb2df1b6301b76ad1573bd482a76")))
556 (file-name "rime-quick-checkout")
557 (sha256
558 (base32
559 "08bh87ym5qvw55lyw20l3m7jd4c2z5rvil8h5q8790r7z6j6ijy9"))))
560 ("rime-scj"
561 ,(origin
562 (method git-fetch)
563 (uri (git-reference
564 (url "https://github.com/rime/rime-scj")
565 (commit "cab5a0858765eff0553dd685a2d61d5536e9149c")))
566 (file-name "rime-scj-checkout")
567 (sha256
568 (base32
569 "0ard2bjp4896a8dimmcwyjwgmp9kl4rz92yc92jnd3y4rgwl6fvk"))))
570 ("rime-soutzoe"
571 ,(origin
572 (method git-fetch)
573 (uri (git-reference
574 (url "https://github.com/rime/rime-soutzoe")
575 (commit "beeaeca72d8e17dfd1e9af58680439e9012987dc")))
576 (file-name "rime-soutzoe-checkout")
577 (sha256
578 (base32
579 "0jyqx0q9s0qxn168l5n8zav8jcl2g5ppr7pa8jm1vwrllf20slcc"))))
580 ("rime-stenotype"
581 ,(origin
582 (method git-fetch)
583 (uri (git-reference
584 (url "https://github.com/rime/rime-stenotype")
585 (commit "f3e9189d5ce33c55d3936cc58e39d0c88b3f0c88")))
586 (file-name "rime-stenotype-checkout")
587 (sha256
588 (base32
589 "0dl6px7lrh3xa87knjzwzdcwjj1k1dg4l72q7lb48an4s9f1cy5d"))))
590 ("rime-stroke"
591 ,(origin
592 (method git-fetch)
593 (uri (git-reference
594 (url "https://github.com/rime/rime-stroke")
595 (commit "ea8576d1accd6fda339e96b415caadb56e2a07d1")))
596 (file-name "rime-stroke-checkout")
597 (sha256
598 (base32
599 "07h6nq9867hjrd2v3h1pnr940sdrw4mqrzj43siz1rzjxz3s904r"))))
600 ("rime-terra-pinyin"
601 ,(origin
602 (method git-fetch)
603 (uri (git-reference
604 (url "https://github.com/rime/rime-terra-pinyin")
605 (commit "492aaf914f9de37cc9d26b846dc693116de70ae8")))
606 (file-name "rime-terra-pinyin-checkout")
607 (sha256
608 (base32
609 "1l4l2w42mc3sf7jwbadx95gzrsq11ld9f6yj2hwaq9accainw3bf"))))
610 ("rime-wubi"
611 ,(origin
612 (method git-fetch)
613 (uri (git-reference
614 (url "https://github.com/rime/rime-wubi")
615 (commit "dd052ee158a38cb791755318b1aef9b4a3ed0316")))
616 (file-name "rime-wubi-checkout")
617 (sha256
618 (base32
619 "00xzv3sbwqh2jz4i7s315h7rw17qa2dgj7kflyy3blxk0s2cqiqa"))))
620 ("rime-wugniu"
621 ,(origin
622 (method git-fetch)
623 (uri (git-reference
624 (url "https://github.com/rime/rime-wugniu")
625 (commit "abd1ee98efbf170258fcf43875c21a4259e00b61")))
626 (file-name "rime-wugniu-checkout")
627 (sha256
628 (base32
629 "0qn54d3cclny106ixdw08r5n6wn52ffs1hgrma3k0j4pv0kr9nlq"))))))
630 (home-page "https://rime.im/")
631 (synopsis "Schema data of Rime Input Method Engine")
632 (description "@dfn{rime-data} provides the schema data of Rime Input
633 Method Engine.")
634 (license lgpl3)))
635
636 (define-public ibus-rime
637 (package
638 (name "ibus-rime")
639 (version "1.4.0")
640 (source
641 (origin
642 (method git-fetch)
643 (uri (git-reference
644 (url "https://github.com/rime/ibus-rime")
645 (commit version)))
646 (file-name (git-file-name name version))
647 (sha256
648 (base32 "12y6jdz1amhgrnqa7zjim63dfsz6zyxyahbirfan37wmcfp6gp1d"))))
649 (build-system gnu-build-system)
650 (arguments
651 `(#:tests? #f ; no tests
652 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
653 #:phases
654 (modify-phases %standard-phases
655 (add-after 'unpack 'patch-source
656 (lambda* (#:key inputs outputs #:allow-other-keys)
657 ;; Define RIME_DATA_DIR. It's required but not used by the code.
658 (substitute* "Makefile"
659 (("cmake")
660 (string-append "cmake -DRIME_DATA_DIR="
661 (assoc-ref inputs "rime-data")
662 "/share/rime-data")))
663 ;; rime_config.h defines the actual data directory.
664 (substitute* "rime_config.h"
665 (("^#define IBUS_RIME_INSTALL_PREFIX .*$")
666 (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
667 (assoc-ref outputs "out")
668 "\"\n"))
669 (("^#define IBUS_RIME_SHARED_DATA_DIR .*$")
670 (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
671 (assoc-ref inputs "rime-data")
672 "/share/rime-data\"\n")))
673 #t))
674 (add-after 'unpack 'fix-file-names
675 (lambda* (#:key outputs #:allow-other-keys)
676 ;; IBus uses the component file rime.xml to start the Rime
677 ;; engine. It must be patched with appropriate file names.
678 (substitute* "rime.xml"
679 (("/usr") (assoc-ref outputs "out")))
680 #t))
681 (delete 'configure))))
682 (inputs
683 `(("gdk-pixbuf" ,gdk-pixbuf)
684 ("glib" ,glib)
685 ("ibus" ,ibus)
686 ("libnotify" ,libnotify)
687 ("librime" ,librime)
688 ("rime-data" ,rime-data)))
689 (native-inputs
690 `(("cmake" ,cmake-minimal)
691 ("pkg-config" ,pkg-config)))
692 (home-page "https://rime.im/")
693 (synopsis "Rime Input Method Engine for IBus")
694 (description "@dfn{ibus-rime} provides the Rime input method engine for
695 IBus. Rime is a lightweight, extensible input method engine supporting
696 various input schemas including glyph-based input methods, romanization-based
697 input methods as well as those for Chinese dialects. It has the ability to
698 compose phrases and sentences intelligently and provide very accurate
699 traditional Chinese output.")
700 (license gpl3)))
701
702 (define-public libhangul
703 (package
704 (name "libhangul")
705 (version "0.1.0")
706 (source
707 (origin
708 (method url-fetch)
709 (uri (string-append "http://kldp.net/hangul/release/"
710 "3442-libhangul-" version ".tar.gz"))
711 (sha256
712 (base32
713 "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar"))))
714 (build-system gnu-build-system)
715 (home-page "https://github.com/libhangul/libhangul")
716 (synopsis "Library to support hangul input method logic")
717 (description
718 "This package provides a library to support hangul input method logic,
719 hanja dictionary and small hangul character classification.")
720 (license lgpl2.1+)))
721
722 (define-public ibus-libhangul
723 (package
724 (name "ibus-libhangul")
725 (version "1.5.3")
726 (source
727 (origin
728 (method url-fetch)
729 (uri (string-append "https://github.com/libhangul/ibus-hangul/"
730 "releases/download/" version
731 "/ibus-hangul-" version ".tar.gz"))
732 (sha256
733 (base32
734 "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy"))))
735 (build-system gnu-build-system)
736 (arguments
737 `(#:phases
738 (modify-phases %standard-phases
739 (add-after 'install 'wrap
740 (lambda* (#:key inputs outputs #:allow-other-keys)
741 (wrap-program (string-append (assoc-ref outputs "out")
742 "/libexec/ibus-setup-hangul")
743 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
744 `("LD_LIBRARY_PATH" ":" prefix
745 (,(string-append (assoc-ref inputs "libhangul") "/lib")))
746 `("GI_TYPELIB_PATH" ":" prefix
747 (,(getenv "GI_TYPELIB_PATH"))))
748 #t)))))
749 (native-inputs
750 `(("pkg-config" ,pkg-config)
751 ("gettext" ,gettext-minimal)
752 ("glib:bin" ,glib "bin")))
753 (inputs
754 `(("ibus" ,ibus)
755 ("glib" ,glib)
756 ("python-pygobject" ,python-pygobject)
757 ("gtk+" ,gtk+)
758 ("libhangul" ,libhangul)
759 ("python" ,python)))
760 (home-page "https://github.com/libhangul/ibus-hangul")
761 (synopsis "Hangul engine for IBus")
762 (description
763 "ibus-hangul is a Korean input method engine for IBus.")
764 (license gpl2+)))