gnu: librime: Remove bundled sources.
[jackhill/guix/guix.git] / gnu / packages / ibus.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
5 ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages ibus)
25 #:use-module (guix licenses)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages anthy)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages cmake)
39 #:use-module (gnu packages databases)
40 #:use-module (gnu packages datastructures)
41 #:use-module (gnu packages freedesktop)
42 #:use-module (gnu packages gettext)
43 #:use-module (gnu packages glib)
44 #:use-module (gnu packages gnome)
45 #:use-module (gnu packages gtk)
46 #:use-module (gnu packages iso-codes)
47 #:use-module (gnu packages logging)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages serialization)
51 #:use-module (gnu packages textutils)
52 #:use-module (gnu packages xorg))
53
54 (define-public ibus
55 (package
56 (name "ibus")
57 (version "1.5.19")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append "https://github.com/ibus/ibus/"
61 "releases/download/"
62 version "/ibus-" version ".tar.gz"))
63 (sha256
64 (base32
65 "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
66 (build-system glib-or-gtk-build-system)
67 (arguments
68 `(#:tests? #f ; tests fail because there's no connection to dbus
69 #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
70 "--disable-python2"
71 "--enable-python-library"
72 ,(string-append "--with-ucd-dir="
73 (getcwd) "/ucd")
74 "--enable-wayland")
75 #:make-flags
76 (list "CC=gcc"
77 (string-append "pyoverridesdir="
78 (assoc-ref %outputs "out")
79 "/lib/python3.6/site-packages/gi/overrides/"))
80 #:phases
81 (modify-phases %standard-phases
82 (add-after 'unpack 'prepare-ucd-dir
83 (lambda* (#:key inputs #:allow-other-keys)
84 (mkdir-p "../ucd")
85 (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
86 (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
87 #t))
88 (add-before 'configure 'disable-dconf-update
89 (lambda _
90 (substitute* "data/dconf/Makefile.in"
91 (("dconf update") "echo dconf update"))
92 #t))
93 (add-after 'unpack 'delete-generated-files
94 (lambda _
95 (for-each (lambda (file)
96 (let ((c (string-append (string-drop-right file 4) "c")))
97 (when (file-exists? c)
98 (format #t "deleting ~a\n" c)
99 (delete-file c))))
100 (find-files "." "\\.vala"))
101 #t))
102 (add-after 'unpack 'fix-paths
103 (lambda* (#:key inputs #:allow-other-keys)
104 (substitute* "src/ibusenginesimple.c"
105 (("/usr/share/X11/locale")
106 (string-append (assoc-ref inputs "libx11")
107 "/share/X11/locale")))
108 (substitute* "ui/gtk3/xkblayout.vala"
109 (("\"(setxkbmap|xmodmap)\"" _ prog)
110 (string-append "\"" (assoc-ref inputs prog) "\"")))
111 #t))
112 (add-after 'wrap-program 'wrap-with-additional-paths
113 (lambda* (#:key outputs #:allow-other-keys)
114 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
115 ;; GI_TYPELIB_PATH.
116 (let ((out (assoc-ref outputs "out")))
117 (wrap-program (string-append out "/bin/ibus-setup")
118 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
119 `("GI_TYPELIB_PATH" ":" prefix
120 (,(getenv "GI_TYPELIB_PATH")
121 ,(string-append out "/lib/girepository-1.0")))))
122 #t)))))
123 (inputs
124 `(("dbus" ,dbus)
125 ("dconf" ,dconf)
126 ("gconf" ,gconf)
127 ("gtk2" ,gtk+-2)
128 ("gtk+" ,gtk+)
129 ("intltool" ,intltool)
130 ("json-glib" ,json-glib)
131 ("libnotify" ,libnotify)
132 ("libx11" ,libx11)
133 ("setxkbmap" ,setxkbmap)
134 ("wayland" ,wayland)
135 ("xmodmap" ,xmodmap)
136 ("iso-codes" ,iso-codes)
137 ("pygobject2" ,python-pygobject)
138 ("python" ,python)))
139 (native-inputs
140 `(("glib" ,glib "bin") ; for glib-genmarshal
141 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
142 ("unicode-nameslist"
143 ,(origin
144 (method url-fetch)
145 (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
146 (sha256
147 (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
148 ("unicode-blocks"
149 ,(origin
150 (method url-fetch)
151 (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
152 (sha256
153 (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
154 ("vala" ,vala)
155 ("pkg-config" ,pkg-config)))
156 (native-search-paths
157 (list (search-path-specification
158 (variable "IBUS_COMPONENT_PATH")
159 (files '("share/ibus/component")))))
160 (synopsis "Input method framework")
161 (description
162 "IBus is an input framework providing a full-featured and user-friendly
163 input method user interface. It comes with multilingual input support. It
164 may also simplify input method development.")
165 (home-page "https://github.com/ibus/ibus/wiki")
166 (license lgpl2.1+)))
167
168 (define-public ibus-libpinyin
169 (package
170 (name "ibus-libpinyin")
171 (version "1.10.0")
172 (source (origin
173 (method url-fetch)
174 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
175 "releases/download/" version
176 "/ibus-libpinyin-" version ".tar.gz"))
177 (sha256
178 (base32
179 "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
180 (build-system glib-or-gtk-build-system)
181 (arguments
182 `(#:phases
183 (modify-phases %standard-phases
184 (add-after 'wrap-program 'wrap-with-additional-paths
185 (lambda* (#:key inputs outputs #:allow-other-keys)
186 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
187 ;; PYTHONPATH and GI_TYPELIB_PATH.
188 (let ((out (assoc-ref outputs "out")))
189 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
190 `("PYTHONPATH" ":" prefix
191 (,(getenv "PYTHONPATH")
192 ,(string-append (assoc-ref inputs "ibus")
193 "/lib/girepository-1.0")))
194 `("GI_TYPELIB_PATH" ":" prefix
195 (,(string-append (assoc-ref inputs "ibus")
196 "/lib/girepository-1.0"))))
197 #t))))))
198 (inputs
199 `(("ibus" ,ibus)
200 ("libpinyin" ,libpinyin)
201 ("bdb" ,bdb)
202 ("sqlite" ,sqlite)
203 ("python" ,python)
204 ("pyxdg" ,python-pyxdg)
205 ("gtk+" ,gtk+)))
206 (native-inputs
207 `(("pkg-config" ,pkg-config)
208 ("intltool" ,intltool)
209 ("glib" ,glib "bin")))
210 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
211 (description
212 "This package includes a Chinese pinyin input method and a Chinese
213 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
214 (home-page "https://github.com/libpinyin/ibus-libpinyin")
215 (license gpl2+)))
216
217 (define-public libpinyin
218 (package
219 (name "libpinyin")
220 (version "2.2.0")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append "https://github.com/libpinyin/libpinyin/"
224 "releases/download/" version
225 "/libpinyin-2.2.0.tar.gz"))
226 (sha256
227 (base32
228 "1c4wxvcvjxvk23mcwqvsfsv4nhimx4kpjhabxa28gx1ih10l88gj"))))
229 (build-system gnu-build-system)
230 (inputs
231 `(("glib" ,glib)
232 ("bdb" ,bdb)))
233 (native-inputs
234 `(("pkg-config" ,pkg-config)))
235 (synopsis "Library to handle Chinese pinyin")
236 (description
237 "The libpinyin C++ library provides algorithms needed for sentence-based
238 Chinese pinyin input methods.")
239 (home-page "https://github.com/libpinyin/libpinyin")
240 (license gpl2+)))
241
242 (define-public ibus-anthy
243 (package
244 (name "ibus-anthy")
245 (version "1.5.9")
246 (source (origin
247 (method url-fetch)
248 (uri (string-append
249 "https://github.com/ibus/ibus-anthy/releases/download/"
250 version "/ibus-anthy-" version ".tar.gz"))
251 (sha256
252 (base32
253 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
254 (build-system gnu-build-system)
255 (arguments
256 '(#:configure-flags
257 ;; Use absolute exec path in the anthy.xml.
258 (list (string-append "--libexecdir=" %output "/libexec"))
259 #:phases
260 (modify-phases %standard-phases
261 (add-after 'install 'wrap-programs
262 (lambda* (#:key outputs #:allow-other-keys)
263 (let ((out (assoc-ref outputs "out")))
264 (for-each
265 (lambda (prog)
266 (wrap-program (string-append out "/libexec/" prog)
267 `("PYTHONPATH" ":" prefix
268 (,(getenv "PYTHONPATH")))
269 `("GI_TYPELIB_PATH" ":" prefix
270 (,(getenv "GI_TYPELIB_PATH")
271 ,(string-append out "/lib/girepository-1.0")))))
272 '("ibus-engine-anthy" "ibus-setup-anthy"))
273 #t))))))
274 (native-inputs
275 `(("gettext" ,gettext-minimal)
276 ("intltool" ,intltool)
277 ("pkg-config" ,pkg-config)
278 ("python" ,python)))
279 (inputs
280 `(("anthy" ,anthy)
281 ("gtk+" ,gtk+)
282 ("ibus" ,ibus)
283 ("gobject-introspection" ,gobject-introspection)
284 ("python-pygobject" ,python-pygobject)))
285 (synopsis "Anthy Japanese language input method for IBus")
286 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
287 adds the Anthy Japanese language input method to IBus. Because most graphical
288 applications allow text input via IBus, installing this package will enable
289 Japanese language input in most graphical applications.")
290 (home-page "https://github.com/fujiwarat/ibus-anthy")
291 (license gpl2+)))
292
293 (define-public librime
294 (package
295 (name "librime")
296 (version "1.3.2")
297 (source
298 (origin
299 (method git-fetch)
300 (uri (git-reference
301 (url "https://github.com/rime/librime.git")
302 (commit version)))
303 (file-name (git-file-name name version))
304 (sha256
305 (base32
306 "06q10cv7a3i6d8l3sq79nasw3p1njvmjgh4jq2hqw9abcx351m1r"))
307 (modules '((guix build utils)))
308 (snippet
309 '(begin
310 (delete-file-recursively "thirdparty/src")
311 (delete-file-recursively "thirdparty/bin")
312 (delete-file-recursively "thirdparty/include/X11")
313 #t))))
314 (build-system cmake-build-system)
315 (arguments
316 '(#:phases
317 (modify-phases %standard-phases
318 (add-after 'unpack 'patch-source
319 (lambda _
320 (substitute* "CMakeLists.txt"
321 (("include_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/include\\)") "")
322 (("link_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/lib\\)") ""))
323 #t)))))
324 (inputs
325 `(("boost" ,boost)
326 ("glog" ,glog)
327 ("leveldb" ,leveldb)
328 ("marisa" ,marisa)
329 ("opencc" ,opencc)
330 ("yaml-cpp" ,yaml-cpp)))
331 (native-inputs
332 `(("googletest" ,googletest)
333 ("xorgproto" ,xorgproto))) ; keysym.h
334 (home-page "https://rime.im/")
335 (synopsis "The core library of Rime Input Method Engine")
336 (description "@dfn{librime} is the core library of Rime Input Method
337 Engine, which is a lightweight, extensible input method engine supporting
338 various input schemas including glyph-based input methods, romanization-based
339 input methods as well as those for Chinese dialects. It has the ability to
340 compose phrases and sentences intelligently and provide very accurate
341 traditional Chinese output.")
342 (license bsd-3)))
343
344 (define-public rime-data
345 (package
346 (name "rime-data")
347 (version "0.38.20181029")
348 (source
349 (origin
350 (method git-fetch)
351 (uri (git-reference
352 (url "https://github.com/rime/plum.git")
353 (commit "fb4f829da2007f2dbb37d60a79bc67c25ea16568")))
354 (file-name "plum-checkout")
355 (sha256
356 (base32 "1m1wiv9j5bay4saga58c7dj4h8gqivsbyp16y245ifvxvp9czj67"))))
357 (build-system gnu-build-system)
358 (arguments
359 `(#:tests? #f ; no tests
360 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
361 "no_update=1")
362 #:phases
363 (modify-phases %standard-phases
364 (add-after 'unpack 'patch-source
365 (lambda _
366 ;; Set .DEFAULT_GOAL to `all'.
367 ;; Don't build binary schemas. The output is not deterministic.
368 (substitute* "Makefile"
369 (("^\\.DEFAULT_GOAL := preset")
370 ".DEFAULT_GOAL := all"))
371 #t))
372 ;; Add schema packages into "package/rime" directory.
373 (add-after 'unpack 'add-packages
374 (lambda* (#:key inputs #:allow-other-keys)
375 (let* ((dest-dir "package/rime"))
376 (mkdir-p dest-dir)
377 (for-each (lambda (pkg)
378 (symlink (assoc-ref inputs pkg)
379 (string-append dest-dir "/" pkg)))
380 '("array"
381 "bopomofo"
382 "cangjie"
383 "combo-pinyin"
384 "double-pinyin"
385 "emoji"
386 "essay"
387 "ipa"
388 "jyutping"
389 "luna-pinyin"
390 "middle-chinese"
391 "pinyin-simp"
392 "prelude"
393 "quick"
394 "scj"
395 "soutzoe"
396 "stenotype"
397 "stroke"
398 "terra-pinyin"
399 "wubi"
400 "wugniu")))
401 #t))
402 (delete 'configure))))
403 (native-inputs
404 `(("array"
405 ,(origin
406 (method git-fetch)
407 (uri (git-reference
408 (url "https://github.com/rime/rime-array.git")
409 (commit "906e923902147584b0b0247028a782abbfbfd8a0")))
410 (file-name "rime-array-checkout")
411 (sha256
412 (base32
413 "1alk6ghn4ji4kvp7lfm57bwm2gjh99i79r0w9naz6wkdim8idvb1"))))
414 ("bopomofo"
415 ,(origin
416 (method git-fetch)
417 (uri (git-reference
418 (url "https://github.com/rime/rime-bopomofo.git")
419 (commit "8dc44ca1b6ef4e45b452e070b9da737f5da165e3")))
420 (file-name "rime-bopomofo-checkout")
421 (sha256
422 (base32
423 "16k6wfhcrw3a77rmbrp21ca0gmsmb3f68s193c1cfwr8i68k46nf"))))
424 ("cangjie"
425 ,(origin
426 (method git-fetch)
427 (uri (git-reference
428 (url "https://github.com/rime/rime-cangjie.git")
429 (commit "ab085e90856b3399b374dc3c8b4cb40d11f307a8")))
430 (file-name "rime-cangjie-checkout")
431 (sha256
432 (base32
433 "11fgj0rbv9nyzfijwm2l8pm8fznhif4h27ndrrcaaylkp7p5zsx2"))))
434 ("combo-pinyin"
435 ,(origin
436 (method git-fetch)
437 (uri (git-reference
438 (url "https://github.com/rime/rime-combo-pinyin.git")
439 (commit "f1bae63f20504f2b8113c5cbdf2700e858aa91eb")))
440 (file-name "rime-combo-pinyin-checkout")
441 (sha256
442 (base32
443 "1l1079akwm1hw4kkn0q6x9fpylnl2ka6z2fn7lmdpfpsr0xgn0n7"))))
444 ("double-pinyin"
445 ,(origin
446 (method git-fetch)
447 (uri (git-reference
448 (url "https://github.com/rime/rime-double-pinyin.git")
449 (commit "2101a5cd40e511ec38835769aa66d2dddf059c2e")))
450 (file-name "rime-double-pinyin-checkout")
451 (sha256
452 (base32
453 "19hh2qm0njbfk2js678hfm2hw9b796s43vs11yy3m1v9m0gk2vi7"))))
454 ("emoji"
455 ,(origin
456 (method git-fetch)
457 (uri (git-reference
458 (url "https://github.com/rime/rime-emoji.git")
459 (commit "6e6611b315f03ee4c33f958f9dbe960b13a0ed19")))
460 (file-name "rime-emoji-checkout")
461 (sha256
462 (base32
463 "1brfs3214w36j3345di9ygp468hbvbqdqpkjxxs1dbp437rayhyy"))))
464 ("essay"
465 ,(origin
466 (method git-fetch)
467 (uri (git-reference
468 (url "https://github.com/rime/rime-essay.git")
469 (commit "5e5c7a0ef41c9b030abdad81a9df07b56b1661e9")))
470 (file-name "rime-essay-checkout")
471 (sha256
472 (base32
473 "0ana9is0zhh79m4gjshvmaxbrg3jiqysydx5bpm151i7i6vw5y1i"))))
474 ("ipa"
475 ,(origin
476 (method git-fetch)
477 (uri (git-reference
478 (url "https://github.com/rime/rime-ipa.git")
479 (commit "02a9e2c181921a2e95e1a81f88188c41132755c3")))
480 (file-name "rime-ipa-checkout")
481 (sha256
482 (base32
483 "1szrxgvqlgmxapj2aflw2cvbv0p6pl0sw0gyxa13dvdhhf7s9rvr"))))
484 ("jyutping"
485 ,(origin
486 (method git-fetch)
487 (uri (git-reference
488 (url "https://github.com/rime/rime-jyutping.git")
489 (commit "1402ec3d6cc0973f952fe3f9ef531294e4ffe9e0")))
490 (file-name "rime-jyutping-checkout")
491 (sha256
492 (base32
493 "17g03dy4gw6vyc9da1wjn3iy9hx64dfnwiwsfc7bkzan22x2m4dv"))))
494 ("luna-pinyin"
495 ,(origin
496 (method git-fetch)
497 (uri (git-reference
498 (url "https://github.com/rime/rime-luna-pinyin.git")
499 (commit "3b05132576f5c347ff8a70857d2dae080936ac3b")))
500 (file-name "rime-luna-pinyin-checkout")
501 (sha256
502 (base32
503 "0kgnpxjn10dm2d9718r12rdjlwqd2s2h84jvkhxhh5v0dkv1anl2"))))
504 ("middle-chinese"
505 ,(origin
506 (method git-fetch)
507 (uri (git-reference
508 (url "https://github.com/rime/rime-middle-chinese.git")
509 (commit "9ba8d70330654b9a730f882d35cfad7dbeddfd75")))
510 (file-name "rime-middle-chinese-checkout")
511 (sha256
512 (base32
513 "0hwg5zby5kphh0bcfay8mfxwr5bwqhamiw3cmmmf7kp9fbns5s23"))))
514 ("pinyin-simp"
515 ,(origin
516 (method git-fetch)
517 (uri (git-reference
518 (url "https://github.com/rime/rime-pinyin-simp.git")
519 (commit "74357ffd62c05fb60edf6eab5b86bc8c8c1907d0")))
520 (file-name "rime-pinyin-simp-checkout")
521 (sha256
522 (base32
523 "1paw3c7pv5bl54abnp9pidfxrkchdacyxy5m9zb311p5sgm7fhxh"))))
524 ("prelude"
525 ,(origin
526 (method git-fetch)
527 (uri (git-reference
528 (url "https://github.com/rime/rime-prelude.git")
529 (commit "33040568c3ddb2ee6340c9b669494317db21b77c")))
530 (file-name "rime-prelude-checkout")
531 (sha256
532 (base32
533 "1gwcasyyg6f0ib6s4qsrrjcqr1lcs7j3xqxl65rznsw44nhnbwwq"))))
534 ("quick"
535 ,(origin
536 (method git-fetch)
537 (uri (git-reference
538 (url "https://github.com/rime/rime-quick.git")
539 (commit "910a97d403ad8e72f322488da146da79c19d623f")))
540 (file-name "rime-quick-checkout")
541 (sha256
542 (base32
543 "0yrq3gbfmm29xlr52rmxc41mqfrb0295q7sdhbc3ax71677mpr0y"))))
544 ("scj"
545 ,(origin
546 (method git-fetch)
547 (uri (git-reference
548 (url "https://github.com/rime/rime-scj.git")
549 (commit "e0eae889f4376d2a434ac3b38523e0da7400db68")))
550 (file-name "rime-scj-checkout")
551 (sha256
552 (base32
553 "1whnv9zs349kvy0zi7dnmpqwil8i6gqwrzvhy3qdrjzy58y6gwxn"))))
554 ("soutzoe"
555 ,(origin
556 (method git-fetch)
557 (uri (git-reference
558 (url "https://github.com/rime/rime-soutzoe.git")
559 (commit "e47841a8ad6341731c41cdb814b7a25c837603c4")))
560 (file-name "rime-soutzoe-checkout")
561 (sha256
562 (base32
563 "1rgpmkxa72jy6gyy44fn8azpk3amk9s9lrdf7za03nv95d0fvm0p"))))
564 ("stenotype"
565 ,(origin
566 (method git-fetch)
567 (uri (git-reference
568 (url "https://github.com/rime/rime-stenotype.git")
569 (commit "d4ff379314fd95283853d1734854979cf3cbd287")))
570 (file-name "rime-stenotype-checkout")
571 (sha256
572 (base32
573 "1kckpi4l4884hvydr3d6vid3v7rsc1app29kmk7v8jf8vn16afhl"))))
574 ("stroke"
575 ,(origin
576 (method git-fetch)
577 (uri (git-reference
578 (url "https://github.com/rime/rime-stroke.git")
579 (commit "cfd29c675c46cf70b7a7f0a3836a913059316a0a")))
580 (file-name "rime-stroke-checkout")
581 (sha256
582 (base32
583 "135is9c1p4lm98fd9l1gxyflkm69cv5an129ka7sk614bq84m08d"))))
584 ("terra-pinyin"
585 ,(origin
586 (method git-fetch)
587 (uri (git-reference
588 (url "https://github.com/rime/rime-terra-pinyin.git")
589 (commit "15b5c73a796571cd6f9ef6c89f96656cb9df86f9")))
590 (file-name "rime-terra-pinyin-checkout")
591 (sha256
592 (base32
593 "1xsd84h1zw417h5hr4dbgyk5009zi7q2p9774w3ccr5sxgc3i3cm"))))
594 ("wubi"
595 ,(origin
596 (method git-fetch)
597 (uri (git-reference
598 (url "https://github.com/rime/rime-wubi.git")
599 (commit "d44403728a0b1cd8b47cb1f81b83f58e5f790b74")))
600 (file-name "rime-wubi-checkout")
601 (sha256
602 (base32
603 "0ld31bdn94lncxd1ka44w4sbl03skh08mc927dhdmwq5bpvrgn36"))))
604 ("wugniu"
605 ,(origin
606 (method git-fetch)
607 (uri (git-reference
608 (url "https://github.com/rime/rime-wugniu.git")
609 (commit "65bcc354ada3839591d7546a64c71dbdd0592b02")))
610 (file-name "rime-wugniu-checkout")
611 (sha256
612 (base32
613 "0g31awp40s778sp5c290x40s8np86n8aw011s17sslxrqhhb0bkx"))))))
614 (home-page "https://rime.im/")
615 (synopsis "Schema data of Rime Input Method Engine")
616 (description "@dfn{rime-data} provides the schema data of Rime Input
617 Method Engine.")
618 (license lgpl3+)))
619
620 (define-public ibus-rime
621 (package
622 (name "ibus-rime")
623 (version "1.3.0")
624 (source
625 (origin
626 (method git-fetch)
627 (uri (git-reference
628 (url "https://github.com/rime/ibus-rime.git")
629 (commit version)))
630 (file-name (git-file-name name version))
631 (sha256
632 (base32 "1nqi7ymv34a9kx24say3xj98lkrs9nkpv1n2ijb91wdz3cr012ly"))))
633 (build-system gnu-build-system)
634 (arguments
635 `(#:tests? #f ; no tests
636 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
637 #:phases
638 (modify-phases %standard-phases
639 (add-after 'unpack 'patch-source
640 (lambda* (#:key inputs outputs #:allow-other-keys)
641 ;; Define RIME_DATA_DIR. It's required but not used by the code.
642 (substitute* "Makefile"
643 (("cmake")
644 (string-append "cmake -DRIME_DATA_DIR="
645 (assoc-ref inputs "rime-data")
646 "/share/rime-data")))
647 ;; rime_config.h defines the actual data directory.
648 (substitute* "rime_config.h"
649 (("^#define IBUS_RIME_INSTALL_PREFIX .*$")
650 (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
651 (assoc-ref outputs "out")
652 "\"\n"))
653 (("^#define IBUS_RIME_SHARED_DATA_DIR .*$")
654 (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
655 (assoc-ref inputs "rime-data")
656 "/share/rime-data\"\n")))
657 #t))
658 (delete 'configure))))
659 (inputs
660 `(("gdk-pixbuf" ,gdk-pixbuf)
661 ("glib" ,glib)
662 ("ibus" ,ibus)
663 ("libnotify" ,libnotify)
664 ("librime" ,librime)
665 ("rime-data" ,rime-data)))
666 (native-inputs
667 `(("cmake" ,cmake)
668 ("pkg-config" ,pkg-config)))
669 (home-page "https://rime.im/")
670 (synopsis "Rime Input Method Engine for IBus")
671 (description "@dfn{ibus-rime} provides the Rime input method engine for
672 IBus. Rime is a lightweight, extensible input method engine supporting
673 various input schemas including glyph-based input methods, romanization-based
674 input methods as well as those for Chinese dialects. It has the ability to
675 compose phrases and sentences intelligently and provide very accurate
676 traditional Chinese output.")
677 (license gpl3+)))