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>
5 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages fcitx)
23 #:use-module ((guix licenses) #:select (gpl2+ bsd-3))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix gexp)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system glib-or-gtk)
30 #:use-module (guix build-system qt)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages enchant)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages graphviz)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages icu4c)
39 #:use-module (gnu packages iso-codes)
40 #:use-module (gnu packages kde-frameworks)
41 #:use-module (gnu packages man)
42 #:use-module (gnu packages ncurses)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages qt)
46 #:use-module (gnu packages sqlite)
47 #:use-module (gnu packages web)
48 #:use-module (gnu packages xml)
49 #:use-module (gnu packages xorg)
50 #:use-module (gnu packages xdisorg))
52 (define-public fcitx-qt5
61 (url "https://github.com/fcitx/fcitx-qt5.git")
64 (git-file-name name version))
66 (base32 "13sanrir696fv7s44b7q453s5qi4r7ag0r3iyggyzk8xyf6rw8fk"))))
67 (build-system qt-build-system)
69 `(#:tests? #f ; No target
71 (modify-phases %standard-phases
72 (add-after 'unpack 'patch-install-dir
73 (lambda* (#:key outputs #:allow-other-keys)
74 (substitute* "quickphrase-editor/CMakeLists.txt"
75 (("\\$\\{FCITX4_ADDON_INSTALL_DIR\\}")
77 (assoc-ref outputs "out")
79 (substitute* "platforminputcontext/CMakeLists.txt"
80 (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
82 (assoc-ref outputs "out")
86 (list extra-cmake-modules pkg-config))
90 ("libxkbcommon" ,libxkbcommon)))
93 (synopsis "Fcitx Qt5 Input Context")
94 (description "This package provides a Qt5 frontend for fcitx.")
95 (home-page "https://github.com/fcitx/fcitx-qt5/")
103 (define-public presage
111 (string-append "mirror://sourceforge/presage/presage/"
112 version "/presage-" version ".tar.gz"))
114 (base32 "0rm3b3zaf6bd7hia0lr1wyvi1rrvxkn7hg05r5r1saj0a3ingmay"))))
115 (build-system glib-or-gtk-build-system)
116 (outputs '("out" "doc"))
120 "CFLAGS=-Wno-narrowing"
121 "CXXFLAGS=-Wno-narrowing")
123 (modify-phases %standard-phases
124 (add-after 'install 'move-doc
125 (lambda* (#:key outputs #:allow-other-keys)
126 (let* ((out (assoc-ref outputs "out"))
127 (doc (assoc-ref outputs "doc")))
128 (mkdir-p (string-append doc "/share/presage"))
130 (string-append out "/share/presage/html")
131 (string-append doc "/share/presage/html"))
136 ("gettext" ,gettext-minimal)
137 ("glib:bin" ,glib "bin")
138 ("gtk+:bin" ,gtk+ "bin")
139 ("help2man" ,help2man)
140 ("pkg-config" ,pkg-config)
141 ("python-wrapper" ,python-wrapper)))
143 (list glib gtk+ libx11 sqlite tinyxml))
144 (synopsis "Intelligent Predictive Text Entry System")
145 (description "Presage generates predictions by modelling natural language as
146 a combination of redundant information sources. It computes probabilities for
147 words which are most likely to be entered next by merging predictions generated
148 by the different predictive algorithms.")
149 (home-page "https://presage.sourceforge.io/")
158 (uri (string-append "https://download.fcitx-im.org/fcitx/"
159 "fcitx-" version "_dict.tar.xz"))
162 "0x5980l7ry34scvfdwc330d9nxv3id9jj9wcl7bvqjkp32gz3aj5"))))
163 (build-system cmake-build-system)
164 (outputs '("out" "gtk2" "gtk3"))
168 #~(list "-DENABLE_TEST=ON"
169 (string-append "-DXKB_RULES_XML_FILE="
171 %build-inputs "share/X11/xkb/rules/evdev.xml"))
172 "-DENABLE_GTK2_IM_MODULE=ON"
173 "-DENABLE_GTK3_IM_MODULE=ON"
174 (string-append "-DGTK2_IM_MODULEDIR="
176 "/lib/gtk-2.0/2.10.0/immodules")
177 (string-append "-DGTK3_IM_MODULEDIR="
179 "/lib/gtk-3.0/3.0.0/immodules")
180 ;; XXX: Enable GObject Introspection and Qt4 support.
183 "-DENABLE_QT_IM_MODULE=OFF")))
186 ;; XXX: We can't simply #:use-module due to a cycle somewhere.
188 (resolve-interface '(gnu packages kde-frameworks))
189 'extra-cmake-modules)
190 `(,glib "bin") ; for glib-genmarshal
204 (home-page "https://fcitx-im.org")
205 (synopsis "Input method framework")
207 "Fcitx is an input method framework with extension support. It has
208 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
212 (define-public fcitx-configtool
214 (name "fcitx-configtool")
218 (uri (string-append "https://download.fcitx-im.org/fcitx-configtool/"
219 "fcitx-configtool-" version ".tar.xz"))
222 "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w"))))
223 (build-system cmake-build-system)
226 (list "-DENABLE_GTK2=ON"
228 #:tests? #f)) ; No tests.
230 `(("glib:bin" ,glib "bin")
231 ("pkg-config" ,pkg-config)))
234 ("dbus-glib" ,dbus-glib)
235 ("gettext" ,gettext-minimal)
238 ("iso-codes" ,iso-codes)))
239 (home-page "https://fcitx-im.org/wiki/Configtool")
240 (synopsis "Graphic Fcitx configuration tool")
242 "Fcitx is an input method framework with extension support. It has
243 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
244 built-in. This package provides GTK version of the graphic configuration