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 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018, 2019 Meiyo Peng <meiyo@disroot.org>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 (guix utils)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages anthy)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages boost)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages cmake)
40 #:use-module (gnu packages databases)
41 #:use-module (gnu packages datastructures)
42 #:use-module (gnu packages dbm)
43 #:use-module (gnu packages freedesktop)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnome)
47 #:use-module (gnu packages gtk)
48 #:use-module (gnu packages iso-codes)
49 #:use-module (gnu packages logging)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages serialization)
53 #:use-module (gnu packages sqlite)
54 #:use-module (gnu packages textutils)
55 #:use-module (gnu packages xorg))
63 (uri (string-append "https://github.com/ibus/ibus/"
65 version "/ibus-" version ".tar.gz"))
68 "0d6hcbw6ai91jl87lqnyn8bxi5y5kba5i9nz7knknyh69g5fbwac"))))
69 (build-system glib-or-gtk-build-system)
71 `(#:tests? #f ; tests fail because there's no connection to dbus
72 #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
73 "--enable-python-library"
74 ,(string-append "--with-ucd-dir="
78 (modify-phases %standard-phases
79 (add-after 'unpack 'prepare-ucd-dir
80 (lambda* (#:key inputs #:allow-other-keys)
82 (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
83 (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
85 (add-after 'unpack 'patch-python-target-directories
86 (lambda* (#:key outputs #:allow-other-keys)
87 (let ((root (string-append (assoc-ref outputs "out")
89 ,(version-major+minor (package-version python))
91 (substitute* "configure"
92 (("(py2?overridesdir)=.*" _ var)
93 (string-append var "=" root "/gi/overrides/"))
94 (("(pkgpython2dir=).*" _ var)
95 (string-append var root "/ibus"))))
97 (add-before 'configure 'disable-dconf-update
99 (substitute* "data/dconf/Makefile.in"
100 (("dconf update") "echo dconf update"))
102 (add-after 'unpack 'delete-generated-files
104 (for-each (lambda (file)
105 (let ((c (string-append (string-drop-right file 4) "c")))
106 (when (file-exists? c)
107 (format #t "deleting ~a\n" c)
109 (find-files "." "\\.vala"))
111 (add-after 'unpack 'fix-paths
112 (lambda* (#:key inputs #:allow-other-keys)
113 (substitute* "src/ibusenginesimple.c"
114 (("/usr/share/X11/locale")
115 (string-append (assoc-ref inputs "libx11")
116 "/share/X11/locale")))
117 (substitute* "ui/gtk3/xkblayout.vala"
118 (("\"(setxkbmap|xmodmap)\"" _ prog)
119 (string-append "\"" (assoc-ref inputs prog) "\"")))
121 (add-after 'wrap-program 'wrap-with-additional-paths
122 (lambda* (#:key outputs #:allow-other-keys)
123 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
125 (let ((out (assoc-ref outputs "out")))
126 (wrap-program (string-append out "/bin/ibus-setup")
127 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
128 `("GI_TYPELIB_PATH" ":" prefix
129 (,(getenv "GI_TYPELIB_PATH")
130 ,(string-append out "/lib/girepository-1.0")))))
138 ("gettext" ,gnu-gettext)
139 ("json-glib" ,json-glib)
140 ("libnotify" ,libnotify)
142 ("setxkbmap" ,setxkbmap)
145 ("iso-codes" ,iso-codes)
146 ("pygobject2" ,python-pygobject)
149 `(("glib" ,glib "bin") ; for glib-genmarshal
150 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
152 ;; XXX TODO: Move Unicode data to its own (versioned) package.
156 (uri "https://www.unicode.org/Public/12.0.0/ucd/NamesList.txt")
158 (base32 "0vsq8gx7hws8mvxy3nlglpwxw7ky57q0fs09d7w9xgb2ylk7fz61"))))
162 (uri "https://www.unicode.org/Public/12.0.0/ucd/Blocks.txt")
164 (base32 "041sk54v6rjzb23b9x7yjdwzdp2wc7gvfz7ybavgg4gbh51wm8x1"))))
166 ("pkg-config" ,pkg-config)))
168 (list (search-path-specification
169 (variable "IBUS_COMPONENT_PATH")
170 (files '("share/ibus/component")))))
171 (synopsis "Input method framework")
173 "IBus is an input framework providing a full-featured and user-friendly
174 input method user interface. It comes with multilingual input support. It
175 may also simplify input method development.")
176 (home-page "https://github.com/ibus/ibus/wiki")
179 (define-public ibus-libpinyin
181 (name "ibus-libpinyin")
185 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
186 "releases/download/" version
187 "/ibus-libpinyin-" version ".tar.gz"))
190 "1sypbr5n96sf7mgqhxrwbawdmszgb6yi28iqkmfmb8xr93pwq7fq"))))
191 (build-system glib-or-gtk-build-system)
194 (modify-phases %standard-phases
195 (add-after 'wrap-program 'wrap-with-additional-paths
196 (lambda* (#:key inputs outputs #:allow-other-keys)
197 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
198 ;; PYTHONPATH and GI_TYPELIB_PATH.
199 (let ((out (assoc-ref outputs "out")))
200 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
201 `("PYTHONPATH" ":" prefix
202 (,(getenv "PYTHONPATH")
203 ,(string-append (assoc-ref inputs "ibus")
204 "/lib/girepository-1.0")))
205 `("GI_TYPELIB_PATH" ":" prefix
206 (,(string-append (assoc-ref inputs "ibus")
207 "/lib/girepository-1.0"))))
211 ("libpinyin" ,libpinyin)
215 ("pyxdg" ,python-pyxdg)
216 ("pygobject2" ,python-pygobject)
219 `(("pkg-config" ,pkg-config)
220 ("intltool" ,intltool)
221 ("glib" ,glib "bin")))
222 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
224 "This package includes a Chinese pinyin input method and a Chinese
225 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
226 (home-page "https://github.com/libpinyin/ibus-libpinyin")
229 (define-public libpinyin
235 (uri (string-append "https://github.com/libpinyin/libpinyin/"
236 "releases/download/" version
237 "/libpinyin-" version ".tar.gz"))
240 "14969v6w8n1aiqphl2386dws7dmsdwbzyqnlz4kr8ppm39m9rp5k"))))
241 (build-system gnu-build-system)
246 `(("pkg-config" ,pkg-config)))
247 (synopsis "Library to handle Chinese pinyin")
249 "The libpinyin C++ library provides algorithms needed for sentence-based
250 Chinese pinyin input methods.")
251 (home-page "https://github.com/libpinyin/libpinyin")
254 (define-public ibus-anthy
261 "https://github.com/ibus/ibus-anthy/releases/download/"
262 version "/ibus-anthy-" version ".tar.gz"))
265 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
266 (build-system gnu-build-system)
269 ;; Use absolute exec path in the anthy.xml.
270 (list (string-append "--libexecdir=" %output "/libexec"))
272 (modify-phases %standard-phases
273 (add-after 'install 'wrap-programs
274 (lambda* (#:key outputs #:allow-other-keys)
275 (let ((out (assoc-ref outputs "out")))
278 (wrap-program (string-append out "/libexec/" prog)
279 `("PYTHONPATH" ":" prefix
280 (,(getenv "PYTHONPATH")))
281 `("GI_TYPELIB_PATH" ":" prefix
282 (,(getenv "GI_TYPELIB_PATH")
283 ,(string-append out "/lib/girepository-1.0")))))
284 '("ibus-engine-anthy" "ibus-setup-anthy"))
287 `(("gettext" ,gettext-minimal)
288 ("intltool" ,intltool)
289 ("pkg-config" ,pkg-config)
295 ("gobject-introspection" ,gobject-introspection)
296 ("python-pygobject" ,python-pygobject)))
297 (synopsis "Anthy Japanese language input method for IBus")
298 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
299 adds the Anthy Japanese language input method to IBus. Because most graphical
300 applications allow text input via IBus, installing this package will enable
301 Japanese language input in most graphical applications.")
302 (home-page "https://github.com/fujiwarat/ibus-anthy")
305 (define-public librime
313 (url "https://github.com/rime/librime.git")
315 (file-name (git-file-name name version))
318 "0xskhdhk7dgpc71r39pfzxi5vrlzy90aqj1gzv8nnapq91p2awhv"))
319 (modules '((guix build utils)))
322 (delete-file-recursively "thirdparty/src")
323 (delete-file-recursively "thirdparty/bin")
324 (delete-file-recursively "thirdparty/include/X11")
326 (build-system cmake-build-system)
329 (modify-phases %standard-phases
330 (add-after 'unpack 'patch-source
332 (substitute* "CMakeLists.txt"
333 (("include_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/include\\)") "")
334 (("link_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/lib\\)") ""))
342 ("yaml-cpp" ,yaml-cpp)))
344 `(("googletest" ,googletest)
345 ("xorgproto" ,xorgproto))) ; keysym.h
346 (home-page "https://rime.im/")
347 (synopsis "The core library of Rime Input Method Engine")
348 (description "@dfn{librime} is the core library of Rime Input Method
349 Engine, which is a lightweight, extensible input method engine supporting
350 various input schemas including glyph-based input methods, romanization-based
351 input methods as well as those for Chinese dialects. It has the ability to
352 compose phrases and sentences intelligently and provide very accurate
353 traditional Chinese output.")
356 (define-public rime-data
359 (version "0.38.20190131")
364 (url "https://github.com/rime/plum.git")
365 (commit "8b48688cd4610d0c9223eb68831a31b6134e4cc8")))
366 (file-name "plum-checkout")
368 (base32 "0fv3hv4av9y7afxijh1n8idnyf82v9rxxi2ypmxd7lkj4naa22qh"))))
369 (build-system gnu-build-system)
371 `(#:tests? #f ; no tests
372 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
375 (modify-phases %standard-phases
376 (add-after 'unpack 'patch-source
378 ;; Set .DEFAULT_GOAL to `all'.
379 ;; Don't build binary schemas. The output is not deterministic.
380 (substitute* "Makefile"
381 (("^\\.DEFAULT_GOAL := preset")
382 ".DEFAULT_GOAL := all"))
384 ;; Add schema packages into "package/rime" directory.
385 (add-after 'unpack 'add-packages
386 (lambda* (#:key inputs #:allow-other-keys)
387 (let* ((dest-dir "package/rime"))
389 (for-each (lambda (pkg)
390 (symlink (assoc-ref inputs
391 (string-append "rime-" pkg))
392 (string-append dest-dir "/" pkg)))
415 (delete 'configure))))
421 (url "https://github.com/rime/rime-array.git")
422 (commit "93cc99238f120606a076220ec4ddcad164f6396a")))
423 (file-name "rime-array-checkout")
426 "06yxrv3x702751jvx46rfw3ix34jk7jh183rz6bllznzi7lxz7sz"))))
431 (url "https://github.com/rime/rime-bopomofo.git")
432 (commit "ed25098386f5efd3d70b08650f0d1b70c41c11a3")))
433 (file-name "rime-bopomofo-checkout")
436 "1ip1pbfb1hadf2mcymr5939iagf25ywfl67d9198jahzyr6rdyvc"))))
441 (url "https://github.com/rime/rime-cangjie.git")
442 (commit "5fd8ce6f64039e505ca02655a621f2e830b97c19")))
443 (file-name "rime-cangjie-checkout")
446 "1gf6r0q593ixar6v0jyvs56cik2gjp7pf9v799rfd2yydyia3bfg"))))
451 (url "https://github.com/rime/rime-combo-pinyin.git")
452 (commit "9bd952b964e9744e5d18e9e31625b50f3585a2cb")))
453 (file-name "rime-combo-pinyin-checkout")
456 "0crafjs39x4j221gb34mxxh3cdpxfhhx3nfw6b6bgkzlrp35a02b"))))
457 ("rime-double-pinyin"
461 (url "https://github.com/rime/rime-double-pinyin.git")
462 (commit "69bf85d4dfe8bac139c36abbd68d530b8b6622ea")))
463 (file-name "rime-double-pinyin-checkout")
466 "093wif5avvvw45fqbwj5wkbxrychy4pagl4mwsmbrayc8jkp69ak"))))
471 (url "https://github.com/rime/rime-emoji.git")
472 (commit "c8d67f9b50bf89a10c57da646d2e6db8799aef38")))
473 (file-name "rime-emoji-checkout")
476 "0ngcm088iyyp3llxvv0m80i7n5928d6cgh256ikhn3ixallxxdxv"))))
481 (url "https://github.com/rime/rime-essay.git")
482 (commit "71d0b1f3d4f3bfe61ae07581edf07579740c4421")))
483 (file-name "rime-essay-checkout")
486 "1iwz104k7zfk7lpa257kvpqdr6jhbg3p76n3644ywiz4l7kc678i"))))
491 (url "https://github.com/rime/rime-ipa.git")
492 (commit "e420c7bfb07153a2d2484eb2bdccdd719811abbb")))
493 (file-name "rime-ipa-checkout")
496 "1wfv7lb4y61b3qic5mhw92rn46cckldd9wrkcq03mg5512mbw63z"))))
501 (url "https://github.com/rime/rime-jyutping.git")
502 (commit "04891a298319888e8c6b1a20e0fa81cfaea01264")))
503 (file-name "rime-jyutping-checkout")
506 "0wsj965khglz36cnvfm4fkv386xvxhmsxgcw88p5qi0b3wlbzzx6"))))
511 (url "https://github.com/rime/rime-luna-pinyin.git")
512 (commit "c9c405566177cb3898bdb82d7f4157587f2d9c01")))
513 (file-name "rime-luna-pinyin-checkout")
516 "0i7f2675lvj9pzwlm8550ifnr3xqi77xlyyvml1wpxpkfqhjr475"))))
517 ("rime-middle-chinese"
521 (url "https://github.com/rime/rime-middle-chinese.git")
522 (commit "ed6d44f8d0bedf6e0c1c3183a270f8f01a211a40")))
523 (file-name "rime-middle-chinese-checkout")
526 "09mql88lsrxa99pyllby5z22kaiwwa037ha8gwaxjnnlsjgvz7zx"))))
531 (url "https://github.com/rime/rime-pinyin-simp.git")
532 (commit "bb5a6dfa871669d2f451b477bfff6d131df6f6c6")))
533 (file-name "rime-pinyin-simp-checkout")
536 "0ss82042k833w5q72h72ghcfchkx00nx6l4z4fb861s2rxr0bkjd"))))
541 (url "https://github.com/rime/rime-prelude.git")
542 (commit "8a52b4f86a59f3eb602f9a4cf6a680a67c15df8c")))
543 (file-name "rime-prelude-checkout")
546 "039fr3996vfxzn2milaq1f5fw08f6zgjsxsql6cfhsc5b55fidm7"))))
551 (url "https://github.com/rime/rime-quick.git")
552 (commit "3fe5911ba608cb2df1b6301b76ad1573bd482a76")))
553 (file-name "rime-quick-checkout")
556 "08bh87ym5qvw55lyw20l3m7jd4c2z5rvil8h5q8790r7z6j6ijy9"))))
561 (url "https://github.com/rime/rime-scj.git")
562 (commit "cab5a0858765eff0553dd685a2d61d5536e9149c")))
563 (file-name "rime-scj-checkout")
566 "0ard2bjp4896a8dimmcwyjwgmp9kl4rz92yc92jnd3y4rgwl6fvk"))))
571 (url "https://github.com/rime/rime-soutzoe.git")
572 (commit "beeaeca72d8e17dfd1e9af58680439e9012987dc")))
573 (file-name "rime-soutzoe-checkout")
576 "0jyqx0q9s0qxn168l5n8zav8jcl2g5ppr7pa8jm1vwrllf20slcc"))))
581 (url "https://github.com/rime/rime-stenotype.git")
582 (commit "1d472097c32d943d1096644f4c31f28799a17bd8")))
583 (file-name "rime-stenotype-checkout")
586 "1dy9qlbyhnshq2k1vcvkqn2624r96iaixhyrx1z7v0vz84fjf6y4"))))
591 (url "https://github.com/rime/rime-stroke.git")
592 (commit "f802735392b378fb2a56a9b7b53b8ec96a30ccaf")))
593 (file-name "rime-stroke-checkout")
596 "1wlrsskxhldh8369n771gk7sxflzdx0c9qhq1mqm5hhkwc5ig1j0"))))
601 (url "https://github.com/rime/rime-terra-pinyin.git")
602 (commit "b9e0edd3182e74b26b03a278c038e669ca538a35")))
603 (file-name "rime-terra-pinyin-checkout")
606 "1vzrv2k178bii4ld9rvpdi8zmcwybd8bks0qzjx2v4kbjgwj28zk"))))
611 (url "https://github.com/rime/rime-wubi.git")
612 (commit "dd052ee158a38cb791755318b1aef9b4a3ed0316")))
613 (file-name "rime-wubi-checkout")
616 "00xzv3sbwqh2jz4i7s315h7rw17qa2dgj7kflyy3blxk0s2cqiqa"))))
621 (url "https://github.com/rime/rime-wugniu.git")
622 (commit "abd1ee98efbf170258fcf43875c21a4259e00b61")))
623 (file-name "rime-wugniu-checkout")
626 "0qn54d3cclny106ixdw08r5n6wn52ffs1hgrma3k0j4pv0kr9nlq"))))))
627 (home-page "https://rime.im/")
628 (synopsis "Schema data of Rime Input Method Engine")
629 (description "@dfn{rime-data} provides the schema data of Rime Input
633 (define-public ibus-rime
641 (url "https://github.com/rime/ibus-rime.git")
643 (file-name (git-file-name name version))
645 (base32 "12y6jdz1amhgrnqa7zjim63dfsz6zyxyahbirfan37wmcfp6gp1d"))))
646 (build-system gnu-build-system)
648 `(#:tests? #f ; no tests
649 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
651 (modify-phases %standard-phases
652 (add-after 'unpack 'patch-source
653 (lambda* (#:key inputs outputs #:allow-other-keys)
654 ;; Define RIME_DATA_DIR. It's required but not used by the code.
655 (substitute* "Makefile"
657 (string-append "cmake -DRIME_DATA_DIR="
658 (assoc-ref inputs "rime-data")
659 "/share/rime-data")))
660 ;; rime_config.h defines the actual data directory.
661 (substitute* "rime_config.h"
662 (("^#define IBUS_RIME_INSTALL_PREFIX .*$")
663 (string-append "#define IBUS_RIME_INSTALL_PREFIX \""
664 (assoc-ref outputs "out")
666 (("^#define IBUS_RIME_SHARED_DATA_DIR .*$")
667 (string-append "#define IBUS_RIME_SHARED_DATA_DIR \""
668 (assoc-ref inputs "rime-data")
669 "/share/rime-data\"\n")))
671 (delete 'configure))))
673 `(("gdk-pixbuf" ,gdk-pixbuf)
676 ("libnotify" ,libnotify)
678 ("rime-data" ,rime-data)))
680 `(("cmake" ,cmake-minimal)
681 ("pkg-config" ,pkg-config)))
682 (home-page "https://rime.im/")
683 (synopsis "Rime Input Method Engine for IBus")
684 (description "@dfn{ibus-rime} provides the Rime input method engine for
685 IBus. Rime is a lightweight, extensible input method engine supporting
686 various input schemas including glyph-based input methods, romanization-based
687 input methods as well as those for Chinese dialects. It has the ability to
688 compose phrases and sentences intelligently and provide very accurate
689 traditional Chinese output.")