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