1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages fcitx5)
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix build-system cmake)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (gnu packages datastructures)
25 #:use-module (gnu packages enchant)
26 #:use-module (gnu packages freedesktop)
27 #:use-module (gnu packages gettext)
28 #:use-module (gnu packages glib)
29 #:use-module (gnu packages gtk)
30 #:use-module (gnu packages iso-codes)
31 #:use-module (gnu packages kde-frameworks)
32 #:use-module (gnu packages libevent)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages lua)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages pretty-print)
37 #:use-module (gnu packages unicode)
38 #:use-module (gnu packages web)
39 #:use-module (gnu packages xdisorg)
40 #:use-module (gnu packages xml)
41 #:use-module (gnu packages xorg))
43 (define-public xcb-imdkit
51 "https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-"
54 (base32 "1qgbbp8y8ci7haz99vgbrgpjsbrwwyjianyhdvxcirnbm5bybvmz"))
55 (modules '((guix build utils)))
58 ;; Remove bundled uthash.
59 (delete-file-recursively "uthash")
61 (build-system cmake-build-system)
65 ("xcb-util" ,xcb-util)
66 ("xcb-util-keysyms" ,xcb-util-keysyms)))
68 `(("extra-cmake-modules" ,extra-cmake-modules)
69 ("pkg-config" ,pkg-config)))
70 (home-page "https://github.com/fcitx/xcb-imdkit")
71 (synopsis "Input method development support for XCB")
72 (description "Xcb-imdkit is an implementation of xim protocol in XCB,
73 comparing with the implementation of IMDkit with Xlib, and xim inside Xlib, it
74 has less memory foot print, better performance, and safer on malformed
76 (license license:lgpl2.1)))
86 "https://download.fcitx-im.org/fcitx5/fcitx5/fcitx5-"
87 version "_dict.tar.xz"))
89 (base32 "06zkb33m2rnhg385iy79n3r4svz5jbav74di61xqa3lhbv7534s3"))))
90 (build-system cmake-build-system)
93 (list (string-append "-DCLDR_DIR="
94 (assoc-ref %build-inputs "unicode-cldr-common")
95 "/share/unicode/cldr"))))
98 ("cairo-xcb" ,cairo-xcb)
103 ("gdk-pixbuf" ,gdk-pixbuf)
104 ("gettext" ,gettext-minimal)
106 ("iso-codes" ,iso-codes)
108 ("libevent" ,libevent)
109 ("libpthread-stubs" ,libpthread-stubs)
110 ("libuuid" ,util-linux "lib")
113 ("libxfixes" ,libxfixes)
114 ("libxinerama" ,libxinerama)
115 ("libxkbcommon" ,libxkbcommon)
116 ("libxkbfile" ,libxkbfile)
118 ("unicode-cldr-common" ,unicode-cldr-common)
120 ("wayland-protocols" ,wayland-protocols)
121 ("xcb-imdkit" ,xcb-imdkit)
122 ("xcb-util" ,xcb-util)
123 ("xcb-util-keysyms" ,xcb-util-keysyms)
124 ("xcb-util-wm" ,xcb-util-wm)
125 ("xkeyboard-config" ,xkeyboard-config)))
127 `(("extra-cmake-modules" ,extra-cmake-modules)
128 ("pkg-config" ,pkg-config)))
130 (list (search-path-specification
131 (variable "FCITX_ADDON_DIRS")
132 (files '("lib/fcitx5")))))
133 (home-page "https://github.com/fcitx/fcitx5")
134 (synopsis "Input method framework")
135 (description "Fcitx 5 is a generic input method framework.")
136 (license license:lgpl2.1+)))
138 (define-public fcitx5-lua
146 "https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-"
149 (base32 "177mj56j8yrl79hvk7bbrifvm137np23pwalv83ibgk4l51z92hf"))))
150 (build-system cmake-build-system)
154 (string-append "-DFEM_INCLUDE_INSTALL_DIR=" %output "/include")
155 (string-append "-DFEM_LIB_INSTALL_DIR=" %output "/lib"))
157 (modify-phases %standard-phases
158 (add-before 'configure 'patch-install-prefix
159 (lambda* (#:key outputs #:allow-other-keys)
162 (format #t "patch-install-prefix: Fixing install prefix in ~a~%"
165 (("\\$\\{FCITX_INSTALL_PKGDATADIR\\}")
166 (string-append (assoc-ref outputs "out")
168 '("src/addonloader/CMakeLists.txt"
169 "src/imeapi/CMakeLists.txt")))))))
173 ("gettext" ,gettext-minimal)
174 ("libpthread-stubs" ,libpthread-stubs)))
176 `(("extra-cmake-modules" ,extra-cmake-modules)))
177 (home-page "https://github.com/fcitx/fcitx5-lua")
178 (synopsis "Lua support for Fcitx 5")
179 (description "Fcitx5-lua allows writing Fcitx5 extension in Lua.")
180 (license license:lgpl2.1+)))