fcitx.scm 8.8 KB

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