Merge branch 'staging'
[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 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
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.
12 ;;;
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.
17 ;;;
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/>.
20
21 (define-module (gnu packages fcitx)
22 #:use-module ((guix licenses) #:select (gpl2+))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system cmake)
26 #:use-module (guix build-system glib-or-gtk)
27 #:use-module (gnu packages check)
28 #:use-module (gnu packages documentation)
29 #:use-module (gnu packages enchant)
30 #:use-module (gnu packages gettext)
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages graphviz)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages icu4c)
35 #:use-module (gnu packages iso-codes)
36 #:use-module (gnu packages man)
37 #:use-module (gnu packages ncurses)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages sqlite)
41 #:use-module (gnu packages web)
42 #:use-module (gnu packages xml)
43 #:use-module (gnu packages xorg))
44
45 (define-public presage
46 (package
47 (name "presage")
48 (version "0.9.1")
49 (source
50 (origin
51 (method url-fetch)
52 (uri
53 (string-append "mirror://sourceforge/presage/presage/"
54 version "/presage-" version ".tar.gz"))
55 (sha256
56 (base32 "0rm3b3zaf6bd7hia0lr1wyvi1rrvxkn7hg05r5r1saj0a3ingmay"))))
57 (build-system glib-or-gtk-build-system)
58 (outputs '("out" "doc"))
59 (arguments
60 `(#:configure-flags
61 (list
62 "CFLAGS=-Wno-narrowing"
63 "CXXFLAGS=-Wno-narrowing")
64 #:phases
65 (modify-phases %standard-phases
66 (add-after 'install 'move-doc
67 (lambda* (#:key outputs #:allow-other-keys)
68 (let* ((out (assoc-ref outputs "out"))
69 (doc (assoc-ref outputs "doc")))
70 (mkdir-p (string-append doc "/share/presage"))
71 (rename-file
72 (string-append out "/share/presage/html")
73 (string-append doc "/share/presage/html"))
74 #t))))))
75 (native-inputs
76 `(("dot" ,graphviz)
77 ("doxygen" ,doxygen)
78 ("gettext" ,gettext-minimal)
79 ("glib:bin" ,glib "bin")
80 ("gtk+:bin" ,gtk+ "bin")
81 ("help2man" ,help2man)
82 ("pkg-config" ,pkg-config)
83 ("python-wrapper" ,python-wrapper)))
84 (inputs
85 `(("glib" ,glib)
86 ("gtk+" ,gtk+)
87 ("libx11" ,libx11)
88 ("sqlite" ,sqlite)
89 ("tinyxml" ,tinyxml)))
90 (synopsis "Intelligent Predictive Text Entry System")
91 (description "Presage generates predictions by modelling natural language as
92 a combination of redundant information sources. It computes probabilities for
93 words which are most likely to be entered next by merging predictions generated
94 by the different predictive algorithms.")
95 (home-page "https://presage.sourceforge.io/")
96 (license gpl2+)))
97
98 (define-public fcitx
99 (package
100 (name "fcitx")
101 (version "4.2.9.8")
102 (source (origin
103 (method url-fetch)
104 (uri (string-append "http://download.fcitx-im.org/fcitx/"
105 "fcitx-" version "_dict.tar.xz"))
106 (sha256
107 (base32
108 "1iik80l7g8yk9iwsls6nl9whwgm0sj8i7s6s0bz4c5anl35iaddw"))))
109 (build-system cmake-build-system)
110 (outputs '("out" "gtk2" "gtk3"))
111 (arguments
112 `(#:configure-flags
113 (list "-DENABLE_TEST=ON"
114 (string-append "-DXKB_RULES_XML_FILE="
115 (assoc-ref %build-inputs "xkeyboard-config")
116 "/share/X11/xkb/rules/evdev.xml")
117 "-DENABLE_GTK2_IM_MODULE=ON"
118 "-DENABLE_GTK3_IM_MODULE=ON"
119 (string-append "-DGTK2_IM_MODULEDIR="
120 (assoc-ref %outputs "gtk2")
121 "/lib/gtk-2.0/2.10.0/immodules")
122 (string-append "-DGTK3_IM_MODULEDIR="
123 (assoc-ref %outputs "gtk3")
124 "/lib/gtk-3.0/3.0.0/immodules")
125 ;; XXX: Enable GObject Introspection and Qt4 support.
126 "-DENABLE_GIR=OFF"
127 "-DENABLE_QT=OFF"
128 "-DENABLE_QT_IM_MODULE=OFF")))
129 (native-inputs
130 `(("doxygen" ,doxygen)
131 ("extra-cmake-modules"
132 ;; XXX: We can't simply #:use-module due to a cycle somewhere.
133 ,(module-ref
134 (resolve-interface '(gnu packages kde-frameworks))
135 'extra-cmake-modules))
136 ("glib:bin" ,glib "bin") ; for glib-genmarshal
137 ("pkg-config" ,pkg-config)))
138 (inputs
139 `(("dbus" ,dbus)
140 ("enchant" ,enchant-1.6)
141 ("gettext" ,gettext-minimal)
142 ("gtk2" ,gtk+-2)
143 ("gtk3" ,gtk+)
144 ("icu4c" ,icu4c)
145 ("iso-codes" ,iso-codes)
146 ("json-c" ,json-c)
147 ("libxkbfile" ,libxkbfile)
148 ("libxml2" ,libxml2)
149 ("xkeyboard-config" ,xkeyboard-config)))
150 (home-page "https://fcitx-im.org")
151 (synopsis "Input method framework")
152 (description
153 "Fcitx is an input method framework with extension support. It has
154 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
155 built-in.")
156 (license gpl2+)))
157
158 (define-public fcitx-configtool
159 (package
160 (name "fcitx-configtool")
161 (version "0.4.10")
162 (source (origin
163 (method url-fetch)
164 (uri (string-append "https://download.fcitx-im.org/fcitx-configtool/"
165 "fcitx-configtool-" version ".tar.xz"))
166 (sha256
167 (base32
168 "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w"))))
169 (build-system cmake-build-system)
170 (arguments
171 `(#:configure-flags
172 (list "-DENABLE_GTK2=ON"
173 "-DENABLE_GTK3=ON")
174 #:tests? #f)) ; No tests.
175 (native-inputs
176 `(("glib:bin" ,glib "bin")
177 ("pkg-config" ,pkg-config)))
178 (inputs
179 `(("fcitx" ,fcitx)
180 ("dbus-glib" ,dbus-glib)
181 ("gettext" ,gettext-minimal)
182 ("gtk2" ,gtk+-2)
183 ("gtk3" ,gtk+)
184 ("iso-codes" ,iso-codes)))
185 (home-page "https://fcitx-im.org/wiki/Configtool")
186 (synopsis "Graphic Fcitx configuration tool")
187 (description
188 "Fcitx is an input method framework with extension support. It has
189 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
190 built-in. This package provides GTK version of the graphic configuration
191 tool of Fcitx.")
192 (license gpl2+)))