Merge branch 'staging' into core-updates
[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 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages fcitx)
21 #:use-module ((guix licenses) #:select (gpl2+))
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system cmake)
25 #:use-module (gnu packages documentation)
26 #:use-module (gnu packages enchant)
27 #:use-module (gnu packages gettext)
28 #:use-module (gnu packages glib)
29 #:use-module (gnu packages gtk)
30 #:use-module (gnu packages icu4c)
31 #:use-module (gnu packages iso-codes)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages web)
34 #:use-module (gnu packages xml)
35 #:use-module (gnu packages xorg))
36
37 (define-public fcitx
38 (package
39 (name "fcitx")
40 (version "4.2.9.7")
41 (source (origin
42 (method url-fetch)
43 (uri (string-append "http://download.fcitx-im.org/fcitx/"
44 "fcitx-" version "_dict.tar.xz"))
45 (sha256
46 (base32
47 "13vg7yzfq0vj2r8zdf9ly3n243nwwggkhd5qv3z6yqdyj0m3ncyg"))))
48 (build-system cmake-build-system)
49 (outputs '("out" "gtk2" "gtk3"))
50 (arguments
51 `(#:configure-flags
52 (list "-DENABLE_TEST=ON"
53 (string-append "-DXKB_RULES_XML_FILE="
54 (assoc-ref %build-inputs "xkeyboard-config")
55 "/share/X11/xkb/rules/evdev.xml")
56 "-DENABLE_GTK2_IM_MODULE=ON"
57 "-DENABLE_GTK3_IM_MODULE=ON"
58 (string-append "-DGTK2_IM_MODULEDIR="
59 (assoc-ref %outputs "gtk2")
60 "/lib/gtk-2.0/2.10.0/immodules")
61 (string-append "-DGTK3_IM_MODULEDIR="
62 (assoc-ref %outputs "gtk3")
63 "/lib/gtk-3.0/3.0.0/immodules")
64 ;; XXX: Enable GObject Introspection and Qt4 support.
65 "-DENABLE_GIR=OFF"
66 "-DENABLE_QT=OFF"
67 "-DENABLE_QT_IM_MODULE=OFF")))
68 (native-inputs
69 `(("doxygen" ,doxygen)
70 ("extra-cmake-modules"
71 ;; XXX: We can't simply #:use-module due to a cycle somewhere.
72 ,(module-ref
73 (resolve-interface '(gnu packages kde-frameworks))
74 'extra-cmake-modules))
75 ("glib:bin" ,glib "bin") ; for glib-genmarshal
76 ("pkg-config" ,pkg-config)))
77 (inputs
78 `(("dbus" ,dbus)
79 ("enchant" ,enchant-1.6)
80 ("gettext" ,gettext-minimal)
81 ("gtk2" ,gtk+-2)
82 ("gtk3" ,gtk+)
83 ("icu4c" ,icu4c)
84 ("iso-codes" ,iso-codes)
85 ("json-c" ,json-c)
86 ("libxkbfile" ,libxkbfile)
87 ("libxml2" ,libxml2)
88 ("xkeyboard-config" ,xkeyboard-config)))
89 (home-page "https://fcitx-im.org")
90 (synopsis "Input method framework")
91 (description
92 "Fcitx is an input method framework with extension support. It has
93 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
94 built-in.")
95 (license gpl2+)))
96
97 (define-public fcitx-configtool
98 (package
99 (name "fcitx-configtool")
100 (version "0.4.10")
101 (source (origin
102 (method url-fetch)
103 (uri (string-append "https://download.fcitx-im.org/fcitx-configtool/"
104 "fcitx-configtool-" version ".tar.xz"))
105 (sha256
106 (base32
107 "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w"))))
108 (build-system cmake-build-system)
109 (arguments
110 `(#:configure-flags
111 (list "-DENABLE_GTK2=ON"
112 "-DENABLE_GTK3=ON")
113 #:tests? #f)) ; No tests.
114 (native-inputs
115 `(("glib:bin" ,glib "bin")
116 ("pkg-config" ,pkg-config)))
117 (inputs
118 `(("fcitx" ,fcitx)
119 ("dbus-glib" ,dbus-glib)
120 ("gettext" ,gettext-minimal)
121 ("gtk2" ,gtk+-2)
122 ("gtk3" ,gtk+)
123 ("iso-codes" ,iso-codes)))
124 (home-page "https://fcitx-im.org/wiki/Configtool")
125 (synopsis "Graphic Fcitx configuration tool")
126 (description
127 "Fcitx is an input method framework with extension support. It has
128 Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
129 built-in. This package provides GTK version of the graphic configuration
130 tool of Fcitx.")
131 (license gpl2+)))