fcitx.scm 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. `(("extra-cmake-modules" ,extra-cmake-modules)
  83. ("pkg-config" ,pkg-config)))
  84. (inputs
  85. `(("fcitx" ,fcitx)
  86. ("libintl" ,intltool)
  87. ("libxkbcommon" ,libxkbcommon)))
  88. (propagated-inputs
  89. `(("qtbase" ,qtbase-5)))
  90. (synopsis "Fcitx Qt5 Input Context")
  91. (description "This package provides a Qt5 frontend for fcitx.")
  92. (home-page "https://github.com/fcitx/fcitx-qt5/")
  93. (license
  94. (list
  95. ;; Plugin
  96. bsd-3
  97. ;; Others
  98. gpl2+))))
  99. (define-public presage
  100. (package
  101. (name "presage")
  102. (version "0.9.1")
  103. (source
  104. (origin
  105. (method url-fetch)
  106. (uri
  107. (string-append "mirror://sourceforge/presage/presage/"
  108. version "/presage-" version ".tar.gz"))
  109. (sha256
  110. (base32 "0rm3b3zaf6bd7hia0lr1wyvi1rrvxkn7hg05r5r1saj0a3ingmay"))))
  111. (build-system glib-or-gtk-build-system)
  112. (outputs '("out" "doc"))
  113. (arguments
  114. `(#:configure-flags
  115. (list
  116. "CFLAGS=-Wno-narrowing"
  117. "CXXFLAGS=-Wno-narrowing")
  118. #:phases
  119. (modify-phases %standard-phases
  120. (add-after 'install 'move-doc
  121. (lambda* (#:key outputs #:allow-other-keys)
  122. (let* ((out (assoc-ref outputs "out"))
  123. (doc (assoc-ref outputs "doc")))
  124. (mkdir-p (string-append doc "/share/presage"))
  125. (rename-file
  126. (string-append out "/share/presage/html")
  127. (string-append doc "/share/presage/html"))
  128. #t))))))
  129. (native-inputs
  130. `(("dot" ,graphviz)
  131. ("doxygen" ,doxygen)
  132. ("gettext" ,gettext-minimal)
  133. ("glib:bin" ,glib "bin")
  134. ("gtk+:bin" ,gtk+ "bin")
  135. ("help2man" ,help2man)
  136. ("pkg-config" ,pkg-config)
  137. ("python-wrapper" ,python-wrapper)))
  138. (inputs
  139. `(("glib" ,glib)
  140. ("gtk+" ,gtk+)
  141. ("libx11" ,libx11)
  142. ("sqlite" ,sqlite)
  143. ("tinyxml" ,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. (define-public fcitx
  152. (package
  153. (name "fcitx")
  154. (version "4.2.9.8")
  155. (source (origin
  156. (method url-fetch)
  157. (uri (string-append "http://download.fcitx-im.org/fcitx/"
  158. "fcitx-" version "_dict.tar.xz"))
  159. (sha256
  160. (base32
  161. "1iik80l7g8yk9iwsls6nl9whwgm0sj8i7s6s0bz4c5anl35iaddw"))))
  162. (build-system cmake-build-system)
  163. (outputs '("out" "gtk2" "gtk3"))
  164. (arguments
  165. `(#:configure-flags
  166. (list "-DENABLE_TEST=ON"
  167. (string-append "-DXKB_RULES_XML_FILE="
  168. (assoc-ref %build-inputs "xkeyboard-config")
  169. "/share/X11/xkb/rules/evdev.xml")
  170. "-DENABLE_GTK2_IM_MODULE=ON"
  171. "-DENABLE_GTK3_IM_MODULE=ON"
  172. (string-append "-DGTK2_IM_MODULEDIR="
  173. (assoc-ref %outputs "gtk2")
  174. "/lib/gtk-2.0/2.10.0/immodules")
  175. (string-append "-DGTK3_IM_MODULEDIR="
  176. (assoc-ref %outputs "gtk3")
  177. "/lib/gtk-3.0/3.0.0/immodules")
  178. ;; XXX: Enable GObject Introspection and Qt4 support.
  179. "-DENABLE_GIR=OFF"
  180. "-DENABLE_QT=OFF"
  181. "-DENABLE_QT_IM_MODULE=OFF")))
  182. (native-inputs
  183. `(("doxygen" ,doxygen)
  184. ("extra-cmake-modules"
  185. ;; XXX: We can't simply #:use-module due to a cycle somewhere.
  186. ,(module-ref
  187. (resolve-interface '(gnu packages kde-frameworks))
  188. 'extra-cmake-modules))
  189. ("glib:bin" ,glib "bin") ; for glib-genmarshal
  190. ("pkg-config" ,pkg-config)))
  191. (inputs
  192. `(("dbus" ,dbus)
  193. ("enchant" ,enchant-1.6)
  194. ("gettext" ,gettext-minimal)
  195. ("gtk2" ,gtk+-2)
  196. ("gtk3" ,gtk+)
  197. ("icu4c" ,icu4c)
  198. ("iso-codes" ,iso-codes)
  199. ("json-c" ,json-c)
  200. ("libxkbfile" ,libxkbfile)
  201. ("libxml2" ,libxml2)
  202. ("xkeyboard-config" ,xkeyboard-config)))
  203. (home-page "https://fcitx-im.org")
  204. (synopsis "Input method framework")
  205. (description
  206. "Fcitx is an input method framework with extension support. It has
  207. Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
  208. built-in.")
  209. (license gpl2+)))
  210. (define-public fcitx-configtool
  211. (package
  212. (name "fcitx-configtool")
  213. (version "0.4.10")
  214. (source (origin
  215. (method url-fetch)
  216. (uri (string-append "https://download.fcitx-im.org/fcitx-configtool/"
  217. "fcitx-configtool-" version ".tar.xz"))
  218. (sha256
  219. (base32
  220. "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w"))))
  221. (build-system cmake-build-system)
  222. (arguments
  223. `(#:configure-flags
  224. (list "-DENABLE_GTK2=ON"
  225. "-DENABLE_GTK3=ON")
  226. #:tests? #f)) ; No tests.
  227. (native-inputs
  228. `(("glib:bin" ,glib "bin")
  229. ("pkg-config" ,pkg-config)))
  230. (inputs
  231. `(("fcitx" ,fcitx)
  232. ("dbus-glib" ,dbus-glib)
  233. ("gettext" ,gettext-minimal)
  234. ("gtk2" ,gtk+-2)
  235. ("gtk3" ,gtk+)
  236. ("iso-codes" ,iso-codes)))
  237. (home-page "https://fcitx-im.org/wiki/Configtool")
  238. (synopsis "Graphic Fcitx configuration tool")
  239. (description
  240. "Fcitx is an input method framework with extension support. It has
  241. Pinyin, Quwei and some table-based (Wubi, Cangjie, Erbi, etc.) input methods
  242. built-in. This package provides GTK version of the graphic configuration
  243. tool of Fcitx.")
  244. (license gpl2+)))