ibus.scm 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
  4. ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
  5. ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  7. ;;; Copyright © 2018, 2019, 2020, 2021 Peng Mei Yu <pengmeiyu@riseup.net>
  8. ;;; Copyright © 2020 kanichos <kanichos@yandex.ru>
  9. ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
  10. ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
  11. ;;;
  12. ;;; This file is part of GNU Guix.
  13. ;;;
  14. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  15. ;;; under the terms of the GNU General Public License as published by
  16. ;;; the Free Software Foundation; either version 3 of the License, or (at
  17. ;;; your option) any later version.
  18. ;;;
  19. ;;; GNU Guix is distributed in the hope that it will be useful, but
  20. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. ;;; GNU General Public License for more details.
  23. ;;;
  24. ;;; You should have received a copy of the GNU General Public License
  25. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  26. (define-module (gnu packages ibus)
  27. #:use-module (guix licenses)
  28. #:use-module (guix packages)
  29. #:use-module (guix download)
  30. #:use-module (guix git-download)
  31. #:use-module (guix build-system cmake)
  32. #:use-module (guix build-system gnu)
  33. #:use-module (guix build-system glib-or-gtk)
  34. #:use-module (guix utils)
  35. #:use-module (gnu packages)
  36. #:use-module (gnu packages anthy)
  37. #:use-module (gnu packages autotools)
  38. #:use-module (gnu packages base)
  39. #:use-module (gnu packages boost)
  40. #:use-module (gnu packages check)
  41. #:use-module (gnu packages cmake)
  42. #:use-module (gnu packages databases)
  43. #:use-module (gnu packages datastructures)
  44. #:use-module (gnu packages dbm)
  45. #:use-module (gnu packages docbook)
  46. #:use-module (gnu packages freedesktop)
  47. #:use-module (gnu packages gettext)
  48. #:use-module (gnu packages glib)
  49. #:use-module (gnu packages gnome)
  50. #:use-module (gnu packages gtk)
  51. #:use-module (gnu packages iso-codes)
  52. #:use-module (gnu packages logging)
  53. #:use-module (gnu packages perl)
  54. #:use-module (gnu packages pkg-config)
  55. #:use-module (gnu packages python)
  56. #:use-module (gnu packages python-xyz)
  57. #:use-module (gnu packages serialization)
  58. #:use-module (gnu packages sqlite)
  59. #:use-module (gnu packages textutils)
  60. #:use-module (gnu packages unicode)
  61. #:use-module (gnu packages xorg)
  62. #:use-module (gnu packages xdisorg))
  63. (define-public ibus
  64. (package
  65. (name "ibus")
  66. (version "1.5.24")
  67. (source (origin
  68. (method url-fetch)
  69. (uri (string-append "https://github.com/ibus/ibus/"
  70. "releases/download/"
  71. version "/ibus-" version ".tar.gz"))
  72. (sha256
  73. (base32
  74. "07s2ly75xv50bqg37mn37i9akqvcfd45k2mbplxrsqk3a2b3mwxb"))))
  75. (build-system glib-or-gtk-build-system)
  76. (outputs '("out" "doc"))
  77. (arguments
  78. `(#:parallel-build? #f ; race condition discovered with emoji support
  79. #:configure-flags (list "--enable-python-library"
  80. "--enable-gtk-doc"
  81. "--enable-memconf"
  82. (string-append
  83. "--with-unicode-emoji-dir="
  84. (assoc-ref %build-inputs "unicode-emoji")
  85. "/share/unicode/emoji")
  86. (string-append
  87. "--with-emoji-annotation-dir="
  88. (assoc-ref %build-inputs "unicode-cldr-common")
  89. "/share/unicode/cldr/common/annotations")
  90. (string-append "--with-ucd-dir="
  91. (assoc-ref %build-inputs "ucd")
  92. "/share/ucd")
  93. "--enable-wayland")
  94. #:phases
  95. (modify-phases %standard-phases
  96. (add-after 'unpack 'disable-failing-tests
  97. (lambda _
  98. ;; These tests require /etc/machine-id.
  99. (with-directory-excursion "src/tests"
  100. (substitute* '("ibus-share.c" "ibus-compose.c"
  101. "ibus-keypress.c")
  102. (("[ \t]*return g_test_run \\(\\);") "")))))
  103. (add-after 'unpack 'patch-docbook-xml
  104. (lambda* (#:key inputs #:allow-other-keys)
  105. (with-directory-excursion "docs/reference/ibus"
  106. (substitute* "ibus-docs.sgml.in"
  107. (("http://www.oasis-open.org/docbook/xml/4.1.2/")
  108. (string-append (assoc-ref inputs "docbook-xml")
  109. "/xml/dtd/docbook/"))))))
  110. (add-after 'unpack 'patch-python-target-directories
  111. (lambda* (#:key outputs #:allow-other-keys)
  112. (let ((root (string-append (assoc-ref outputs "out")
  113. "/lib/python"
  114. ,(version-major+minor (package-version python))
  115. "/site-packages")))
  116. (substitute* "configure"
  117. (("(py2?overridesdir)=.*" _ var)
  118. (string-append var "=" root "/gi/overrides/"))
  119. (("(pkgpython2dir=).*" _ var)
  120. (string-append var root "/ibus"))))))
  121. (add-before 'configure 'disable-dconf-update
  122. (lambda _
  123. (substitute* "data/dconf/Makefile.in"
  124. (("dconf update") "echo dconf update"))))
  125. (add-after 'unpack 'delete-generated-files
  126. (lambda _
  127. (for-each (lambda (file)
  128. (let ((c (string-append (string-drop-right file 4) "c")))
  129. (when (file-exists? c)
  130. (format #t "deleting ~a\n" c)
  131. (delete-file c))))
  132. (find-files "." "\\.vala"))))
  133. (add-after 'unpack 'fix-paths
  134. (lambda* (#:key inputs #:allow-other-keys)
  135. (substitute* "src/ibusenginesimple.c"
  136. (("/usr/share/X11/locale")
  137. (search-input-directory inputs
  138. "share/X11/locale")))
  139. (substitute* "ui/gtk3/xkblayout.vala"
  140. (("\"(setxkbmap|xmodmap)\"" _ prog)
  141. (string-append "\""
  142. (search-input-file inputs
  143. (string-append "bin/" prog))
  144. "\"")))))
  145. (add-before 'check 'pre-check
  146. (lambda _
  147. ;; Tests write to $HOME.
  148. (setenv "HOME" (getcwd))
  149. ;; Tests look for $XDG_RUNTIME_DIR.
  150. (setenv "XDG_RUNTIME_DIR" (getcwd))
  151. ;; For missing '/etc/machine-id'.
  152. (setenv "DBUS_FATAL_WARNINGS" "0")
  153. ;; Tests require a running X server.
  154. (system "Xvfb :1 +extension GLX &")
  155. (setenv "DISPLAY" ":1")
  156. ;; Tests require running iBus daemon.
  157. (system "./bus/ibus-daemon --daemonize")))
  158. (add-after 'install 'move-doc
  159. (lambda* (#:key outputs #:allow-other-keys)
  160. (let* ((out (assoc-ref outputs "out"))
  161. (doc (assoc-ref outputs "doc")))
  162. (mkdir-p (string-append doc "/share"))
  163. (rename-file
  164. (string-append out "/share/gtk-doc")
  165. (string-append doc "/share/gtk-doc")))))
  166. (add-after 'wrap-program 'wrap-with-additional-paths
  167. (lambda* (#:key outputs #:allow-other-keys)
  168. ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and
  169. ;; GI_TYPELIB_PATH.
  170. (let ((out (assoc-ref outputs "out")))
  171. (wrap-program (string-append out "/bin/ibus-setup")
  172. `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))
  173. `("GI_TYPELIB_PATH" ":" prefix
  174. (,(getenv "GI_TYPELIB_PATH")
  175. ,(string-append out "/lib/girepository-1.0"))))))))))
  176. (inputs
  177. `(("dbus" ,dbus)
  178. ("dconf" ,dconf)
  179. ("glib" ,glib)
  180. ("gtk2" ,gtk+-2)
  181. ("gtk+" ,gtk+)
  182. ("iso-codes" ,iso-codes)
  183. ("json-glib" ,json-glib)
  184. ("libnotify" ,libnotify)
  185. ("libx11" ,libx11)
  186. ("libxkbcommon" ,libxkbcommon)
  187. ("libxtst" ,libxtst)
  188. ("pygobject" ,python-pygobject)
  189. ("python" ,python)
  190. ("python-dbus" ,python-dbus)
  191. ("setxkbmap" ,setxkbmap)
  192. ("ucd" ,ucd)
  193. ("unicode-cldr-common" ,unicode-cldr-common)
  194. ("unicode-emoji" ,unicode-emoji)
  195. ("wayland" ,wayland)
  196. ("xmodmap" ,xmodmap)))
  197. (native-inputs
  198. `(("docbook-xml" ,docbook-xml-4.1.2)
  199. ("glib" ,glib "bin") ; for glib-genmarshal
  200. ("gettext" ,gettext-minimal)
  201. ("gnome-common" ,gnome-common)
  202. ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
  203. ("gtk+:bin" ,gtk+ "bin")
  204. ("gtk-doc" ,gtk-doc)
  205. ("perl" ,perl)
  206. ("pkg-config" ,pkg-config)
  207. ("python-wrapper" ,python-wrapper)
  208. ("vala" ,vala)
  209. ("which" ,which)
  210. ("xorg-server" ,xorg-server-for-tests)))
  211. (native-search-paths
  212. (list (search-path-specification
  213. (variable "IBUS_COMPONENT_PATH")
  214. (files '("share/ibus/component")))))
  215. (synopsis "Input method framework")
  216. (description
  217. "IBus is an input framework providing a full-featured and user-friendly
  218. input method user interface. It comes with multilingual input support. It
  219. may also simplify input method development.")
  220. (home-page "https://github.com/ibus/ibus/wiki")
  221. (license lgpl2.1+)))
  222. (define-public ibus-libpinyin
  223. (package
  224. (name "ibus-libpinyin")
  225. (version "1.12.0")
  226. (source (origin
  227. (method url-fetch)
  228. (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/"
  229. "releases/download/" version
  230. "/ibus-libpinyin-" version ".tar.gz"))
  231. (sha256
  232. (base32
  233. "0xl2lmffy42f6h6za05z4vpazpza1a9gsrva65giwyv3kpf652dd"))))
  234. (build-system glib-or-gtk-build-system)
  235. (arguments
  236. `(#:configure-flags
  237. '("--enable-opencc")
  238. #:phases
  239. (modify-phases %standard-phases
  240. (add-after 'wrap-program 'wrap-with-additional-paths
  241. (lambda* (#:key inputs outputs #:allow-other-keys)
  242. ;; Make sure 'ibus-setup-libpinyin' runs with the correct
  243. ;; PYTHONPATH and GI_TYPELIB_PATH.
  244. (let ((out (assoc-ref outputs "out")))
  245. (wrap-program (string-append out "/libexec/ibus-setup-libpinyin")
  246. `("GUIX_PYTHONPATH" ":" prefix
  247. (,(getenv "GUIX_PYTHONPATH")
  248. ,(string-append (assoc-ref inputs "ibus")
  249. "/lib/girepository-1.0")
  250. ,(string-append (assoc-ref outputs "out")
  251. "/share/ibus-libpinyin/setup/")))
  252. `("GI_TYPELIB_PATH" ":" prefix
  253. (,(string-append (assoc-ref inputs "ibus")
  254. "/lib/girepository-1.0")
  255. ,(string-append (assoc-ref outputs "out")
  256. "/share/ibus-libpinyin/setup/"))))
  257. #t))))))
  258. (inputs
  259. `(("ibus" ,ibus)
  260. ("libpinyin" ,libpinyin)
  261. ("bdb" ,bdb)
  262. ("sqlite" ,sqlite)
  263. ("opencc" ,opencc)
  264. ("python" ,python)
  265. ("pygobject2" ,python-pygobject)
  266. ("gtk+" ,gtk+)))
  267. (native-inputs
  268. `(("pkg-config" ,pkg-config)
  269. ("intltool" ,intltool)
  270. ("glib" ,glib "bin")))
  271. (synopsis "Chinese pinyin and ZhuYin input methods for IBus")
  272. (description
  273. "This package includes a Chinese pinyin input method and a Chinese
  274. ZhuYin (Bopomofo) input method based on libpinyin for IBus.")
  275. (home-page "https://github.com/libpinyin/ibus-libpinyin")
  276. (license gpl3+)))
  277. (define-public libpinyin
  278. (package
  279. (name "libpinyin")
  280. (version "2.6.0")
  281. (source (origin
  282. (method url-fetch)
  283. (uri (string-append "https://github.com/libpinyin/libpinyin/"
  284. "releases/download/" version
  285. "/libpinyin-" version ".tar.gz"))
  286. (sha256
  287. (base32
  288. "10h5mjgv4ibhispvr3s1k36a4aclx4dcvcc2knd4sg1xibw0dp4w"))))
  289. (build-system gnu-build-system)
  290. (inputs
  291. `(("glib" ,glib)
  292. ("bdb" ,bdb)))
  293. (native-inputs
  294. `(("pkg-config" ,pkg-config)))
  295. (synopsis "Library to handle Chinese pinyin")
  296. (description
  297. "The libpinyin C++ library provides algorithms needed for sentence-based
  298. Chinese pinyin input methods.")
  299. (home-page "https://github.com/libpinyin/libpinyin")
  300. (license gpl2+)))
  301. (define-public ibus-anthy
  302. (package
  303. (name "ibus-anthy")
  304. (version "1.5.9")
  305. (source (origin
  306. (method url-fetch)
  307. (uri (string-append
  308. "https://github.com/ibus/ibus-anthy/releases/download/"
  309. version "/ibus-anthy-" version ".tar.gz"))
  310. (sha256
  311. (base32
  312. "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x"))))
  313. (build-system gnu-build-system)
  314. (arguments
  315. '(#:configure-flags
  316. ;; Use absolute exec path in the anthy.xml.
  317. (list (string-append "--libexecdir=" %output "/libexec"))
  318. #:phases
  319. (modify-phases %standard-phases
  320. (add-after 'install 'wrap-programs
  321. (lambda* (#:key outputs #:allow-other-keys)
  322. (let ((out (assoc-ref outputs "out")))
  323. (for-each
  324. (lambda (prog)
  325. (wrap-program (string-append out "/libexec/" prog)
  326. `("GUIX_PYTHONPATH" ":" prefix
  327. (,(getenv "GUIX_PYTHONPATH")))
  328. `("GI_TYPELIB_PATH" ":" prefix
  329. (,(getenv "GI_TYPELIB_PATH")
  330. ,(string-append out "/lib/girepository-1.0")))))
  331. '("ibus-engine-anthy" "ibus-setup-anthy"))
  332. #t))))))
  333. (native-inputs
  334. `(("gettext" ,gettext-minimal)
  335. ("intltool" ,intltool)
  336. ("pkg-config" ,pkg-config)
  337. ("python" ,python)))
  338. (inputs
  339. `(("anthy" ,anthy)
  340. ("gtk+" ,gtk+)
  341. ("ibus" ,ibus)
  342. ("gobject-introspection" ,gobject-introspection)
  343. ("python-pygobject" ,python-pygobject)))
  344. (synopsis "Anthy Japanese language input method for IBus")
  345. (description "IBus-Anthy is an engine for the input bus \"IBus\"). It
  346. adds the Anthy Japanese language input method to IBus. Because most graphical
  347. applications allow text input via IBus, installing this package will enable
  348. Japanese language input in most graphical applications.")
  349. (home-page "https://github.com/fujiwarat/ibus-anthy")
  350. (license gpl2+)))
  351. (define-public librime
  352. (package
  353. (name "librime")
  354. (version "1.7.3")
  355. (source
  356. (origin
  357. (method git-fetch)
  358. (uri (git-reference
  359. (url "https://github.com/rime/librime")
  360. (commit version)))
  361. (file-name (git-file-name name version))
  362. (sha256
  363. (base32
  364. "0pqk0i3zcii3fx5laj9qzbgd58jvq6wn31j76w4zix2i4b1lqcqv"))
  365. (patches (search-patches "librime-fix-build-with-gcc10.patch"))
  366. (modules '((guix build utils)))
  367. (snippet
  368. '(begin
  369. (delete-file-recursively "thirdparty/src")
  370. (delete-file-recursively "thirdparty/bin")
  371. (delete-file-recursively "thirdparty/include/X11")
  372. #t))))
  373. (build-system cmake-build-system)
  374. (arguments
  375. '(#:phases
  376. (modify-phases %standard-phases
  377. (add-after 'unpack 'patch-source
  378. (lambda _
  379. (substitute* "CMakeLists.txt"
  380. (("include_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/include\\)") "")
  381. (("link_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/lib\\)") ""))
  382. #t)))))
  383. (inputs
  384. `(("boost" ,boost)
  385. ("capnproto" ,capnproto)
  386. ("glog" ,glog)
  387. ("leveldb" ,leveldb)
  388. ("marisa" ,marisa)
  389. ("opencc" ,opencc)
  390. ("yaml-cpp" ,yaml-cpp)))
  391. (native-inputs
  392. `(("googletest" ,googletest)
  393. ("pkg-config" ,pkg-config)
  394. ("xorgproto" ,xorgproto))) ; keysym.h
  395. (home-page "https://rime.im/")
  396. (synopsis "The core library of Rime Input Method Engine")
  397. (description "@dfn{librime} is the core library of Rime Input Method
  398. Engine, which is a lightweight, extensible input method engine supporting
  399. various input schemas including glyph-based input methods, romanization-based
  400. input methods as well as those for Chinese dialects. It has the ability to
  401. compose phrases and sentences intelligently and provide very accurate
  402. traditional Chinese output.")
  403. (license bsd-3)))
  404. (define-public rime-data
  405. (package
  406. (name "rime-data")
  407. (version "0.38.20210802")
  408. (source
  409. (origin
  410. (method git-fetch)
  411. (uri (git-reference
  412. (url "https://github.com/rime/plum")
  413. (commit "0b835e347cad9c2d7038cfe82df5b5d1fe1c0327")))
  414. (file-name "plum-checkout")
  415. (sha256
  416. (base32 "0mja4wyazxdc6fr7pzij5ah4rzwxv4s12s64vfn5ikx1ias1f8ib"))))
  417. (build-system gnu-build-system)
  418. (arguments
  419. `(#:modules ((ice-9 match)
  420. ,@%gnu-build-system-modules)
  421. #:tests? #f ; no tests
  422. #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
  423. #:phases
  424. (modify-phases %standard-phases
  425. (add-after 'unpack 'patch-source
  426. (lambda _
  427. ;; Disable git operations.
  428. (substitute* "scripts/install-packages.sh"
  429. (("^\\s*fetch_or_update_package\\s$") ""))
  430. #t))
  431. ;; Copy Rime schemas into the "package/rime" directory.
  432. (add-after 'unpack 'copy-rime-schemas
  433. (lambda* (#:key inputs #:allow-other-keys)
  434. (let ((dest-dir "package/rime"))
  435. (mkdir-p dest-dir)
  436. (for-each
  437. (match-lambda
  438. ((name . path)
  439. (if (string-prefix? "rime-" name)
  440. (let ((schema (substring name (string-length "rime-"))))
  441. (symlink path (string-append dest-dir "/" schema))))))
  442. inputs))
  443. #t))
  444. (replace 'build
  445. ;; NOTE: Don't build binary Rime schema. Binary Rime schema files
  446. ;; are platform dependent and contain timestamp information.
  447. ;; Therefore they are not reproducible.
  448. (lambda* (#:key make-flags #:allow-other-keys)
  449. (apply invoke "make" "all" make-flags)))
  450. (delete 'configure))))
  451. (inputs
  452. `(("rime-array"
  453. ,(origin
  454. (method git-fetch)
  455. (uri (git-reference
  456. (url "https://github.com/rime/rime-array")
  457. (commit "7a7bfafae966e5f949a23a82ee8594cacf492593")))
  458. (file-name "rime-array-checkout")
  459. (sha256
  460. (base32
  461. "0kw0wyc5f77bv06fixkfvqnibmm80pyifvrhz8f1h411926ny37r"))))
  462. ("rime-bopomofo"
  463. ,(origin
  464. (method git-fetch)
  465. (uri (git-reference
  466. (url "https://github.com/rime/rime-bopomofo")
  467. (commit "c7618f4f5728e1634417e9d02ea50d82b71956ab")))
  468. (file-name "rime-bopomofo-checkout")
  469. (sha256
  470. (base32
  471. "0g77nv0jrwqnbqqna0ib0kqcy6l5zl62kh49ny67d6bjwnwz9186"))))
  472. ("rime-cangjie"
  473. ,(origin
  474. (method git-fetch)
  475. (uri (git-reference
  476. (url "https://github.com/rime/rime-cangjie")
  477. (commit "8dfad9e537f18821b71ba28773315d9c670ae245")))
  478. (file-name "rime-cangjie-checkout")
  479. (sha256
  480. (base32
  481. "029kw9nx6x0acg4f0m8wj1ziqffffhy9yyj51nlx17cnia0qcrby"))))
  482. ("rime-cantonese"
  483. ,(origin
  484. (method git-fetch)
  485. (uri (git-reference
  486. (url "https://github.com/rime/rime-cantonese")
  487. (commit "fa7c8ad19d51143c1a470295d56feeb63e92113f")))
  488. (file-name "rime-cantonese-checkout")
  489. (sha256
  490. (base32
  491. "0vy5vv6h4r4b2msdvdrsj0zr6wmrv0fxm5zyyvxq8f1ix7ignm4c"))))
  492. ("rime-combo-pinyin"
  493. ,(origin
  494. (method git-fetch)
  495. (uri (git-reference
  496. (url "https://github.com/rime/rime-combo-pinyin")
  497. (commit "a84065a86b272c76215215bd6f03c506b6e7097c")))
  498. (file-name "rime-combo-pinyin-checkout")
  499. (sha256
  500. (base32
  501. "1f0b4kakw0x26gmx7xi4f94nbjlb8lvi9bks4f92jswa045vnd87"))))
  502. ("rime-double-pinyin"
  503. ,(origin
  504. (method git-fetch)
  505. (uri (git-reference
  506. (url "https://github.com/rime/rime-double-pinyin")
  507. (commit "69bf85d4dfe8bac139c36abbd68d530b8b6622ea")))
  508. (file-name "rime-double-pinyin-checkout")
  509. (sha256
  510. (base32
  511. "093wif5avvvw45fqbwj5wkbxrychy4pagl4mwsmbrayc8jkp69ak"))))
  512. ("rime-emoji"
  513. ,(origin
  514. (method git-fetch)
  515. (uri (git-reference
  516. (url "https://github.com/rime/rime-emoji")
  517. (commit "4c8c51f4a3bc7298c99376eda9bbd86070fc4fa1")))
  518. (file-name "rime-emoji-checkout")
  519. (sha256
  520. (base32
  521. "0175jqh210fncafqckr9zzaw55qpswmqjrykwms1apmc68l43122"))))
  522. ("rime-essay"
  523. ,(origin
  524. (method git-fetch)
  525. (uri (git-reference
  526. (url "https://github.com/rime/rime-essay")
  527. (commit "9db2e77305e75798baf3ec8dcf1f82785b5e1be9")))
  528. (file-name "rime-essay-checkout")
  529. (sha256
  530. (base32
  531. "03ypkkaadd5qmyg26n24a66cll90xvcimgbmiyv4d33jradiqg22"))))
  532. ("rime-ipa"
  533. ,(origin
  534. (method git-fetch)
  535. (uri (git-reference
  536. (url "https://github.com/rime/rime-ipa")
  537. (commit "22b71710e029bcb412e9197192a638ab11bc2abf")))
  538. (file-name "rime-ipa-checkout")
  539. (sha256
  540. (base32
  541. "0zdk4f9qkfj3q5hmjnairj1lv6f6y27mic12k886n6sxywwbwr2k"))))
  542. ("rime-jyutping"
  543. ,(origin
  544. (method git-fetch)
  545. (uri (git-reference
  546. (url "https://github.com/rime/rime-jyutping")
  547. (commit "1e24baa6998815c716c581effe8ec65ee87c4e8c")))
  548. (file-name "rime-jyutping-checkout")
  549. (sha256
  550. (base32
  551. "0s2rckpwlrm3n7w1csnqyi5p9mkpp3z87s7mrm2vc9sv06rpv7zl"))))
  552. ("rime-luna-pinyin"
  553. ,(origin
  554. (method git-fetch)
  555. (uri (git-reference
  556. (url "https://github.com/rime/rime-luna-pinyin")
  557. (commit "623adb022b094d540218b287c2e601509eee3347")))
  558. (file-name "rime-luna-pinyin-checkout")
  559. (sha256
  560. (base32
  561. "06pcwp09l5wkqv7792gbsl31xnlb3gr9q6bgbp94vvq6m2ycahqz"))))
  562. ("rime-middle-chinese"
  563. ,(origin
  564. (method git-fetch)
  565. (uri (git-reference
  566. (url "https://github.com/rime/rime-middle-chinese")
  567. (commit "9fad7a7c0c26167d5e6e85db8df48a15c7f7d4f0")))
  568. (file-name "rime-middle-chinese-checkout")
  569. (sha256
  570. (base32
  571. "0a0bqrlzg0k692xblqnh1rh1fwwqqb205xwxlihgji85n8ibcgph"))))
  572. ("rime-pinyin-simp"
  573. ,(origin
  574. (method git-fetch)
  575. (uri (git-reference
  576. (url "https://github.com/rime/rime-pinyin-simp")
  577. (commit "b0e84cda02c613ebdedc127a26131b3800f45a8e")))
  578. (file-name "rime-pinyin-simp-checkout")
  579. (sha256
  580. (base32
  581. "05v804qr3a9xvjzp9yid7231fi2l2yrl47ybbvql61z9k36ab094"))))
  582. ("rime-prelude"
  583. ,(origin
  584. (method git-fetch)
  585. (uri (git-reference
  586. (url "https://github.com/rime/rime-prelude")
  587. (commit "3de303ffaa731dba07b0462ce59f4767e1219ad2")))
  588. (file-name "rime-prelude-checkout")
  589. (sha256
  590. (base32
  591. "0g7a0bla58rh1v3md59k6adk185pilb4z8i2i0pqdl4nwqp40n2p"))))
  592. ("rime-quick"
  593. ,(origin
  594. (method git-fetch)
  595. (uri (git-reference
  596. (url "https://github.com/rime/rime-quick")
  597. (commit "3fe5911ba608cb2df1b6301b76ad1573bd482a76")))
  598. (file-name "rime-quick-checkout")
  599. (sha256
  600. (base32
  601. "08bh87ym5qvw55lyw20l3m7jd4c2z5rvil8h5q8790r7z6j6ijy9"))))
  602. ("rime-scj"
  603. ,(origin
  604. (method git-fetch)
  605. (uri (git-reference
  606. (url "https://github.com/rime/rime-scj")
  607. (commit "cab5a0858765eff0553dd685a2d61d5536e9149c")))
  608. (file-name "rime-scj-checkout")
  609. (sha256
  610. (base32
  611. "0ard2bjp4896a8dimmcwyjwgmp9kl4rz92yc92jnd3y4rgwl6fvk"))))
  612. ("rime-soutzoe"
  613. ,(origin
  614. (method git-fetch)
  615. (uri (git-reference
  616. (url "https://github.com/rime/rime-soutzoe")
  617. (commit "beeaeca72d8e17dfd1e9af58680439e9012987dc")))
  618. (file-name "rime-soutzoe-checkout")
  619. (sha256
  620. (base32
  621. "0jyqx0q9s0qxn168l5n8zav8jcl2g5ppr7pa8jm1vwrllf20slcc"))))
  622. ("rime-stenotype"
  623. ,(origin
  624. (method git-fetch)
  625. (uri (git-reference
  626. (url "https://github.com/rime/rime-stenotype")
  627. (commit "f3e9189d5ce33c55d3936cc58e39d0c88b3f0c88")))
  628. (file-name "rime-stenotype-checkout")
  629. (sha256
  630. (base32
  631. "0dl6px7lrh3xa87knjzwzdcwjj1k1dg4l72q7lb48an4s9f1cy5d"))))
  632. ("rime-stroke"
  633. ,(origin
  634. (method git-fetch)
  635. (uri (git-reference
  636. (url "https://github.com/rime/rime-stroke")
  637. (commit "ea8576d1accd6fda339e96b415caadb56e2a07d1")))
  638. (file-name "rime-stroke-checkout")
  639. (sha256
  640. (base32
  641. "07h6nq9867hjrd2v3h1pnr940sdrw4mqrzj43siz1rzjxz3s904r"))))
  642. ("rime-terra-pinyin"
  643. ,(origin
  644. (method git-fetch)
  645. (uri (git-reference
  646. (url "https://github.com/rime/rime-terra-pinyin")
  647. (commit "ce7b9249612f575d2f43d51fcacd31d1b4e0ef1b")))
  648. (file-name "rime-terra-pinyin-checkout")
  649. (sha256
  650. (base32
  651. "0vm303f4lrdmdmif5klrp6w29vn9z2vzw33cw0y83pcnz39wiads"))))
  652. ("rime-wubi"
  653. ,(origin
  654. (method git-fetch)
  655. (uri (git-reference
  656. (url "https://github.com/rime/rime-wubi")
  657. (commit "f1876f08f1d4a9696395be0070c0e8e4353c44cb")))
  658. (file-name "rime-wubi-checkout")
  659. (sha256
  660. (base32
  661. "1d9y9rqssacria9d0hla96czsqv2wkfm6z926m1x269ryv96zxvk"))))
  662. ("rime-wugniu"
  663. ,(origin
  664. (method git-fetch)
  665. (uri (git-reference
  666. (url "https://github.com/rime/rime-wugniu")
  667. (commit "abd1ee98efbf170258fcf43875c21a4259e00b61")))
  668. (file-name "rime-wugniu-checkout")
  669. (sha256
  670. (base32
  671. "0qn54d3cclny106ixdw08r5n6wn52ffs1hgrma3k0j4pv0kr9nlq"))))))
  672. (home-page "https://rime.im/")
  673. (synopsis "Schema data of Rime Input Method Engine")
  674. (description "@dfn{rime-data} provides the schema data of Rime Input
  675. Method Engine.")
  676. (license (list
  677. ;; rime-array
  678. ;; rime-combo-pinyin
  679. ;; rime-double-pinyin
  680. ;; rime-middle-chinese
  681. ;; rime-scj
  682. ;; rime-soutzoe
  683. ;; rime-stenotype
  684. ;; rime-wugniu
  685. gpl3
  686. ;; plum
  687. ;; rime-bopomofo
  688. ;; rime-cangjie
  689. ;; rime-emoji
  690. ;; rime-essay
  691. ;; rime-ipa
  692. ;; rime-jyutping
  693. ;; rime-luna-pinyin
  694. ;; rime-prelude
  695. ;; rime-quick
  696. ;; rime-stroke
  697. ;; rime-terra-pinyin
  698. ;; rime-wubi
  699. lgpl3
  700. ;; rime-pinyin-simp
  701. asl2.0
  702. ;; rime-cantonese
  703. cc-by4.0))))
  704. (define-public ibus-rime
  705. (package
  706. (name "ibus-rime")
  707. (version "1.5.0")
  708. (source
  709. (origin
  710. (method git-fetch)
  711. (uri (git-reference
  712. (url "https://github.com/rime/ibus-rime")
  713. (commit version)))
  714. (file-name (git-file-name name version))
  715. (sha256
  716. (base32 "1vl3m6ydf7mvmalpdqqmrnnmqdi6l8yyac3bv19pp8a5q3qhkwlg"))))
  717. (build-system cmake-build-system)
  718. (arguments
  719. `(#:tests? #f ; no tests
  720. #:configure-flags
  721. (list (string-append "-DRIME_DATA_DIR="
  722. (assoc-ref %build-inputs "rime-data")
  723. "/share/rime-data"))
  724. #:phases
  725. (modify-phases %standard-phases
  726. (add-after 'unpack 'patch-source
  727. (lambda _
  728. (substitute* "CMakeLists.txt"
  729. (("DESTINATION....RIME_DATA_DIR..")
  730. "DESTINATION \"${CMAKE_INSTALL_DATADIR}/rime-data\""))
  731. #t)))))
  732. (inputs
  733. `(("gdk-pixbuf" ,gdk-pixbuf)
  734. ("glib" ,glib)
  735. ("ibus" ,ibus)
  736. ("libnotify" ,libnotify)
  737. ("librime" ,librime)
  738. ("rime-data" ,rime-data)))
  739. (native-inputs
  740. `(("cmake" ,cmake-minimal)
  741. ("pkg-config" ,pkg-config)))
  742. (home-page "https://rime.im/")
  743. (synopsis "Rime Input Method Engine for IBus")
  744. (description "@dfn{ibus-rime} provides the Rime input method engine for
  745. IBus. Rime is a lightweight, extensible input method engine supporting
  746. various input schemas including glyph-based input methods, romanization-based
  747. input methods as well as those for Chinese dialects. It has the ability to
  748. compose phrases and sentences intelligently and provide very accurate
  749. traditional Chinese output.")
  750. (license gpl3)))
  751. (define-public libhangul
  752. (package
  753. (name "libhangul")
  754. (version "0.1.0")
  755. (source
  756. (origin
  757. (method url-fetch)
  758. (uri (string-append "http://kldp.net/hangul/release/"
  759. "3442-libhangul-" version ".tar.gz"))
  760. (sha256
  761. (base32
  762. "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar"))))
  763. (build-system gnu-build-system)
  764. (home-page "https://github.com/libhangul/libhangul")
  765. (synopsis "Library to support hangul input method logic")
  766. (description
  767. "This package provides a library to support hangul input method logic,
  768. hanja dictionary and small hangul character classification.")
  769. (license lgpl2.1+)))
  770. (define-public ibus-libhangul
  771. (package
  772. (name "ibus-libhangul")
  773. (version "1.5.3")
  774. (source
  775. (origin
  776. (method url-fetch)
  777. (uri (string-append "https://github.com/libhangul/ibus-hangul/"
  778. "releases/download/" version
  779. "/ibus-hangul-" version ".tar.gz"))
  780. (sha256
  781. (base32
  782. "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy"))))
  783. (build-system gnu-build-system)
  784. (arguments
  785. `(#:phases
  786. (modify-phases %standard-phases
  787. (add-after 'install 'wrap
  788. (lambda* (#:key inputs outputs #:allow-other-keys)
  789. (wrap-program (string-append (assoc-ref outputs "out")
  790. "/libexec/ibus-setup-hangul")
  791. `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))
  792. `("LD_LIBRARY_PATH" ":" prefix
  793. (,(string-append (assoc-ref inputs "libhangul") "/lib")))
  794. `("GI_TYPELIB_PATH" ":" prefix
  795. (,(getenv "GI_TYPELIB_PATH"))))
  796. #t)))))
  797. (native-inputs
  798. `(("pkg-config" ,pkg-config)
  799. ("gettext" ,gettext-minimal)
  800. ("glib:bin" ,glib "bin")))
  801. (inputs
  802. `(("ibus" ,ibus)
  803. ("glib" ,glib)
  804. ("python-pygobject" ,python-pygobject)
  805. ("gtk+" ,gtk+)
  806. ("libhangul" ,libhangul)
  807. ("python" ,python)))
  808. (home-page "https://github.com/libhangul/ibus-hangul")
  809. (synopsis "Hangul engine for IBus")
  810. (description
  811. "ibus-hangul is a Korean input method engine for IBus.")
  812. (license gpl2+)))