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>
10 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
65 (uri (string-append "https://github.com/ibus/ibus/"
67 version "/ibus-" version ".tar.gz"))
70 "0jmy2w01phpmqnjnfnak7nvfna57mpgfnl87jwc4iai8ijjynw41"))))
71 (build-system glib-or-gtk-build-system)
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"
77 "--with-unicode-emoji-dir="
78 (assoc-ref %build-inputs "unicode-emoji")
79 "/share/unicode/emoji")
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 (assoc-ref %build-inputs "ucd")
89 (modify-phases %standard-phases
90 (add-after 'unpack 'patch-python-target-directories
91 (lambda* (#:key outputs #:allow-other-keys)
92 (let ((root (string-append (assoc-ref outputs "out")
94 ,(version-major+minor (package-version python))
96 (substitute* "configure"
97 (("(py2?overridesdir)=.*" _ var)
98 (string-append var "=" root "/gi/overrides/"))
99 (("(pkgpython2dir=).*" _ var)
100 (string-append var root "/ibus"))))
102 (add-before 'configure 'disable-dconf-update
104 (substitute* "data/dconf/Makefile.in"
105 (("dconf update") "echo dconf update"))
107 (add-after 'unpack 'delete-generated-files
109 (for-each (lambda (file)
110 (let ((c (string-append (string-drop-right file 4) "c")))
111 (when (file-exists? c)
112 (format #t "deleting ~a\n" c)
114 (find-files "." "\\.vala"))
116 (add-after 'unpack 'fix-paths
117 (lambda* (#:key inputs #:allow-other-keys)
118 (substitute* "src/ibusenginesimple.c"
119 (("/usr/share/X11/locale")
120 (string-append (assoc-ref inputs "libx11")
121 "/share/X11/locale")))
122 (substitute* "ui/gtk3/xkblayout.vala"
123 (("\"(setxkbmap|xmodmap)\"" _ prog)
124 (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\"")))
126 (add-after 'wrap-program 'wrap-with-additional-paths
127 (lambda* (#:key outputs #:allow-other-keys)
128 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
130 (let ((out (assoc-ref outputs "out")))
131 (wrap-program (string-append out "/bin/ibus-setup")
132 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
133 `("GI_TYPELIB_PATH" ":" prefix
134 (,(getenv "GI_TYPELIB_PATH")
135 ,(string-append out "/lib/girepository-1.0")))))
143 ("gettext" ,gnu-gettext)
144 ("json-glib" ,json-glib)
145 ("libnotify" ,libnotify)
147 ("setxkbmap" ,setxkbmap)
150 ("iso-codes" ,iso-codes)
151 ("pygobject2" ,python-pygobject)
154 `(("glib" ,glib "bin") ; for glib-genmarshal
155 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
157 ("unicode-emoji" ,unicode-emoji)
158 ("unicode-cldr-common" ,unicode-cldr-common)
160 ("pkg-config" ,pkg-config)))
162 (list (search-path-specification
163 (variable "IBUS_COMPONENT_PATH")
164 (files '("share/ibus/component")))))
165 (synopsis "Input method framework")
167 "IBus is an input framework providing a full-featured and user-friendly
168 input method user interface. It comes with multilingual input support. It
169 may also simplify input method development.")
170 (home-page "https://github.com/ibus/ibus/wiki")
173 (define-public ibus-libpinyin
175 (name "ibus-libpinyin")
179 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
180 "releases/download/" version
181 "/ibus-libpinyin-" version ".tar.gz"))
184 "1bl1cgicd2df797dx1x0q904438bsn8i23djzcfcai4dp3631xc0"))))
185 (build-system glib-or-gtk-build-system)
188 (modify-phases %standard-phases
189 (add-after 'wrap-program 'wrap-with-additional-paths
190 (lambda* (#:key inputs outputs #:allow-other-keys)
191 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
192 ;; PYTHONPATH and GI_TYPELIB_PATH.
193 (let ((out (assoc-ref outputs "out")))
194 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
195 `("PYTHONPATH" ":" prefix
196 (,(getenv "PYTHONPATH")
197 ,(string-append (assoc-ref inputs "ibus")
198 "/lib/girepository-1.0")))
199 `("GI_TYPELIB_PATH" ":" prefix
200 (,(string-append (assoc-ref inputs "ibus")
201 "/lib/girepository-1.0"))))
205 ("libpinyin" ,libpinyin)
209 ("pyxdg" ,python-pyxdg)
210 ("pygobject2" ,python-pygobject)
213 `(("pkg-config" ,pkg-config)
214 ("intltool" ,intltool)
215 ("glib" ,glib "bin")))
216 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
218 "This package includes a Chinese pinyin input method and a Chinese
219 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
220 (home-page "https://github.com/libpinyin/ibus-libpinyin")
223 (define-public libpinyin
229 (uri (string-append "https://github.com/libpinyin/libpinyin/"
230 "releases/download/" version
231 "/libpinyin-" version ".tar.gz"))
234 "14969v6w8n1aiqphl2386dws7dmsdwbzyqnlz4kr8ppm39m9rp5k"))))
235 (build-system gnu-build-system)
240 `(("pkg-config" ,pkg-config)))
241 (synopsis "Library to handle Chinese pinyin")
243 "The libpinyin C++ library provides algorithms needed for sentence-based
244 Chinese pinyin input methods.")
245 (home-page "https://github.com/libpinyin/libpinyin")
248 (define-public ibus-anthy
255 "https://github.com/ibus/ibus-anthy/releases/download/"
256 version "/ibus-anthy-" version ".tar.gz"))
259 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
260 (build-system gnu-build-system)
263 ;; Use absolute exec path in the anthy.xml.
264 (list (string-append "--libexecdir=" %output "/libexec"))
266 (modify-phases %standard-phases
267 (add-after 'install 'wrap-programs
268 (lambda* (#:key outputs #:allow-other-keys)
269 (let ((out (assoc-ref outputs "out")))
272 (wrap-program (string-append out "/libexec/" prog)
273 `("PYTHONPATH" ":" prefix
274 (,(getenv "PYTHONPATH")))
275 `("GI_TYPELIB_PATH" ":" prefix
276 (,(getenv "GI_TYPELIB_PATH")
277 ,(string-append out "/lib/girepository-1.0")))))
278 '("ibus-engine-anthy" "ibus-setup-anthy"))
281 `(("gettext" ,gettext-minimal)
282 ("intltool" ,intltool)
283 ("pkg-config" ,pkg-config)
289 ("gobject-introspection" ,gobject-introspection)
290 ("python-pygobject" ,python-pygobject)))
291 (synopsis "Anthy Japanese language input method for IBus")
292 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
293 adds the Anthy Japanese language input method to IBus. Because most graphical
294 applications allow text input via IBus, installing this package will enable
295 Japanese language input in most graphical applications.")
296 (home-page "https://github.com/fujiwarat/ibus-anthy")
299 (define-public librime
307 (url "https://github.com/rime/librime.git")
309 (file-name (git-file-name name version))
312 "0xskhdhk7dgpc71r39pfzxi5vrlzy90aqj1gzv8nnapq91p2awhv"))
313 (modules '((guix build utils)))
316 (delete-file-recursively "thirdparty/src")
317 (delete-file-recursively "thirdparty/bin")
318 (delete-file-recursively "thirdparty/include/X11")
320 (build-system cmake-build-system)
323 (modify-phases %standard-phases
324 (add-after 'unpack 'patch-source
326 (substitute* "CMakeLists.txt"
327 (("include_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/include\\)") "")
328 (("link_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/lib\\)") ""))
336 ("yaml-cpp" ,yaml-cpp)))
338 `(("googletest" ,googletest)
339 ("xorgproto" ,xorgproto))) ; keysym.h
340 (home-page "https://rime.im/")
341 (synopsis "The core library of Rime Input Method Engine")
342 (description "@dfn{librime} is the core library of Rime Input Method
343 Engine, which is a lightweight, extensible input method engine supporting
344 various input schemas including glyph-based input methods, romanization-based
345 input methods as well as those for Chinese dialects. It has the ability to
346 compose phrases and sentences intelligently and provide very accurate
347 traditional Chinese output.")
350 (define-public rime-data
353 (version "0.38.20190131")
358 (url "https://github.com/rime/plum.git")
359 (commit "8b48688cd4610d0c9223eb68831a31b6134e4cc8")))
360 (file-name "plum-checkout")
362 (base32 "0fv3hv4av9y7afxijh1n8idnyf82v9rxxi2ypmxd7lkj4naa22qh"))))
363 (build-system gnu-build-system)
365 `(#:tests? #f ; no tests
366 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
369 (modify-phases %standard-phases
370 (add-after 'unpack 'patch-source
372 ;; Set .DEFAULT_GOAL to `all'.
373 ;; Don't build binary schemas. The output is not deterministic.
374 (substitute* "Makefile"
375 (("^\\.DEFAULT_GOAL := preset")
376 ".DEFAULT_GOAL := all"))
378 ;; Add schema packages into "package/rime" directory.
379 (add-after 'unpack 'add-packages
380 (lambda* (#:key inputs #:allow-other-keys)
381 (let* ((dest-dir "package/rime"))
383 (for-each (lambda (pkg)
384 (symlink (assoc-ref inputs
385 (string-append "rime-" pkg))
386 (string-append dest-dir "/" pkg)))
409 (delete 'configure))))
415 (url "https://github.com/rime/rime-array.git")
416 (commit "93cc99238f120606a076220ec4ddcad164f6396a")))
417 (file-name "rime-array-checkout")
420 "06yxrv3x702751jvx46rfw3ix34jk7jh183rz6bllznzi7lxz7sz"))))
425 (url "https://github.com/rime/rime-bopomofo.git")
426 (commit "ed25098386f5efd3d70b08650f0d1b70c41c11a3")))
427 (file-name "rime-bopomofo-checkout")
430 "1ip1pbfb1hadf2mcymr5939iagf25ywfl67d9198jahzyr6rdyvc"))))
435 (url "https://github.com/rime/rime-cangjie.git")
436 (commit "5fd8ce6f64039e505ca02655a621f2e830b97c19")))
437 (file-name "rime-cangjie-checkout")
440 "1gf6r0q593ixar6v0jyvs56cik2gjp7pf9v799rfd2yydyia3bfg"))))
445 (url "https://github.com/rime/rime-combo-pinyin.git")
446 (commit "9bd952b964e9744e5d18e9e31625b50f3585a2cb")))
447 (file-name "rime-combo-pinyin-checkout")
450 "0crafjs39x4j221gb34mxxh3cdpxfhhx3nfw6b6bgkzlrp35a02b"))))
451 ("rime-double-pinyin"
455 (url "https://github.com/rime/rime-double-pinyin.git")
456 (commit "69bf85d4dfe8bac139c36abbd68d530b8b6622ea")))
457 (file-name "rime-double-pinyin-checkout")
460 "093wif5avvvw45fqbwj5wkbxrychy4pagl4mwsmbrayc8jkp69ak"))))
465 (url "https://github.com/rime/rime-emoji.git")
466 (commit "c8d67f9b50bf89a10c57da646d2e6db8799aef38")))
467 (file-name "rime-emoji-checkout")
470 "0ngcm088iyyp3llxvv0m80i7n5928d6cgh256ikhn3ixallxxdxv"))))
475 (url "https://github.com/rime/rime-essay.git")
476 (commit "71d0b1f3d4f3bfe61ae07581edf07579740c4421")))
477 (file-name "rime-essay-checkout")
480 "1iwz104k7zfk7lpa257kvpqdr6jhbg3p76n3644ywiz4l7kc678i"))))
485 (url "https://github.com/rime/rime-ipa.git")
486 (commit "e420c7bfb07153a2d2484eb2bdccdd719811abbb")))
487 (file-name "rime-ipa-checkout")
490 "1wfv7lb4y61b3qic5mhw92rn46cckldd9wrkcq03mg5512mbw63z"))))
495 (url "https://github.com/rime/rime-jyutping.git")
496 (commit "04891a298319888e8c6b1a20e0fa81cfaea01264")))
497 (file-name "rime-jyutping-checkout")
500 "0wsj965khglz36cnvfm4fkv386xvxhmsxgcw88p5qi0b3wlbzzx6"))))
505 (url "https://github.com/rime/rime-luna-pinyin.git")
506 (commit "c9c405566177cb3898bdb82d7f4157587f2d9c01")))
507 (file-name "rime-luna-pinyin-checkout")
510 "0i7f2675lvj9pzwlm8550ifnr3xqi77xlyyvml1wpxpkfqhjr475"))))
511 ("rime-middle-chinese"
515 (url "https://github.com/rime/rime-middle-chinese.git")
516 (commit "ed6d44f8d0bedf6e0c1c3183a270f8f01a211a40")))
517 (file-name "rime-middle-chinese-checkout")
520 "09mql88lsrxa99pyllby5z22kaiwwa037ha8gwaxjnnlsjgvz7zx"))))
525 (url "https://github.com/rime/rime-pinyin-simp.git")
526 (commit "bb5a6dfa871669d2f451b477bfff6d131df6f6c6")))
527 (file-name "rime-pinyin-simp-checkout")
530 "0ss82042k833w5q72h72ghcfchkx00nx6l4z4fb861s2rxr0bkjd"))))
535 (url "https://github.com/rime/rime-prelude.git")
536 (commit "8a52b4f86a59f3eb602f9a4cf6a680a67c15df8c")))
537 (file-name "rime-prelude-checkout")
540 "039fr3996vfxzn2milaq1f5fw08f6zgjsxsql6cfhsc5b55fidm7"))))
545 (url "https://github.com/rime/rime-quick.git")
546 (commit "3fe5911ba608cb2df1b6301b76ad1573bd482a76")))
547 (file-name "rime-quick-checkout")
550 "08bh87ym5qvw55lyw20l3m7jd4c2z5rvil8h5q8790r7z6j6ijy9"))))
555 (url "https://github.com/rime/rime-scj.git")
556 (commit "cab5a0858765eff0553dd685a2d61d5536e9149c")))
557 (file-name "rime-scj-checkout")
560 "0ard2bjp4896a8dimmcwyjwgmp9kl4rz92yc92jnd3y4rgwl6fvk"))))
565 (url "https://github.com/rime/rime-soutzoe.git")
566 (commit "beeaeca72d8e17dfd1e9af58680439e9012987dc")))
567 (file-name "rime-soutzoe-checkout")
570 "0jyqx0q9s0qxn168l5n8zav8jcl2g5ppr7pa8jm1vwrllf20slcc"))))
575 (url "https://github.com/rime/rime-stenotype.git")
576 (commit "1d472097c32d943d1096644f4c31f28799a17bd8")))
577 (file-name "rime-stenotype-checkout")
580 "1dy9qlbyhnshq2k1vcvkqn2624r96iaixhyrx1z7v0vz84fjf6y4"))))
585 (url "https://github.com/rime/rime-stroke.git")
586 (commit "f802735392b378fb2a56a9b7b53b8ec96a30ccaf")))
587 (file-name "rime-stroke-checkout")
590 "1wlrsskxhldh8369n771gk7sxflzdx0c9qhq1mqm5hhkwc5ig1j0"))))
595 (url "https://github.com/rime/rime-terra-pinyin.git")
596 (commit "b9e0edd3182e74b26b03a278c038e669ca538a35")))
597 (file-name "rime-terra-pinyin-checkout")
600 "1vzrv2k178bii4ld9rvpdi8zmcwybd8bks0qzjx2v4kbjgwj28zk"))))
605 (url "https://github.com/rime/rime-wubi.git")
606 (commit "dd052ee158a38cb791755318b1aef9b4a3ed0316")))
607 (file-name "rime-wubi-checkout")
610 "00xzv3sbwqh2jz4i7s315h7rw17qa2dgj7kflyy3blxk0s2cqiqa"))))
615 (url "https://github.com/rime/rime-wugniu.git")
616 (commit "abd1ee98efbf170258fcf43875c21a4259e00b61")))
617 (file-name "rime-wugniu-checkout")
620 "0qn54d3cclny106ixdw08r5n6wn52ffs1hgrma3k0j4pv0kr9nlq"))))))
621 (home-page "https://rime.im/")
622 (synopsis "Schema data of Rime Input Method Engine")
623 (description "@dfn{rime-data} provides the schema data of Rime Input
627 (define-public ibus-rime
635 (url "https://github.com/rime/ibus-rime.git")
637 (file-name (git-file-name name version))
639 (base32 "12y6jdz1amhgrnqa7zjim63dfsz6zyxyahbirfan37wmcfp6gp1d"))))
640 (build-system gnu-build-system)
642 `(#:tests? #f ; no tests
643 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
645 (modify-phases %standard-phases
646 (add-after 'unpack 'patch-source
647 (lambda* (#:key inputs outputs #:allow-other-keys)
648 ;; Define RIME_DATA_DIR. It's required but not used by the code.
649 (substitute* "Makefile"
651 (string-append "cmake -DRIME_DATA_DIR="
652 (assoc-ref inputs "rime-data")
653 "/share/rime-data")))
654 ;; rime_config.h defines the actual data directory.
655 (substitute* "rime_config.h"
656 (("^#define IBUS_RIME_INSTALL_PREFIX .*$")
657 (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
658 (assoc-ref outputs "out")
660 (("^#define IBUS_RIME_SHARED_DATA_DIR .*$")
661 (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
662 (assoc-ref inputs "rime-data")
663 "/share/rime-data\"\n")))
665 (add-after 'unpack 'fix-file-names
666 (lambda* (#:key outputs #:allow-other-keys)
667 ;; IBus uses the component file rime.xml to start the Rime
668 ;; engine. It must be patched with appropriate file names.
669 (substitute* "rime.xml"
670 (("/usr") (assoc-ref outputs "out")))
672 (delete 'configure))))
674 `(("gdk-pixbuf" ,gdk-pixbuf)
677 ("libnotify" ,libnotify)
679 ("rime-data" ,rime-data)))
681 `(("cmake" ,cmake-minimal)
682 ("pkg-config" ,pkg-config)))
683 (home-page "https://rime.im/")
684 (synopsis "Rime Input Method Engine for IBus")
685 (description "@dfn{ibus-rime} provides the Rime input method engine for
686 IBus. Rime is a lightweight, extensible input method engine supporting
687 various input schemas including glyph-based input methods, romanization-based
688 input methods as well as those for Chinese dialects. It has the ability to
689 compose phrases and sentences intelligently and provide very accurate
690 traditional Chinese output.")
693 (define-public libhangul
700 (uri (string-append "http://kldp.net/hangul/release/"
701 "3442-libhangul-" version ".tar.gz"))
704 "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar"))))
705 (build-system gnu-build-system)
706 (home-page "https://github.com/libhangul/libhangul")
707 (synopsis "Library to support hangul input method logic")
709 "This package provides a library to support hangul input method logic,
710 hanja dictionary and small hangul character classification.")
713 (define-public ibus-libhangul
715 (name "ibus-libhangul")
720 (uri (string-append "https://github.com/libhangul/ibus-hangul/"
721 "releases/download/" version
722 "/ibus-hangul-" version ".tar.gz"))
725 "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy"))))
726 (build-system gnu-build-system)
729 (modify-phases %standard-phases
730 (add-after 'install 'wrap
731 (lambda* (#:key inputs outputs #:allow-other-keys)
732 (wrap-program (string-append (assoc-ref outputs "out")
733 "/libexec/ibus-setup-hangul")
734 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
735 `("LD_LIBRARY_PATH" ":" prefix
736 (,(string-append (assoc-ref inputs "libhangul") "/lib")))
737 `("GI_TYPELIB_PATH" ":" prefix
738 (,(getenv "GI_TYPELIB_PATH"))))
741 `(("pkg-config" ,pkg-config)
742 ("gettext" ,gettext-minimal)
743 ("glib:bin" ,glib "bin")))
747 ("python-pygobject" ,python-pygobject)
749 ("libhangul" ,libhangul)
751 (home-page "https://github.com/libhangul/ibus-hangul")
752 (synopsis "Hangul engine for IBus")
754 "ibus-hangul is a Korean input method engine for IBus.")