1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
3 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages fcitx)
22 #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system glib-or-gtk)
28 #:use-module (guix build-system qt)
29 #:use-module (gnu packages check)
30 #:use-module (gnu packages documentation)
31 #:use-module (gnu packages enchant)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages glib)
34 #:use-module (gnu packages graphviz)
35 #:use-module (gnu packages gtk)
36 #:use-module (gnu packages icu4c)
37 #:use-module (gnu packages iso-codes)
38 #:use-module (gnu packages kde-frameworks)
39 #:use-module (gnu packages man)
40 #:use-module (gnu packages ncurses)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages qt)
44 #:use-module (gnu packages sqlite)
45 #:use-module (gnu packages web)
46 #:use-module (gnu packages xml)
47 #:use-module (gnu packages xorg)
48 #:use-module (gnu packages xdisorg))
50 (define-public fcitx-qt5
59 (url "https://github.com/fcitx/fcitx-qt5.git")
62 (git-file-name name version))
64 (base32 "1d56bp11jp85b2r4syw1clfg4vqxqfh7gygpwz8wk5sxmfmmdq83"))))
65 (build-system qt-build-system)
67 `(#:tests? #f ; No target
69 (modify-phases %standard-phases
70 (add-after 'unpack 'patch-install-dir
71 (lambda* (#:key outputs #:allow-other-keys)
72 (substitute* "quickphrase-editor/CMakeLists.txt"
73 (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
75 (assoc-ref outputs "out")
77 (substitute* "platforminputcontext/CMakeLists.txt"
78 (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
80 (assoc-ref outputs "out")
84 `(("extra-cmake-modules" ,extra-cmake-modules)
85 ("pkg-config" ,pkg-config)))
89 ("libxkbcommon" ,libxkbcommon)))
91 `(("qtbase" ,qtbase)))
92 (synopsis "Fcitx Qt5 Input Context")
93 (description "This package provides a Qt5 frontend for fcitx.")
94 (home-page "https://github.com/fcitx/fcitx-qt5/")
102 (define-public presage
110 (string-append "mirror://sourceforge/presage/presage/"
111 version "/presage-" version ".tar.gz"))
113 (base32 "0rm3b3zaf6bd7hia0lr1wyvi1rrvxkn7hg05r5r1saj0a3ingmay"))))
114 (build-system glib-or-gtk-build-system)
115 (outputs '("out" "doc"))
119 "CFLAGS=-Wno-narrowing"
120 "CXXFLAGS=-Wno-narrowing")
122 (modify-phases %standard-phases
123 (add-after 'install 'move-doc
124 (lambda* (#:key outputs #:allow-other-keys)
125 (let* ((out (assoc-ref outputs "out"))
126 (doc (assoc-ref outputs "doc")))
127 (mkdir-p (string-append doc "/share/presage"))
129 (string-append out "/share/presage/html")
130 (string-append doc "/share/presage/html"))
135 ("gettext" ,gettext-minimal)
136 ("glib:bin" ,glib "bin")
137 ("gtk+:bin" ,gtk+ "bin")
138 ("help2man" ,help2man)
139 ("pkg-config" ,pkg-config)
140 ("python-wrapper" ,python-wrapper)))
146 ("tinyxml" ,tinyxml)))
147 (synopsis "Intelligent Predictive Text Entry System")
148 (description "Presage generates predictions by modelling natural language as
149 a combination of redundant information sources. It computes probabilities for
150 words which are most likely to be entered next by merging predictions generated
151 by the different predictive algorithms.")
152 (home-page "https://presage.sourceforge.io/")
161 (uri (string-append "http://download.fcitx-im.org/fcitx/"
162 "fcitx-" version "_dict.tar.xz"))
165 "1iik80l7g8yk9iwsls6nl9whwgm0sj8i7s6s0bz4c5anl35iaddw"))))
166 (build-system cmake-build-system)
167 (outputs '("out" "gtk2" "gtk3"))
170 (list "-DENABLE_TEST=ON"
171 (string-append "-DXKB_RULES_XML_FILE="
172 (assoc-ref %build-inputs "xkeyboard-config")
173 "/share/X11/xkb/rules/evdev.xml")
174 "-DENABLE_GTK2_IM_MODULE=ON"
175 "-DENABLE_GTK3_IM_MODULE=ON"
176 (string-append "-DGTK2_IM_MODULEDIR="
177 (assoc-ref %outputs "gtk2")
178 "/lib/gtk-2.0/2.10.0/immodules")
179 (string-append "-DGTK3_IM_MODULEDIR="
180 (assoc-ref %outputs "gtk3")
181 "/lib/gtk-3.0/3.0.0/immodules")
182 ;; XXX: Enable GObject Introspection and Qt4 support.
185 "-DENABLE_QT_IM_MODULE=OFF")))
187 `(("doxygen" ,doxygen)
188 ("extra-cmake-modules"
189 ;; XXX: We can't simply #:use-module due to a cycle somewhere.
191 (resolve-interface '(gnu packages kde-frameworks))
192 'extra-cmake-modules))
193 ("glib:bin" ,glib "bin") ; for glib-genmarshal
194 ("pkg-config" ,pkg-config)))
197 ("enchant" ,enchant-1.6)
198 ("gettext" ,gettext-minimal)
202 ("iso-codes" ,iso-codes)
204 ("libxkbfile" ,libxkbfile)
206 ("xkeyboard-config" ,xkeyboard-config)))
207 (home-page "https://fcitx-im.org")
208 (synopsis "Input method framework")
210 "Fcitx is an input method framework with extension support. It has
211 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
215 (define-public fcitx-configtool
217 (name "fcitx-configtool")
221 (uri (string-append "https://download.fcitx-im.org/fcitx-configtool/"
222 "fcitx-configtool-" version ".tar.xz"))
225 "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w"))))
226 (build-system cmake-build-system)
229 (list "-DENABLE_GTK2=ON"
231 #:tests? #f)) ; No tests.
233 `(("glib:bin" ,glib "bin")
234 ("pkg-config" ,pkg-config)))
237 ("dbus-glib" ,dbus-glib)
238 ("gettext" ,gettext-minimal)
241 ("iso-codes" ,iso-codes)))
242 (home-page "https://fcitx-im.org/wiki/Configtool")
243 (synopsis "Graphic Fcitx configuration tool")
245 "Fcitx is an input method framework with extension support. It has
246 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
247 built-in. This package provides GTK version of the graphic configuration