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 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
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 (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 databases)
38 #:use-module (gnu packages datastructures)
39 #:use-module (gnu packages freedesktop)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages glib)
42 #:use-module (gnu packages gnome)
43 #:use-module (gnu packages gtk)
44 #:use-module (gnu packages iso-codes)
45 #:use-module (gnu packages logging)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages serialization)
49 #:use-module (gnu packages textutils)
50 #:use-module (gnu packages xorg))
58 (uri (string-append "https://github.com/ibus/ibus/"
60 version "/ibus-" version ".tar.gz"))
63 "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
64 (build-system glib-or-gtk-build-system)
66 `(#:tests? #f ; tests fail because there's no connection to dbus
67 #:configure-flags `("--disable-emoji-dict" ; cannot find emoji.json path
69 "--enable-python-library"
70 ,(string-append "--with-ucd-dir="
75 (string-append "pyoverridesdir="
76 (assoc-ref %outputs "out")
77 "/lib/python3.6/site-packages/gi/overrides/"))
79 (modify-phases %standard-phases
80 (add-after 'unpack 'prepare-ucd-dir
81 (lambda* (#:key inputs #:allow-other-keys)
83 (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
84 (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
86 (add-before 'configure 'disable-dconf-update
88 (substitute* "data/dconf/Makefile.in"
89 (("dconf update") "echo dconf update"))
91 (add-after 'unpack 'delete-generated-files
93 (for-each (lambda (file)
94 (let ((c (string-append (string-drop-right file 4) "c")))
95 (when (file-exists? c)
96 (format #t "deleting ~a\n" c)
98 (find-files "." "\\.vala"))
100 (add-after 'unpack 'fix-paths
101 (lambda* (#:key inputs #:allow-other-keys)
102 (substitute* "src/ibusenginesimple.c"
103 (("/usr/share/X11/locale")
104 (string-append (assoc-ref inputs "libx11")
105 "/share/X11/locale")))
106 (substitute* "ui/gtk3/xkblayout.vala"
107 (("\"(setxkbmap|xmodmap)\"" _ prog)
108 (string-append "\"" (assoc-ref inputs prog) "\"")))
110 (add-after 'wrap-program 'wrap-with-additional-paths
111 (lambda* (#:key outputs #:allow-other-keys)
112 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
114 (let ((out (assoc-ref outputs "out")))
115 (wrap-program (string-append out "/bin/ibus-setup")
116 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
117 `("GI_TYPELIB_PATH" ":" prefix
118 (,(getenv "GI_TYPELIB_PATH")
119 ,(string-append out "/lib/girepository-1.0")))))
127 ("intltool" ,intltool)
128 ("json-glib" ,json-glib)
129 ("libnotify" ,libnotify)
131 ("setxkbmap" ,setxkbmap)
134 ("iso-codes" ,iso-codes)
135 ("pygobject2" ,python-pygobject)
138 `(("glib" ,glib "bin") ; for glib-genmarshal
139 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
143 (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
145 (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
149 (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
151 (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
153 ("pkg-config" ,pkg-config)))
155 (list (search-path-specification
156 (variable "IBUS_COMPONENT_PATH")
157 (files '("share/ibus/component")))))
158 (synopsis "Input method framework")
160 "IBus is an input framework providing a full-featured and user-friendly
161 input method user interface. It comes with multilingual input support. It
162 may also simplify input method development.")
163 (home-page "https://github.com/ibus/ibus/wiki")
166 (define-public ibus-libpinyin
168 (name "ibus-libpinyin")
172 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
173 "releases/download/" version
174 "/ibus-libpinyin-" version ".tar.gz"))
177 "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
178 (build-system glib-or-gtk-build-system)
181 (modify-phases %standard-phases
182 (add-after 'wrap-program 'wrap-with-additional-paths
183 (lambda* (#:key inputs outputs #:allow-other-keys)
184 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
185 ;; PYTHONPATH and GI_TYPELIB_PATH.
186 (let ((out (assoc-ref outputs "out")))
187 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
188 `("PYTHONPATH" ":" prefix
189 (,(getenv "PYTHONPATH")
190 ,(string-append (assoc-ref inputs "ibus")
191 "/lib/girepository-1.0")))
192 `("GI_TYPELIB_PATH" ":" prefix
193 (,(string-append (assoc-ref inputs "ibus")
194 "/lib/girepository-1.0"))))
198 ("libpinyin" ,libpinyin)
202 ("pyxdg" ,python-pyxdg)
205 `(("pkg-config" ,pkg-config)
206 ("intltool" ,intltool)
207 ("glib" ,glib "bin")))
208 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
210 "This package includes a Chinese pinyin input method and a Chinese
211 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
212 (home-page "https://github.com/libpinyin/ibus-libpinyin")
215 (define-public libpinyin
221 (uri (string-append "https://github.com/libpinyin/libpinyin/"
222 "releases/download/" version
223 "/libpinyin-2.2.0.tar.gz"))
226 "1c4wxvcvjxvk23mcwqvsfsv4nhimx4kpjhabxa28gx1ih10l88gj"))))
227 (build-system gnu-build-system)
232 `(("pkg-config" ,pkg-config)))
233 (synopsis "Library to handle Chinese pinyin")
235 "The libpinyin C++ library provides algorithms needed for sentence-based
236 Chinese pinyin input methods.")
237 (home-page "https://github.com/libpinyin/libpinyin")
240 (define-public ibus-anthy
247 "https://github.com/ibus/ibus-anthy/releases/download/"
248 version "/ibus-anthy-" version ".tar.gz"))
251 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
252 (build-system gnu-build-system)
255 ;; Use absolute exec path in the anthy.xml.
256 (list (string-append "--libexecdir=" %output "/libexec"))
258 (modify-phases %standard-phases
259 (add-after 'install 'wrap-programs
260 (lambda* (#:key outputs #:allow-other-keys)
261 (let ((out (assoc-ref outputs "out")))
264 (wrap-program (string-append out "/libexec/" prog)
265 `("PYTHONPATH" ":" prefix
266 (,(getenv "PYTHONPATH")))
267 `("GI_TYPELIB_PATH" ":" prefix
268 (,(getenv "GI_TYPELIB_PATH")
269 ,(string-append out "/lib/girepository-1.0")))))
270 '("ibus-engine-anthy" "ibus-setup-anthy"))
273 `(("gettext" ,gettext-minimal)
274 ("intltool" ,intltool)
275 ("pkg-config" ,pkg-config)
281 ("gobject-introspection" ,gobject-introspection)
282 ("python-pygobject" ,python-pygobject)))
283 (synopsis "Anthy Japanese language input method for IBus")
284 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
285 adds the Anthy Japanese language input method to IBus. Because most graphical
286 applications allow text input via IBus, installing this package will enable
287 Japanese language input in most graphical applications.")
288 (home-page "https://github.com/fujiwarat/ibus-anthy")
291 (define-public librime
298 (uri (string-append "https://github.com/rime/" name
299 "/archive/" version ".tar.gz"))
300 (file-name (string-append name "-" version ".tar.gz"))
302 (base32 "0qh0hy8bvj17bnzaxk0bmv4gsnbsd6jx8csr84936xmhkrysdday"))))
303 (build-system cmake-build-system)
310 ("yaml-cpp" ,yaml-cpp)))
311 (home-page "https://rime.im/")
312 (synopsis "The core library of Rime Input Method Engine")
313 (description "@dfn{librime} is the core library of Rime Input Method
314 Engine, which is a lightweight, extensible input method engine supporting
315 various input schemas including glyph-based input methods, romanization-based
316 input methods as well as those for Chinese dialects. It has the ability to
317 compose phrases and sentences intelligently and provide very accurate
318 traditional Chinese output.")
321 (define-public rime-data
324 (version "0.38.20181029")
329 (url "https://github.com/rime/plum.git")
330 (commit "fb4f829da2007f2dbb37d60a79bc67c25ea16568")))
331 (file-name "plum-checkout")
333 (base32 "1m1wiv9j5bay4saga58c7dj4h8gqivsbyp16y245ifvxvp9czj67"))))
334 (build-system gnu-build-system)
336 `(#:tests? #f ; no tests
337 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
340 (modify-phases %standard-phases
341 (add-after 'unpack 'patch-source
343 ;; Set .DEFAULT_GOAL to `all'.
344 ;; Don't build binary schemas. The output is not deterministic.
345 (substitute* "Makefile"
346 (("^\\.DEFAULT_GOAL := preset")
347 ".DEFAULT_GOAL := all"))
349 ;; Add schema packages into "package/rime" directory.
350 (add-after 'unpack 'add-packages
351 (lambda* (#:key inputs #:allow-other-keys)
352 (let* ((dest-dir "package/rime"))
354 (for-each (lambda (pkg)
355 (symlink (assoc-ref inputs pkg)
356 (string-append dest-dir "/" pkg)))
379 (delete 'configure))))
385 (url "https://github.com/rime/rime-array.git")
386 (commit "906e923902147584b0b0247028a782abbfbfd8a0")))
387 (file-name "rime-array-checkout")
390 "1alk6ghn4ji4kvp7lfm57bwm2gjh99i79r0w9naz6wkdim8idvb1"))))
395 (url "https://github.com/rime/rime-bopomofo.git")
396 (commit "8dc44ca1b6ef4e45b452e070b9da737f5da165e3")))
397 (file-name "rime-bopomofo-checkout")
400 "16k6wfhcrw3a77rmbrp21ca0gmsmb3f68s193c1cfwr8i68k46nf"))))
405 (url "https://github.com/rime/rime-cangjie.git")
406 (commit "ab085e90856b3399b374dc3c8b4cb40d11f307a8")))
407 (file-name "rime-cangjie-checkout")
410 "11fgj0rbv9nyzfijwm2l8pm8fznhif4h27ndrrcaaylkp7p5zsx2"))))
415 (url "https://github.com/rime/rime-combo-pinyin.git")
416 (commit "f1bae63f20504f2b8113c5cbdf2700e858aa91eb")))
417 (file-name "rime-combo-pinyin-checkout")
420 "1l1079akwm1hw4kkn0q6x9fpylnl2ka6z2fn7lmdpfpsr0xgn0n7"))))
425 (url "https://github.com/rime/rime-double-pinyin.git")
426 (commit "2101a5cd40e511ec38835769aa66d2dddf059c2e")))
427 (file-name "rime-double-pinyin-checkout")
430 "19hh2qm0njbfk2js678hfm2hw9b796s43vs11yy3m1v9m0gk2vi7"))))
435 (url "https://github.com/rime/rime-emoji.git")
436 (commit "6e6611b315f03ee4c33f958f9dbe960b13a0ed19")))
437 (file-name "rime-emoji-checkout")
440 "1brfs3214w36j3345di9ygp468hbvbqdqpkjxxs1dbp437rayhyy"))))
445 (url "https://github.com/rime/rime-essay.git")
446 (commit "5e5c7a0ef41c9b030abdad81a9df07b56b1661e9")))
447 (file-name "rime-essay-checkout")
450 "0ana9is0zhh79m4gjshvmaxbrg3jiqysydx5bpm151i7i6vw5y1i"))))
455 (url "https://github.com/rime/rime-ipa.git")
456 (commit "02a9e2c181921a2e95e1a81f88188c41132755c3")))
457 (file-name "rime-ipa-checkout")
460 "1szrxgvqlgmxapj2aflw2cvbv0p6pl0sw0gyxa13dvdhhf7s9rvr"))))
465 (url "https://github.com/rime/rime-jyutping.git")
466 (commit "1402ec3d6cc0973f952fe3f9ef531294e4ffe9e0")))
467 (file-name "rime-jyutping-checkout")
470 "17g03dy4gw6vyc9da1wjn3iy9hx64dfnwiwsfc7bkzan22x2m4dv"))))
475 (url "https://github.com/rime/rime-luna-pinyin.git")
476 (commit "3b05132576f5c347ff8a70857d2dae080936ac3b")))
477 (file-name "rime-luna-pinyin-checkout")
480 "0kgnpxjn10dm2d9718r12rdjlwqd2s2h84jvkhxhh5v0dkv1anl2"))))
485 (url "https://github.com/rime/rime-middle-chinese.git")
486 (commit "9ba8d70330654b9a730f882d35cfad7dbeddfd75")))
487 (file-name "rime-middle-chinese-checkout")
490 "0hwg5zby5kphh0bcfay8mfxwr5bwqhamiw3cmmmf7kp9fbns5s23"))))
495 (url "https://github.com/rime/rime-pinyin-simp.git")
496 (commit "74357ffd62c05fb60edf6eab5b86bc8c8c1907d0")))
497 (file-name "rime-pinyin-simp-checkout")
500 "1paw3c7pv5bl54abnp9pidfxrkchdacyxy5m9zb311p5sgm7fhxh"))))
505 (url "https://github.com/rime/rime-prelude.git")
506 (commit "33040568c3ddb2ee6340c9b669494317db21b77c")))
507 (file-name "rime-prelude-checkout")
510 "1gwcasyyg6f0ib6s4qsrrjcqr1lcs7j3xqxl65rznsw44nhnbwwq"))))
515 (url "https://github.com/rime/rime-quick.git")
516 (commit "910a97d403ad8e72f322488da146da79c19d623f")))
517 (file-name "rime-quick-checkout")
520 "0yrq3gbfmm29xlr52rmxc41mqfrb0295q7sdhbc3ax71677mpr0y"))))
525 (url "https://github.com/rime/rime-scj.git")
526 (commit "e0eae889f4376d2a434ac3b38523e0da7400db68")))
527 (file-name "rime-scj-checkout")
530 "1whnv9zs349kvy0zi7dnmpqwil8i6gqwrzvhy3qdrjzy58y6gwxn"))))
535 (url "https://github.com/rime/rime-soutzoe.git")
536 (commit "e47841a8ad6341731c41cdb814b7a25c837603c4")))
537 (file-name "rime-soutzoe-checkout")
540 "1rgpmkxa72jy6gyy44fn8azpk3amk9s9lrdf7za03nv95d0fvm0p"))))
545 (url "https://github.com/rime/rime-stenotype.git")
546 (commit "d4ff379314fd95283853d1734854979cf3cbd287")))
547 (file-name "rime-stenotype-checkout")
550 "1kckpi4l4884hvydr3d6vid3v7rsc1app29kmk7v8jf8vn16afhl"))))
555 (url "https://github.com/rime/rime-stroke.git")
556 (commit "cfd29c675c46cf70b7a7f0a3836a913059316a0a")))
557 (file-name "rime-stroke-checkout")
560 "135is9c1p4lm98fd9l1gxyflkm69cv5an129ka7sk614bq84m08d"))))
565 (url "https://github.com/rime/rime-terra-pinyin.git")
566 (commit "15b5c73a796571cd6f9ef6c89f96656cb9df86f9")))
567 (file-name "rime-terra-pinyin-checkout")
570 "1xsd84h1zw417h5hr4dbgyk5009zi7q2p9774w3ccr5sxgc3i3cm"))))
575 (url "https://github.com/rime/rime-wubi.git")
576 (commit "d44403728a0b1cd8b47cb1f81b83f58e5f790b74")))
577 (file-name "rime-wubi-checkout")
580 "0ld31bdn94lncxd1ka44w4sbl03skh08mc927dhdmwq5bpvrgn36"))))
585 (url "https://github.com/rime/rime-wugniu.git")
586 (commit "65bcc354ada3839591d7546a64c71dbdd0592b02")))
587 (file-name "rime-wugniu-checkout")
590 "0g31awp40s778sp5c290x40s8np86n8aw011s17sslxrqhhb0bkx"))))))
591 (home-page "https://rime.im/")
592 (synopsis "Schema data of Rime Input Method Engine")
593 (description "@dfn{rime-data} provides the schema data of Rime Input