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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages ibus)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system glib-or-gtk)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages anthy)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages freedesktop)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gnome)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages iso-codes)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages xorg))
50 (uri (string-append "https://github.com/ibus/ibus/"
52 version "/ibus-" version ".tar.gz"))
55 "06fj7lawww5d5w73pk249191lvmpz7shlxfxia74bjkpb42shiq3"))))
56 (build-system glib-or-gtk-build-system)
58 `(#:tests? #f ; tests fail because there's no connection to dbus
59 #:configure-flags '("--disable-emoji-dict" ; cannot find emoji.json path
63 (string-append "pyoverridesdir="
64 (assoc-ref %outputs "out")
65 "/lib/python2.7/site-packages/gi/overrides/")
66 (string-append "py2overridesdir="
67 (assoc-ref %outputs "out")
68 "/lib/python2.7/site-packages/gi/overrides/"))
70 (modify-phases %standard-phases
71 (add-before 'configure 'disable-dconf-update
73 (substitute* "data/dconf/Makefile.in"
74 (("dconf update") "echo dconf update"))
76 (add-after 'unpack 'delete-generated-files
78 (for-each (lambda (file)
79 (let ((c (string-append (string-drop-right file 4) "c")))
80 (when (file-exists? c)
81 (format #t "deleting ~a\n" c)
83 (find-files "." "\\.vala"))
85 (add-after 'unpack 'fix-paths
86 (lambda* (#:key inputs #:allow-other-keys)
87 (substitute* "src/ibusenginesimple.c"
88 (("/usr/share/X11/locale")
89 (string-append (assoc-ref inputs "libx11")
90 "/share/X11/locale")))
91 (substitute* "ui/gtk3/xkblayout.vala"
92 (("\"(setxkbmap|xmodmap)\"" _ prog)
93 (string-append "\"" (assoc-ref inputs prog) "\"")))
95 (add-after 'wrap-program 'wrap-with-additional-paths
96 (lambda* (#:key outputs #:allow-other-keys)
97 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
99 (let ((out (assoc-ref outputs "out")))
100 (wrap-program (string-append out "/bin/ibus-setup")
101 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
102 `("GI_TYPELIB_PATH" ":" prefix
103 (,(getenv "GI_TYPELIB_PATH")
104 ,(string-append out "/lib/girepository-1.0")))))
112 ("intltool" ,intltool)
113 ("json-glib" ,json-glib)
114 ("libnotify" ,libnotify)
116 ("setxkbmap" ,setxkbmap)
119 ("iso-codes" ,iso-codes)
120 ("pygobject2" ,python2-pygobject)
121 ("python2" ,python-2)))
123 `(("glib" ,glib "bin") ; for glib-genmarshal
124 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
126 ("pkg-config" ,pkg-config)))
128 (list (search-path-specification
129 (variable "IBUS_COMPONENT_PATH")
130 (files '("share/ibus/component")))))
131 (synopsis "Input method framework")
133 "IBus is an input framework providing a full-featured and user-friendly
134 input method user interface. It comes with multilingual input support. It
135 may also simplify input method development.")
136 (home-page "https://github.com/ibus/ibus/wiki")
139 (define-public ibus-libpinyin
141 (name "ibus-libpinyin")
145 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
146 "releases/download/" version
147 "/ibus-libpinyin-" version ".tar.gz"))
150 "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
151 (build-system glib-or-gtk-build-system)
154 (modify-phases %standard-phases
155 (add-after 'wrap-program 'wrap-with-additional-paths
156 (lambda* (#:key inputs outputs #:allow-other-keys)
157 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
158 ;; PYTHONPATH and GI_TYPELIB_PATH.
159 (let ((out (assoc-ref outputs "out")))
160 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
161 `("PYTHONPATH" ":" prefix
162 (,(getenv "PYTHONPATH")
163 ,(string-append (assoc-ref inputs "ibus")
164 "/lib/girepository-1.0")))
165 `("GI_TYPELIB_PATH" ":" prefix
166 (,(string-append (assoc-ref inputs "ibus")
167 "/lib/girepository-1.0"))))
171 ("libpinyin" ,libpinyin)
175 ("pyxdg" ,python-pyxdg)
178 `(("pkg-config" ,pkg-config)
179 ("intltool" ,intltool)
180 ("glib" ,glib "bin")))
181 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
183 "This package includes a Chinese pinyin input method and a Chinese
184 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
185 (home-page "https://github.com/libpinyin/ibus-libpinyin")
188 (define-public libpinyin
194 (uri (string-append "https://github.com/libpinyin/libpinyin/"
195 "releases/download/" version
196 "/libpinyin-2.2.0.tar.gz"))
199 "1c4wxvcvjxvk23mcwqvsfsv4nhimx4kpjhabxa28gx1ih10l88gj"))))
200 (build-system gnu-build-system)
205 `(("pkg-config" ,pkg-config)))
206 (synopsis "Library to handle Chinese pinyin")
208 "The libpinyin C++ library provides algorithms needed for sentence-based
209 Chinese pinyin input methods.")
210 (home-page "https://github.com/libpinyin/libpinyin")
213 (define-public ibus-anthy
220 "https://github.com/ibus/ibus-anthy/releases/download/"
221 version "/ibus-anthy-" version ".tar.gz"))
224 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
225 (build-system gnu-build-system)
228 ;; Use absolute exec path in the anthy.xml.
229 (list (string-append "--libexecdir=" %output "/libexec"))
231 (modify-phases %standard-phases
232 (add-after 'install 'wrap-programs
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let ((out (assoc-ref outputs "out")))
237 (wrap-program (string-append out "/libexec/" prog)
238 `("PYTHONPATH" ":" prefix
239 (,(getenv "PYTHONPATH")))
240 `("GI_TYPELIB_PATH" ":" prefix
241 (,(getenv "GI_TYPELIB_PATH")
242 ,(string-append out "/lib/girepository-1.0")))))
243 '("ibus-engine-anthy" "ibus-setup-anthy"))
246 `(("gettext" ,gettext-minimal)
247 ("intltool" ,intltool)
248 ("pkg-config" ,pkg-config)
254 ("gobject-introspection" ,gobject-introspection)
255 ("python-pygobject" ,python-pygobject)))
256 (synopsis "Anthy Japanese language input method for IBus")
257 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
258 adds the Anthy Japanese language input method to IBus. Because most graphical
259 applications allow text input via IBus, installing this package will enable
260 Japanese language input in most graphical applications.")
261 (home-page "https://github.com/fujiwarat/ibus-anthy")