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 "0a94bnpm24581317hdnihwr4cniriml10p4ffgxg14xhvaccfrjb"))))
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
61 "--enable-python-library"
62 ,(string-append "--with-ucd-dir="
67 (string-append "pyoverridesdir="
68 (assoc-ref %outputs "out")
69 "/lib/python3.6/site-packages/gi/overrides/"))
71 (modify-phases %standard-phases
72 (add-after 'unpack 'prepare-ucd-dir
73 (lambda* (#:key inputs #:allow-other-keys)
75 (symlink (assoc-ref inputs "unicode-blocks") "../ucd/Blocks.txt")
76 (symlink (assoc-ref inputs "unicode-nameslist") "../ucd/NamesList.txt")
78 (add-before 'configure 'disable-dconf-update
80 (substitute* "data/dconf/Makefile.in"
81 (("dconf update") "echo dconf update"))
83 (add-after 'unpack 'delete-generated-files
85 (for-each (lambda (file)
86 (let ((c (string-append (string-drop-right file 4) "c")))
87 (when (file-exists? c)
88 (format #t "deleting ~a\n" c)
90 (find-files "." "\\.vala"))
92 (add-after 'unpack 'fix-paths
93 (lambda* (#:key inputs #:allow-other-keys)
94 (substitute* "src/ibusenginesimple.c"
95 (("/usr/share/X11/locale")
96 (string-append (assoc-ref inputs "libx11")
97 "/share/X11/locale")))
98 (substitute* "ui/gtk3/xkblayout.vala"
99 (("\"(setxkbmap|xmodmap)\"" _ prog)
100 (string-append "\"" (assoc-ref inputs prog) "\"")))
102 (add-after 'wrap-program 'wrap-with-additional-paths
103 (lambda* (#:key outputs #:allow-other-keys)
104 ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
106 (let ((out (assoc-ref outputs "out")))
107 (wrap-program (string-append out "/bin/ibus-setup")
108 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
109 `("GI_TYPELIB_PATH" ":" prefix
110 (,(getenv "GI_TYPELIB_PATH")
111 ,(string-append out "/lib/girepository-1.0")))))
119 ("intltool" ,intltool)
120 ("json-glib" ,json-glib)
121 ("libnotify" ,libnotify)
123 ("setxkbmap" ,setxkbmap)
126 ("iso-codes" ,iso-codes)
127 ("pygobject2" ,python-pygobject)
130 `(("glib" ,glib "bin") ; for glib-genmarshal
131 ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
135 (uri "https://www.unicode.org/Public/UNIDATA/NamesList.txt")
137 (base32 "0yr2h0nfqhirfi3bxl33z6cc94qqshlpgi06c25xh9754irqsgv8"))))
141 (uri "https://www.unicode.org/Public/UNIDATA/Blocks.txt")
143 (base32 "0lnh9iazikpr548bd7nkaq9r3vfljfvz0rg2462prac8qxk7ni8b"))))
145 ("pkg-config" ,pkg-config)))
147 (list (search-path-specification
148 (variable "IBUS_COMPONENT_PATH")
149 (files '("share/ibus/component")))))
150 (synopsis "Input method framework")
152 "IBus is an input framework providing a full-featured and user-friendly
153 input method user interface. It comes with multilingual input support. It
154 may also simplify input method development.")
155 (home-page "https://github.com/ibus/ibus/wiki")
158 (define-public ibus-libpinyin
160 (name "ibus-libpinyin")
164 (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
165 "releases/download/" version
166 "/ibus-libpinyin-" version ".tar.gz"))
169 "0yq8aw4lddiviag8cnik6fp52vvk8lxv6bym13a3xya84c6zii3c"))))
170 (build-system glib-or-gtk-build-system)
173 (modify-phases %standard-phases
174 (add-after 'wrap-program 'wrap-with-additional-paths
175 (lambda* (#:key inputs outputs #:allow-other-keys)
176 ;; Make sure 'ibus-setup-libpinyin' runs with the correct
177 ;; PYTHONPATH and GI_TYPELIB_PATH.
178 (let ((out (assoc-ref outputs "out")))
179 (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
180 `("PYTHONPATH" ":" prefix
181 (,(getenv "PYTHONPATH")
182 ,(string-append (assoc-ref inputs "ibus")
183 "/lib/girepository-1.0")))
184 `("GI_TYPELIB_PATH" ":" prefix
185 (,(string-append (assoc-ref inputs "ibus")
186 "/lib/girepository-1.0"))))
190 ("libpinyin" ,libpinyin)
194 ("pyxdg" ,python-pyxdg)
197 `(("pkg-config" ,pkg-config)
198 ("intltool" ,intltool)
199 ("glib" ,glib "bin")))
200 (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
202 "This package includes a Chinese pinyin input method and a Chinese
203 ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
204 (home-page "https://github.com/libpinyin/ibus-libpinyin")
207 (define-public libpinyin
213 (uri (string-append "https://github.com/libpinyin/libpinyin/"
214 "releases/download/" version
215 "/libpinyin-2.2.0.tar.gz"))
218 "1c4wxvcvjxvk23mcwqvsfsv4nhimx4kpjhabxa28gx1ih10l88gj"))))
219 (build-system gnu-build-system)
224 `(("pkg-config" ,pkg-config)))
225 (synopsis "Library to handle Chinese pinyin")
227 "The libpinyin C++ library provides algorithms needed for sentence-based
228 Chinese pinyin input methods.")
229 (home-page "https://github.com/libpinyin/libpinyin")
232 (define-public ibus-anthy
239 "https://github.com/ibus/ibus-anthy/releases/download/"
240 version "/ibus-anthy-" version ".tar.gz"))
243 "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
244 (build-system gnu-build-system)
247 ;; Use absolute exec path in the anthy.xml.
248 (list (string-append "--libexecdir=" %output "/libexec"))
250 (modify-phases %standard-phases
251 (add-after 'install 'wrap-programs
252 (lambda* (#:key outputs #:allow-other-keys)
253 (let ((out (assoc-ref outputs "out")))
256 (wrap-program (string-append out "/libexec/" prog)
257 `("PYTHONPATH" ":" prefix
258 (,(getenv "PYTHONPATH")))
259 `("GI_TYPELIB_PATH" ":" prefix
260 (,(getenv "GI_TYPELIB_PATH")
261 ,(string-append out "/lib/girepository-1.0")))))
262 '("ibus-engine-anthy" "ibus-setup-anthy"))
265 `(("gettext" ,gettext-minimal)
266 ("intltool" ,intltool)
267 ("pkg-config" ,pkg-config)
273 ("gobject-introspection" ,gobject-introspection)
274 ("python-pygobject" ,python-pygobject)))
275 (synopsis "Anthy Japanese language input method for IBus")
276 (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
277 adds the Anthy Japanese language input method to IBus. Because most graphical
278 applications allow text input via IBus, installing this package will enable
279 Japanese language input in most graphical applications.")
280 (home-page "https://github.com/fujiwarat/ibus-anthy")