gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / fcitx.scm
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>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
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.
13 ;;;
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.
18 ;;;
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/>.
21
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))
51
52 (define-public fcitx-qt5
53 (package
54 (name "fcitx-qt5")
55 (version "1.2.6")
56 (source
57 (origin
58 (method git-fetch)
59 (uri
60 (git-reference
61 (url "https://github.com/fcitx/fcitx-qt5.git")
62 (commit version)))
63 (file-name
64 (git-file-name name version))
65 (sha256
66 (base32 "13sanrir696fv7s44b7q453s5qi4r7ag0r3iyggyzk8xyf6rw8fk"))))
67 (build-system qt-build-system)
68 (arguments
69 `(#:tests? #f ; No target
70 #:phases
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\\}")
76 (string-append
77 (assoc-ref outputs "out")
78 "/lib/fcitx")))
79 (substitute* "platforminputcontext/CMakeLists.txt"
80 (("\\$\\{CMAKE_INSTALL_QTPLUGINDIR\\}")
81 (string-append
82 (assoc-ref outputs "out")
83 "/lib/qt5/plugins")))
84 #t)))))
85 (native-inputs
86 (list extra-cmake-modules pkg-config))
87 (inputs
88 `(("fcitx" ,fcitx)
89 ("libintl" ,intltool)
90 ("libxkbcommon" ,libxkbcommon)))
91 (propagated-inputs
92 (list qtbase-5))
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/")
96 (license
97 (list
98 ;; Plugin
99 bsd-3
100 ;; Others
101 gpl2+))))
102
103 (define-public presage
104 (package
105 (name "presage")
106 (version "0.9.1")
107 (source
108 (origin
109 (method url-fetch)
110 (uri
111 (string-append "mirror://sourceforge/presage/presage/"
112 version "/presage-" version ".tar.gz"))
113 (sha256
114 (base32 "0rm3b3zaf6bd7hia0lr1wyvi1rrvxkn7hg05r5r1saj0a3ingmay"))))
115 (build-system glib-or-gtk-build-system)
116 (outputs '("out" "doc"))
117 (arguments
118 `(#:configure-flags
119 (list
120 "CFLAGS=-Wno-narrowing"
121 "CXXFLAGS=-Wno-narrowing")
122 #:phases
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"))
129 (rename-file
130 (string-append out "/share/presage/html")
131 (string-append doc "/share/presage/html"))
132 #t))))))
133 (native-inputs
134 `(("dot" ,graphviz)
135 ("doxygen" ,doxygen)
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)))
142 (inputs
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/")
150 (license gpl2+)))
151
152 (define-public fcitx
153 (package
154 (name "fcitx")
155 (version "4.2.9.9")
156 (source (origin
157 (method url-fetch)
158 (uri (string-append "https://download.fcitx-im.org/fcitx/"
159 "fcitx-" version "_dict.tar.xz"))
160 (sha256
161 (base32
162 "0x5980l7ry34scvfdwc330d9nxv3id9jj9wcl7bvqjkp32gz3aj5"))))
163 (build-system cmake-build-system)
164 (outputs '("out" "gtk2" "gtk3"))
165 (arguments
166 (list
167 #:configure-flags
168 #~(list "-DENABLE_TEST=ON"
169 (string-append "-DXKB_RULES_XML_FILE="
170 (search-input-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="
175 #$output:gtk2
176 "/lib/gtk-2.0/2.10.0/immodules")
177 (string-append "-DGTK3_IM_MODULEDIR="
178 #$output:gtk3
179 "/lib/gtk-3.0/3.0.0/immodules")
180 ;; XXX: Enable GObject Introspection and Qt4 support.
181 "-DENABLE_GIR=OFF"
182 "-DENABLE_QT=OFF"
183 "-DENABLE_QT_IM_MODULE=OFF")))
184 (native-inputs
185 (list doxygen
186 ;; XXX: We can't simply #:use-module due to a cycle somewhere.
187 (module-ref
188 (resolve-interface '(gnu packages kde-frameworks))
189 'extra-cmake-modules)
190 `(,glib "bin") ; for glib-genmarshal
191 pkg-config))
192 (inputs
193 (list dbus
194 enchant-1.6
195 gettext-minimal
196 gtk+-2
197 gtk+
198 icu4c
199 iso-codes
200 json-c
201 libxkbfile
202 libxml2
203 xkeyboard-config))
204 (home-page "https://fcitx-im.org")
205 (synopsis "Input method framework")
206 (description
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
209 built-in.")
210 (license gpl2+)))
211
212 (define-public fcitx-configtool
213 (package
214 (name "fcitx-configtool")
215 (version "0.4.10")
216 (source (origin
217 (method url-fetch)
218 (uri (string-append "https://download.fcitx-im.org/fcitx-configtool/"
219 "fcitx-configtool-" version ".tar.xz"))
220 (sha256
221 (base32
222 "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w"))))
223 (build-system cmake-build-system)
224 (arguments
225 `(#:configure-flags
226 (list "-DENABLE_GTK2=ON"
227 "-DENABLE_GTK3=ON")
228 #:tests? #f)) ; No tests.
229 (native-inputs
230 `(("glib:bin" ,glib "bin")
231 ("pkg-config" ,pkg-config)))
232 (inputs
233 `(("fcitx" ,fcitx)
234 ("dbus-glib" ,dbus-glib)
235 ("gettext" ,gettext-minimal)
236 ("gtk2" ,gtk+-2)
237 ("gtk3" ,gtk+)
238 ("iso-codes" ,iso-codes)))
239 (home-page "https://fcitx-im.org/wiki/Configtool")
240 (synopsis "Graphic Fcitx configuration tool")
241 (description
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
245 tool of Fcitx.")
246 (license gpl2+)))