gnu: Add java-openjfx-controls.
[jackhill/guix/guix.git] / gnu / packages / ibus.scm
CommitLineData
aad6f5bc 1;;; GNU Guix --- Functional package management for GNU
dbac4833 2;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
2e6ecc5c 3;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
1c6ae418 4;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
66b266e6 5;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
510d819c 6;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
387bc215 7;;; Copyright © 2018, 2019, 2020 Peng Mei Yu <i@pengmeiyu.com>
94b8fe80 8;;; Copyright © 2020 kanichos <kanichos@yandex.ru>
e89986c8 9;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
aad6f5bc
RW
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)
1329f095 30 #:use-module (guix git-download)
78209a16 31 #:use-module (guix build-system cmake)
aad6f5bc
RW
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system glib-or-gtk)
dbac4833 34 #:use-module (guix utils)
aad6f5bc 35 #:use-module (gnu packages)
1c6ae418 36 #:use-module (gnu packages anthy)
12edffe4
RW
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
78209a16 39 #:use-module (gnu packages boost)
950ebfd1 40 #:use-module (gnu packages check)
d5b23d2b 41 #:use-module (gnu packages cmake)
5fbbd29f 42 #:use-module (gnu packages databases)
78209a16 43 #:use-module (gnu packages datastructures)
255d1bbe 44 #:use-module (gnu packages dbm)
5fbbd29f 45 #:use-module (gnu packages freedesktop)
1c6ae418 46 #:use-module (gnu packages gettext)
aad6f5bc
RW
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)
78209a16 51 #:use-module (gnu packages logging)
aad6f5bc 52 #:use-module (gnu packages pkg-config)
d37f00b9 53 #:use-module (gnu packages python)
78209a16 54 #:use-module (gnu packages serialization)
cd0322a3 55 #:use-module (gnu packages sqlite)
78209a16 56 #:use-module (gnu packages textutils)
0873cce1 57 #:use-module (gnu packages unicode)
d37f00b9 58 #:use-module (gnu packages xorg))
aad6f5bc
RW
59
60(define-public ibus
61 (package
2f968763 62 (name "ibus")
bd65a4cf 63 (version "1.5.22")
2f968763
MP
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
bd65a4cf 71 "0jmy2w01phpmqnjnfnak7nvfna57mpgfnl87jwc4iai8ijjynw41"))))
2f968763
MP
72 (build-system glib-or-gtk-build-system)
73 (arguments
74 `(#:tests? #f ; tests fail because there's no connection to dbus
933bb1ac 75 #:parallel-build? #f ; race condition discovered with emoji support
0873cce1
LP
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="
a9e5e649
LP
86 (assoc-ref %build-inputs "ucd")
87 "/share/ucd")
0873cce1 88 "--enable-wayland")
2f968763
MP
89 #:phases
90 (modify-phases %standard-phases
b2c6b467
RW
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))
2f968763
MP
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)
92d7f5b4 125 (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\"")))
2f968763
MP
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+)
2f968763
MP
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
18705a50 155 ("gettext" ,gettext-minimal)
2f968763 156 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
a9e5e649 157 ("ucd" ,ucd)
0873cce1
LP
158 ("unicode-emoji" ,unicode-emoji)
159 ("unicode-cldr-common" ,unicode-cldr-common)
2f968763
MP
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
aad6f5bc
RW
169input method user interface. It comes with multilingual input support. It
170may also simplify input method development.")
2f968763
MP
171 (home-page "https://github.com/ibus/ibus/wiki")
172 (license lgpl2.1+)))
12edffe4 173
5fbbd29f
RW
174(define-public ibus-libpinyin
175 (package
2f968763 176 (name "ibus-libpinyin")
510d819c 177 (version "1.11.1")
2f968763
MP
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
510d819c 185 "1bl1cgicd2df797dx1x0q904438bsn8i23djzcfcai4dp3631xc0"))))
2f968763
MP
186 (build-system glib-or-gtk-build-system)
187 (arguments
188 `(#:phases
189 (modify-phases %standard-phases
190 (add-after 'wrap-program 'wrap-with-additional-paths
191 (lambda* (#:key inputs outputs #:allow-other-keys)
192 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
193 ;; PYTHONPATH and GI_TYPELIB_PATH.
194 (let ((out (assoc-ref outputs "out")))
195 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
196 `("PYTHONPATH" ":" prefix
197 (,(getenv "PYTHONPATH")
198 ,(string-append (assoc-ref inputs "ibus")
199 "/lib/girepository-1.0")))
200 `("GI_TYPELIB_PATH" ":" prefix
201 (,(string-append (assoc-ref inputs "ibus")
202 "/lib/girepository-1.0"))))
203 #t))))))
204 (inputs
205 `(("ibus" ,ibus)
206 ("libpinyin" ,libpinyin)
207 ("bdb" ,bdb)
208 ("sqlite" ,sqlite)
209 ("python" ,python)
210 ("pyxdg" ,python-pyxdg)
afabb9ec 211 ("pygobject2" ,python-pygobject)
2f968763
MP
212 ("gtk+" ,gtk+)))
213 (native-inputs
214 `(("pkg-config" ,pkg-config)
215 ("intltool" ,intltool)
216 ("glib" ,glib "bin")))
217 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
218 (description
219 "This package includes a Chinese pinyin input method and a Chinese
5fbbd29f 220ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
2f968763
MP
221 (home-page "https://github.com/libpinyin/ibus-libpinyin")
222 (license gpl2+)))
5fbbd29f 223
12edffe4
RW
224(define-public libpinyin
225 (package
226 (name "libpinyin")
44613030 227 (version "2.3.0")
12edffe4
RW
228 (source (origin
229 (method url-fetch)
8738c2b3
RW
230 (uri (string-append "https://github.com/libpinyin/libpinyin/"
231 "releases/download/" version
44613030 232 "/libpinyin-" version ".tar.gz"))
12edffe4
RW
233 (sha256
234 (base32
44613030 235 "14969v6w8n1aiqphl2386dws7dmsdwbzyqnlz4kr8ppm39m9rp5k"))))
12edffe4 236 (build-system gnu-build-system)
12edffe4
RW
237 (inputs
238 `(("glib" ,glib)
8738c2b3 239 ("bdb" ,bdb)))
12edffe4 240 (native-inputs
8738c2b3 241 `(("pkg-config" ,pkg-config)))
1f7a84dc 242 (synopsis "Library to handle Chinese pinyin")
12edffe4
RW
243 (description
244 "The libpinyin C++ library provides algorithms needed for sentence-based
245Chinese pinyin input methods.")
246 (home-page "https://github.com/libpinyin/libpinyin")
247 (license gpl2+)))
1c6ae418
CM
248
249(define-public ibus-anthy
250 (package
251 (name "ibus-anthy")
ab84c13f 252 (version "1.5.9")
1c6ae418
CM
253 (source (origin
254 (method url-fetch)
255 (uri (string-append
256 "https://github.com/ibus/ibus-anthy/releases/download/"
257 version "/ibus-anthy-" version ".tar.gz"))
258 (sha256
259 (base32
ab84c13f 260 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
1c6ae418
CM
261 (build-system gnu-build-system)
262 (arguments
263 '(#:configure-flags
264 ;; Use absolute exec path in the anthy.xml.
265 (list (string-append "--libexecdir=" %output "/libexec"))
266 #:phases
267 (modify-phases %standard-phases
268 (add-after 'install 'wrap-programs
269 (lambda* (#:key outputs #:allow-other-keys)
270 (let ((out (assoc-ref outputs "out")))
271 (for-each
272 (lambda (prog)
273 (wrap-program (string-append out "/libexec/" prog)
274 `("PYTHONPATH" ":" prefix
275 (,(getenv "PYTHONPATH")))
276 `("GI_TYPELIB_PATH" ":" prefix
277 (,(getenv "GI_TYPELIB_PATH")
278 ,(string-append out "/lib/girepository-1.0")))))
279 '("ibus-engine-anthy" "ibus-setup-anthy"))
280 #t))))))
281 (native-inputs
b94a6ca0 282 `(("gettext" ,gettext-minimal)
1c6ae418
CM
283 ("intltool" ,intltool)
284 ("pkg-config" ,pkg-config)
285 ("python" ,python)))
286 (inputs
287 `(("anthy" ,anthy)
288 ("gtk+" ,gtk+)
289 ("ibus" ,ibus)
290 ("gobject-introspection" ,gobject-introspection)
291 ("python-pygobject" ,python-pygobject)))
292 (synopsis "Anthy Japanese language input method for IBus")
293 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
294adds the Anthy Japanese language input method to IBus. Because most graphical
295applications allow text input via IBus, installing this package will enable
296Japanese language input in most graphical applications.")
297 (home-page "https://github.com/fujiwarat/ibus-anthy")
298 (license gpl2+)))
78209a16
MP
299
300(define-public librime
301 (package
302 (name "librime")
3e5ed76d 303 (version "1.6.1")
78209a16
MP
304 (source
305 (origin
86374285
RW
306 (method git-fetch)
307 (uri (git-reference
b0e7b699 308 (url "https://github.com/rime/librime")
86374285
RW
309 (commit version)))
310 (file-name (git-file-name name version))
78209a16 311 (sha256
950ebfd1 312 (base32
3e5ed76d 313 "1avmy2yyag22cl2j8085n5czsk93sxv440pdb3a2diwcxwwmzm9v"))
950ebfd1
EF
314 (modules '((guix build utils)))
315 (snippet
316 '(begin
317 (delete-file-recursively "thirdparty/src")
318 (delete-file-recursively "thirdparty/bin")
319 (delete-file-recursively "thirdparty/include/X11")
320 #t))))
78209a16 321 (build-system cmake-build-system)
950ebfd1 322 (arguments
51d4c79d 323 '(#:phases
950ebfd1
EF
324 (modify-phases %standard-phases
325 (add-after 'unpack 'patch-source
326 (lambda _
327 (substitute* "CMakeLists.txt"
328 (("include_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/include\\)") "")
329 (("link_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/lib\\)") ""))
330 #t)))))
78209a16
MP
331 (inputs
332 `(("boost" ,boost)
3e5ed76d 333 ("capnproto" ,capnproto)
78209a16
MP
334 ("glog" ,glog)
335 ("leveldb" ,leveldb)
336 ("marisa" ,marisa)
337 ("opencc" ,opencc)
338 ("yaml-cpp" ,yaml-cpp)))
950ebfd1
EF
339 (native-inputs
340 `(("googletest" ,googletest)
3e5ed76d 341 ("pkg-config" ,pkg-config)
950ebfd1 342 ("xorgproto" ,xorgproto))) ; keysym.h
78209a16
MP
343 (home-page "https://rime.im/")
344 (synopsis "The core library of Rime Input Method Engine")
345 (description "@dfn{librime} is the core library of Rime Input Method
346Engine, which is a lightweight, extensible input method engine supporting
347various input schemas including glyph-based input methods, romanization-based
348input methods as well as those for Chinese dialects. It has the ability to
349compose phrases and sentences intelligently and provide very accurate
350traditional Chinese output.")
351 (license bsd-3)))
1329f095
MP
352
353(define-public rime-data
354 (package
355 (name "rime-data")
387bc215 356 (version "0.38.20200623")
1329f095
MP
357 (source
358 (origin
359 (method git-fetch)
360 (uri (git-reference
b0e7b699 361 (url "https://github.com/rime/plum")
387bc215 362 (commit "397d601dd22cfc857613973724724b8f44db9f9c")))
1329f095
MP
363 (file-name "plum-checkout")
364 (sha256
387bc215 365 (base32 "06ad5c4m7xsfr4if5ywshfj2aj5g5b5hwzh38dzccn7c1l2ibi0z"))))
1329f095
MP
366 (build-system gnu-build-system)
367 (arguments
fa7bd611
PMY
368 `(#:modules ((ice-9 match)
369 ,@%gnu-build-system-modules)
370 #:tests? #f ; no tests
1329f095
MP
371 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
372 "no_update=1")
373 #:phases
374 (modify-phases %standard-phases
375 (add-after 'unpack 'patch-source
376 (lambda _
5fc75e85
PMY
377 ;; Don't build binary Rime schema. The binary Rime schema files
378 ;; are platform dependent and contains timestamp information.
379 ;; Thus they are not reproducible.
380
381 ;; Change `.DEFAULT_GOAL' to `all'.
1329f095
MP
382 (substitute* "Makefile"
383 (("^\\.DEFAULT_GOAL := preset")
384 ".DEFAULT_GOAL := all"))
5fc75e85
PMY
385 ;; Disable git operations.
386 (substitute* "scripts/install-packages.sh"
387 ((".*update-package\\.sh.*") ""))
1329f095 388 #t))
fa7bd611
PMY
389 ;; Copy Rime schemas into the "package/rime" directory.
390 (add-after 'unpack 'copy-rime-schemas
1329f095 391 (lambda* (#:key inputs #:allow-other-keys)
fa7bd611 392 (let ((dest-dir "package/rime"))
1329f095 393 (mkdir-p dest-dir)
fa7bd611
PMY
394 (for-each
395 (match-lambda
396 ((name . path)
397 (if (string-prefix? "rime-" name)
398 (let ((schema (substring name (string-length "rime-"))))
399 (symlink path (string-append dest-dir "/" schema))))))
400 inputs))
1329f095
MP
401 #t))
402 (delete 'configure))))
fa7bd611 403 (inputs
775e81b5 404 `(("rime-array"
1329f095
MP
405 ,(origin
406 (method git-fetch)
407 (uri (git-reference
b0e7b699 408 (url "https://github.com/rime/rime-array")
775e81b5 409 (commit "93cc99238f120606a076220ec4ddcad164f6396a")))
1329f095
MP
410 (file-name "rime-array-checkout")
411 (sha256
412 (base32
775e81b5
MP
413 "06yxrv3x702751jvx46rfw3ix34jk7jh183rz6bllznzi7lxz7sz"))))
414 ("rime-bopomofo"
1329f095
MP
415 ,(origin
416 (method git-fetch)
417 (uri (git-reference
b0e7b699 418 (url "https://github.com/rime/rime-bopomofo")
775e81b5 419 (commit "ed25098386f5efd3d70b08650f0d1b70c41c11a3")))
1329f095
MP
420 (file-name "rime-bopomofo-checkout")
421 (sha256
422 (base32
775e81b5
MP
423 "1ip1pbfb1hadf2mcymr5939iagf25ywfl67d9198jahzyr6rdyvc"))))
424 ("rime-cangjie"
1329f095
MP
425 ,(origin
426 (method git-fetch)
427 (uri (git-reference
b0e7b699 428 (url "https://github.com/rime/rime-cangjie")
775e81b5 429 (commit "5fd8ce6f64039e505ca02655a621f2e830b97c19")))
1329f095
MP
430 (file-name "rime-cangjie-checkout")
431 (sha256
432 (base32
775e81b5 433 "1gf6r0q593ixar6v0jyvs56cik2gjp7pf9v799rfd2yydyia3bfg"))))
387bc215
PMY
434 ("rime-cantonese"
435 ,(origin
436 (method git-fetch)
437 (uri (git-reference
b0e7b699 438 (url "https://github.com/rime/rime-cantonese")
387bc215
PMY
439 (commit "e06fe8e79d7d64db2f2b6339aabc004d8cbc1f67")))
440 (file-name "rime-cantonese-checkout")
441 (sha256
442 (base32
443 "0j6kbhdfj7dx812yzykndzbk53s2v1rsaa2jlyma03hz7qlnnl0s"))))
775e81b5 444 ("rime-combo-pinyin"
1329f095
MP
445 ,(origin
446 (method git-fetch)
447 (uri (git-reference
b0e7b699 448 (url "https://github.com/rime/rime-combo-pinyin")
387bc215 449 (commit "67b29cdc786928ea46b43a9c660dee3db8f1adff")))
1329f095
MP
450 (file-name "rime-combo-pinyin-checkout")
451 (sha256
452 (base32
387bc215 453 "1v6ax51xll2aizbz1xzjyk6p3lmq8cyzbxkrwcffa723zaj0zz4l"))))
775e81b5 454 ("rime-double-pinyin"
1329f095
MP
455 ,(origin
456 (method git-fetch)
457 (uri (git-reference
b0e7b699 458 (url "https://github.com/rime/rime-double-pinyin")
775e81b5 459 (commit "69bf85d4dfe8bac139c36abbd68d530b8b6622ea")))
1329f095
MP
460 (file-name "rime-double-pinyin-checkout")
461 (sha256
462 (base32
775e81b5
MP
463 "093wif5avvvw45fqbwj5wkbxrychy4pagl4mwsmbrayc8jkp69ak"))))
464 ("rime-emoji"
1329f095
MP
465 ,(origin
466 (method git-fetch)
467 (uri (git-reference
b0e7b699 468 (url "https://github.com/rime/rime-emoji")
387bc215 469 (commit "c99d34e4a837349e4679a110bb4b94f71fe015ae")))
1329f095
MP
470 (file-name "rime-emoji-checkout")
471 (sha256
472 (base32
387bc215 473 "1wiwlxjjml9xfgg7z1wzaf4b1bsg81dkwvsfff2b61fwxq61zkgw"))))
775e81b5 474 ("rime-essay"
1329f095
MP
475 ,(origin
476 (method git-fetch)
477 (uri (git-reference
b0e7b699 478 (url "https://github.com/rime/rime-essay")
387bc215 479 (commit "88055afa3752e4582fa887765d962a30e02bb1fa")))
1329f095
MP
480 (file-name "rime-essay-checkout")
481 (sha256
482 (base32
387bc215 483 "0ap7xqv6v0x6mdkw2cv93cbr6qhpla3803z04522wb8l9hr7iryg"))))
775e81b5 484 ("rime-ipa"
1329f095
MP
485 ,(origin
486 (method git-fetch)
487 (uri (git-reference
b0e7b699 488 (url "https://github.com/rime/rime-ipa")
387bc215 489 (commit "22b71710e029bcb412e9197192a638ab11bc2abf")))
1329f095
MP
490 (file-name "rime-ipa-checkout")
491 (sha256
492 (base32
387bc215 493 "0zdk4f9qkfj3q5hmjnairj1lv6f6y27mic12k886n6sxywwbwr2k"))))
775e81b5 494 ("rime-jyutping"
1329f095
MP
495 ,(origin
496 (method git-fetch)
497 (uri (git-reference
b0e7b699 498 (url "https://github.com/rime/rime-jyutping")
387bc215 499 (commit "6fe0d727b3178feabd0f01e6cd82599202764735")))
1329f095
MP
500 (file-name "rime-jyutping-checkout")
501 (sha256
502 (base32
387bc215 503 "0wz6d3pmi72ysh2c0nml3rsz9hd2vazsyhnz34gq26yf4j85phfs"))))
775e81b5 504 ("rime-luna-pinyin"
1329f095
MP
505 ,(origin
506 (method git-fetch)
507 (uri (git-reference
b0e7b699 508 (url "https://github.com/rime/rime-luna-pinyin")
387bc215 509 (commit "f1268e192ca88b9526467ce04ac3e47c837891ad")))
1329f095
MP
510 (file-name "rime-luna-pinyin-checkout")
511 (sha256
512 (base32
387bc215 513 "0nxnjp1ybcrsan1mxnzwbkfhwl99kza6i9k1s7m9wzmhv7x7zahg"))))
775e81b5 514 ("rime-middle-chinese"
1329f095
MP
515 ,(origin
516 (method git-fetch)
517 (uri (git-reference
b0e7b699 518 (url "https://github.com/rime/rime-middle-chinese")
775e81b5 519 (commit "ed6d44f8d0bedf6e0c1c3183a270f8f01a211a40")))
1329f095
MP
520 (file-name "rime-middle-chinese-checkout")
521 (sha256
522 (base32
775e81b5
MP
523 "09mql88lsrxa99pyllby5z22kaiwwa037ha8gwaxjnnlsjgvz7zx"))))
524 ("rime-pinyin-simp"
1329f095
MP
525 ,(origin
526 (method git-fetch)
527 (uri (git-reference
b0e7b699 528 (url "https://github.com/rime/rime-pinyin-simp")
387bc215 529 (commit "b73df7fc0994912ce785462b3be569ae81258ac2")))
1329f095
MP
530 (file-name "rime-pinyin-simp-checkout")
531 (sha256
532 (base32
387bc215 533 "1m9hchnj1xf5s5185qm66ja0g1324drc98b2jjhnqgcp47bwz9fx"))))
775e81b5 534 ("rime-prelude"
1329f095
MP
535 ,(origin
536 (method git-fetch)
537 (uri (git-reference
b0e7b699 538 (url "https://github.com/rime/rime-prelude")
775e81b5 539 (commit "8a52b4f86a59f3eb602f9a4cf6a680a67c15df8c")))
1329f095
MP
540 (file-name "rime-prelude-checkout")
541 (sha256
542 (base32
775e81b5
MP
543 "039fr3996vfxzn2milaq1f5fw08f6zgjsxsql6cfhsc5b55fidm7"))))
544 ("rime-quick"
1329f095
MP
545 ,(origin
546 (method git-fetch)
547 (uri (git-reference
b0e7b699 548 (url "https://github.com/rime/rime-quick")
775e81b5 549 (commit "3fe5911ba608cb2df1b6301b76ad1573bd482a76")))
1329f095
MP
550 (file-name "rime-quick-checkout")
551 (sha256
552 (base32
775e81b5
MP
553 "08bh87ym5qvw55lyw20l3m7jd4c2z5rvil8h5q8790r7z6j6ijy9"))))
554 ("rime-scj"
1329f095
MP
555 ,(origin
556 (method git-fetch)
557 (uri (git-reference
b0e7b699 558 (url "https://github.com/rime/rime-scj")
775e81b5 559 (commit "cab5a0858765eff0553dd685a2d61d5536e9149c")))
1329f095
MP
560 (file-name "rime-scj-checkout")
561 (sha256
562 (base32
775e81b5
MP
563 "0ard2bjp4896a8dimmcwyjwgmp9kl4rz92yc92jnd3y4rgwl6fvk"))))
564 ("rime-soutzoe"
1329f095
MP
565 ,(origin
566 (method git-fetch)
567 (uri (git-reference
b0e7b699 568 (url "https://github.com/rime/rime-soutzoe")
775e81b5 569 (commit "beeaeca72d8e17dfd1e9af58680439e9012987dc")))
1329f095
MP
570 (file-name "rime-soutzoe-checkout")
571 (sha256
572 (base32
775e81b5
MP
573 "0jyqx0q9s0qxn168l5n8zav8jcl2g5ppr7pa8jm1vwrllf20slcc"))))
574 ("rime-stenotype"
1329f095
MP
575 ,(origin
576 (method git-fetch)
577 (uri (git-reference
b0e7b699 578 (url "https://github.com/rime/rime-stenotype")
387bc215 579 (commit "f3e9189d5ce33c55d3936cc58e39d0c88b3f0c88")))
1329f095
MP
580 (file-name "rime-stenotype-checkout")
581 (sha256
582 (base32
387bc215 583 "0dl6px7lrh3xa87knjzwzdcwjj1k1dg4l72q7lb48an4s9f1cy5d"))))
775e81b5 584 ("rime-stroke"
1329f095
MP
585 ,(origin
586 (method git-fetch)
587 (uri (git-reference
b0e7b699 588 (url "https://github.com/rime/rime-stroke")
387bc215 589 (commit "ea8576d1accd6fda339e96b415caadb56e2a07d1")))
1329f095
MP
590 (file-name "rime-stroke-checkout")
591 (sha256
592 (base32
387bc215 593 "07h6nq9867hjrd2v3h1pnr940sdrw4mqrzj43siz1rzjxz3s904r"))))
775e81b5 594 ("rime-terra-pinyin"
1329f095
MP
595 ,(origin
596 (method git-fetch)
597 (uri (git-reference
b0e7b699 598 (url "https://github.com/rime/rime-terra-pinyin")
387bc215 599 (commit "492aaf914f9de37cc9d26b846dc693116de70ae8")))
1329f095
MP
600 (file-name "rime-terra-pinyin-checkout")
601 (sha256
602 (base32
387bc215 603 "1l4l2w42mc3sf7jwbadx95gzrsq11ld9f6yj2hwaq9accainw3bf"))))
775e81b5 604 ("rime-wubi"
1329f095
MP
605 ,(origin
606 (method git-fetch)
607 (uri (git-reference
b0e7b699 608 (url "https://github.com/rime/rime-wubi")
775e81b5 609 (commit "dd052ee158a38cb791755318b1aef9b4a3ed0316")))
1329f095
MP
610 (file-name "rime-wubi-checkout")
611 (sha256
612 (base32
775e81b5
MP
613 "00xzv3sbwqh2jz4i7s315h7rw17qa2dgj7kflyy3blxk0s2cqiqa"))))
614 ("rime-wugniu"
1329f095
MP
615 ,(origin
616 (method git-fetch)
617 (uri (git-reference
b0e7b699 618 (url "https://github.com/rime/rime-wugniu")
775e81b5 619 (commit "abd1ee98efbf170258fcf43875c21a4259e00b61")))
1329f095
MP
620 (file-name "rime-wugniu-checkout")
621 (sha256
622 (base32
775e81b5 623 "0qn54d3cclny106ixdw08r5n6wn52ffs1hgrma3k0j4pv0kr9nlq"))))))
1329f095
MP
624 (home-page "https://rime.im/")
625 (synopsis "Schema data of Rime Input Method Engine")
626 (description "@dfn{rime-data} provides the schema data of Rime Input
627Method Engine.")
d13c0ed6 628 (license lgpl3)))
d5b23d2b
MP
629
630(define-public ibus-rime
631 (package
632 (name "ibus-rime")
f7a25b50 633 (version "1.4.0")
d5b23d2b
MP
634 (source
635 (origin
487e3f5a
RW
636 (method git-fetch)
637 (uri (git-reference
b0e7b699 638 (url "https://github.com/rime/ibus-rime")
487e3f5a
RW
639 (commit version)))
640 (file-name (git-file-name name version))
d5b23d2b 641 (sha256
f7a25b50 642 (base32 "12y6jdz1amhgrnqa7zjim63dfsz6zyxyahbirfan37wmcfp6gp1d"))))
d5b23d2b
MP
643 (build-system gnu-build-system)
644 (arguments
645 `(#:tests? #f ; no tests
646 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
647 #:phases
648 (modify-phases %standard-phases
649 (add-after 'unpack 'patch-source
650 (lambda* (#:key inputs outputs #:allow-other-keys)
651 ;; Define RIME_DATA_DIR. It's required but not used by the code.
652 (substitute* "Makefile"
653 (("cmake")
654 (string-append "cmake -DRIME_DATA_DIR="
655 (assoc-ref inputs "rime-data")
656 "/share/rime-data")))
657 ;; rime_config.h defines the actual data directory.
658 (substitute* "rime_config.h"
659 (("^#define IBUS_RIME_INSTALL_PREFIX .*$")
660 (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
661 (assoc-ref outputs "out")
662 "\"\n"))
663 (("^#define IBUS_RIME_SHARED_DATA_DIR .*$")
664 (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
665 (assoc-ref inputs "rime-data")
666 "/share/rime-data\"\n")))
667 #t))
562b4e47 668 (add-after 'unpack 'fix-file-names
669 (lambda* (#:key outputs #:allow-other-keys)
670 ;; IBus uses the component file rime.xml to start the Rime
671 ;; engine. It must be patched with appropriate file names.
672 (substitute* "rime.xml"
673 (("/usr") (assoc-ref outputs "out")))
674 #t))
d5b23d2b
MP
675 (delete 'configure))))
676 (inputs
677 `(("gdk-pixbuf" ,gdk-pixbuf)
678 ("glib" ,glib)
679 ("ibus" ,ibus)
680 ("libnotify" ,libnotify)
681 ("librime" ,librime)
682 ("rime-data" ,rime-data)))
683 (native-inputs
c69959f0 684 `(("cmake" ,cmake-minimal)
d5b23d2b
MP
685 ("pkg-config" ,pkg-config)))
686 (home-page "https://rime.im/")
687 (synopsis "Rime Input Method Engine for IBus")
688 (description "@dfn{ibus-rime} provides the Rime input method engine for
689IBus. Rime is a lightweight, extensible input method engine supporting
690various input schemas including glyph-based input methods, romanization-based
691input methods as well as those for Chinese dialects. It has the ability to
692compose phrases and sentences intelligently and provide very accurate
693traditional Chinese output.")
560540f0 694 (license gpl3)))
94b8fe80 695
696(define-public libhangul
697 (package
698 (name "libhangul")
699 (version "0.1.0")
700 (source
701 (origin
702 (method url-fetch)
703 (uri (string-append "http://kldp.net/hangul/release/"
704 "3442-libhangul-" version ".tar.gz"))
705 (sha256
706 (base32
707 "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar"))))
708 (build-system gnu-build-system)
709 (home-page "https://github.com/libhangul/libhangul")
710 (synopsis "Library to support hangul input method logic")
711 (description
712 "This package provides a library to support hangul input method logic,
713hanja dictionary and small hangul character classification.")
714 (license lgpl2.1+)))
30208c10 715
716(define-public ibus-libhangul
717 (package
718 (name "ibus-libhangul")
719 (version "1.5.3")
720 (source
721 (origin
722 (method url-fetch)
723 (uri (string-append "https://github.com/libhangul/ibus-hangul/"
724 "releases/download/" version
725 "/ibus-hangul-" version ".tar.gz"))
726 (sha256
727 (base32
728 "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy"))))
729 (build-system gnu-build-system)
730 (arguments
731 `(#:phases
732 (modify-phases %standard-phases
733 (add-after 'install 'wrap
734 (lambda* (#:key inputs outputs #:allow-other-keys)
735 (wrap-program (string-append (assoc-ref outputs "out")
736 "/libexec/ibus-setup-hangul")
737 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
738 `("LD_LIBRARY_PATH" ":" prefix
739 (,(string-append (assoc-ref inputs "libhangul") "/lib")))
740 `("GI_TYPELIB_PATH" ":" prefix
741 (,(getenv "GI_TYPELIB_PATH"))))
742 #t)))))
743 (native-inputs
744 `(("pkg-config" ,pkg-config)
745 ("gettext" ,gettext-minimal)
746 ("glib:bin" ,glib "bin")))
747 (inputs
748 `(("ibus" ,ibus)
749 ("glib" ,glib)
750 ("python-pygobject" ,python-pygobject)
751 ("gtk+" ,gtk+)
752 ("libhangul" ,libhangul)
753 ("python" ,python)))
754 (home-page "https://github.com/libhangul/ibus-hangul")
755 (synopsis "Hangul engine for IBus")
756 (description
757 "ibus-hangul is a Korean input method engine for IBus.")
758 (license gpl2+)))