Commit | Line | Data |
---|---|---|
aad6f5bc | 1 | ;;; GNU Guix --- Functional package management for GNU |
dbac4833 | 2 | ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net> |
2e6ecc5c | 3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
1c6ae418 | 4 | ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com> |
66b266e6 | 5 | ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il> |
510d819c | 6 | ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
6072d511 | 7 | ;;; Copyright © 2018, 2019 Meiyo Peng <meiyo@disroot.org> |
94b8fe80 | 8 | ;;; Copyright © 2020 kanichos <kanichos@yandex.ru> |
aad6f5bc RW |
9 | ;;; |
10 | ;;; This file is part of GNU Guix. | |
11 | ;;; | |
12 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
13 | ;;; under the terms of the GNU General Public License as published by | |
14 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
15 | ;;; your option) any later version. | |
16 | ;;; | |
17 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
18 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;;; GNU General Public License for more details. | |
21 | ;;; | |
22 | ;;; You should have received a copy of the GNU General Public License | |
23 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
24 | ||
25 | (define-module (gnu packages ibus) | |
26 | #:use-module (guix licenses) | |
27 | #:use-module (guix packages) | |
28 | #:use-module (guix download) | |
1329f095 | 29 | #:use-module (guix git-download) |
78209a16 | 30 | #:use-module (guix build-system cmake) |
aad6f5bc RW |
31 | #:use-module (guix build-system gnu) |
32 | #:use-module (guix build-system glib-or-gtk) | |
dbac4833 | 33 | #:use-module (guix utils) |
aad6f5bc | 34 | #:use-module (gnu packages) |
1c6ae418 | 35 | #:use-module (gnu packages anthy) |
12edffe4 RW |
36 | #:use-module (gnu packages autotools) |
37 | #:use-module (gnu packages base) | |
78209a16 | 38 | #:use-module (gnu packages boost) |
950ebfd1 | 39 | #:use-module (gnu packages check) |
d5b23d2b | 40 | #:use-module (gnu packages cmake) |
5fbbd29f | 41 | #:use-module (gnu packages databases) |
78209a16 | 42 | #:use-module (gnu packages datastructures) |
255d1bbe | 43 | #:use-module (gnu packages dbm) |
5fbbd29f | 44 | #:use-module (gnu packages freedesktop) |
1c6ae418 | 45 | #:use-module (gnu packages gettext) |
aad6f5bc RW |
46 | #:use-module (gnu packages glib) |
47 | #:use-module (gnu packages gnome) | |
48 | #:use-module (gnu packages gtk) | |
49 | #:use-module (gnu packages iso-codes) | |
78209a16 | 50 | #:use-module (gnu packages logging) |
aad6f5bc | 51 | #:use-module (gnu packages pkg-config) |
d37f00b9 | 52 | #:use-module (gnu packages python) |
78209a16 | 53 | #:use-module (gnu packages serialization) |
cd0322a3 | 54 | #:use-module (gnu packages sqlite) |
78209a16 | 55 | #:use-module (gnu packages textutils) |
0873cce1 | 56 | #:use-module (gnu packages unicode) |
d37f00b9 | 57 | #:use-module (gnu packages xorg)) |
aad6f5bc RW |
58 | |
59 | (define-public ibus | |
60 | (package | |
2f968763 | 61 | (name "ibus") |
fadc4f10 | 62 | (version "1.5.21") |
2f968763 MP |
63 | (source (origin |
64 | (method url-fetch) | |
65 | (uri (string-append "https://github.com/ibus/ibus/" | |
66 | "releases/download/" | |
67 | version "/ibus-" version ".tar.gz")) | |
68 | (sha256 | |
69 | (base32 | |
fadc4f10 | 70 | "1fd2d1jqpp1nn74x04zcilhhab0zar82n0kg614rma6n43kfbhdd")))) |
2f968763 MP |
71 | (build-system glib-or-gtk-build-system) |
72 | (arguments | |
73 | `(#:tests? #f ; tests fail because there's no connection to dbus | |
933bb1ac | 74 | #:parallel-build? #f ; race condition discovered with emoji support |
0873cce1 LP |
75 | #:configure-flags (list "--enable-python-library" |
76 | (string-append | |
77 | "--with-unicode-emoji-dir=" | |
78 | (assoc-ref %build-inputs "unicode-emoji") | |
79 | "/share/unicode/emoji") | |
80 | (string-append | |
81 | "--with-emoji-annotation-dir=" | |
82 | (assoc-ref %build-inputs "unicode-cldr-common") | |
83 | "/share/unicode/cldr/common/annotations") | |
84 | (string-append "--with-ucd-dir=" | |
a9e5e649 LP |
85 | (assoc-ref %build-inputs "ucd") |
86 | "/share/ucd") | |
0873cce1 | 87 | "--enable-wayland") |
2f968763 MP |
88 | #:phases |
89 | (modify-phases %standard-phases | |
b2c6b467 RW |
90 | (add-after 'unpack 'patch-python-target-directories |
91 | (lambda* (#:key outputs #:allow-other-keys) | |
92 | (let ((root (string-append (assoc-ref outputs "out") | |
93 | "/lib/python" | |
94 | ,(version-major+minor (package-version python)) | |
95 | "/site-packages"))) | |
96 | (substitute* "configure" | |
97 | (("(py2?overridesdir)=.*" _ var) | |
98 | (string-append var "=" root "/gi/overrides/")) | |
99 | (("(pkgpython2dir=).*" _ var) | |
100 | (string-append var root "/ibus")))) | |
101 | #t)) | |
2f968763 MP |
102 | (add-before 'configure 'disable-dconf-update |
103 | (lambda _ | |
104 | (substitute* "data/dconf/Makefile.in" | |
105 | (("dconf update") "echo dconf update")) | |
106 | #t)) | |
107 | (add-after 'unpack 'delete-generated-files | |
108 | (lambda _ | |
109 | (for-each (lambda (file) | |
110 | (let ((c (string-append (string-drop-right file 4) "c"))) | |
111 | (when (file-exists? c) | |
112 | (format #t "deleting ~a\n" c) | |
113 | (delete-file c)))) | |
114 | (find-files "." "\\.vala")) | |
115 | #t)) | |
116 | (add-after 'unpack 'fix-paths | |
117 | (lambda* (#:key inputs #:allow-other-keys) | |
118 | (substitute* "src/ibusenginesimple.c" | |
119 | (("/usr/share/X11/locale") | |
120 | (string-append (assoc-ref inputs "libx11") | |
121 | "/share/X11/locale"))) | |
122 | (substitute* "ui/gtk3/xkblayout.vala" | |
123 | (("\"(setxkbmap|xmodmap)\"" _ prog) | |
92d7f5b4 | 124 | (string-append "\"" (assoc-ref inputs prog) "/bin/" prog "\""))) |
2f968763 MP |
125 | #t)) |
126 | (add-after 'wrap-program 'wrap-with-additional-paths | |
127 | (lambda* (#:key outputs #:allow-other-keys) | |
128 | ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and | |
129 | ;; GI_TYPELIB_PATH. | |
130 | (let ((out (assoc-ref outputs "out"))) | |
131 | (wrap-program (string-append out "/bin/ibus-setup") | |
132 | `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))) | |
133 | `("GI_TYPELIB_PATH" ":" prefix | |
134 | (,(getenv "GI_TYPELIB_PATH") | |
135 | ,(string-append out "/lib/girepository-1.0"))))) | |
136 | #t))))) | |
137 | (inputs | |
138 | `(("dbus" ,dbus) | |
139 | ("dconf" ,dconf) | |
140 | ("gconf" ,gconf) | |
141 | ("gtk2" ,gtk+-2) | |
142 | ("gtk+" ,gtk+) | |
b2c6b467 | 143 | ("gettext" ,gnu-gettext) |
2f968763 MP |
144 | ("json-glib" ,json-glib) |
145 | ("libnotify" ,libnotify) | |
146 | ("libx11" ,libx11) | |
147 | ("setxkbmap" ,setxkbmap) | |
148 | ("wayland" ,wayland) | |
149 | ("xmodmap" ,xmodmap) | |
150 | ("iso-codes" ,iso-codes) | |
151 | ("pygobject2" ,python-pygobject) | |
152 | ("python" ,python))) | |
153 | (native-inputs | |
154 | `(("glib" ,glib "bin") ; for glib-genmarshal | |
155 | ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler | |
a9e5e649 | 156 | ("ucd" ,ucd) |
0873cce1 LP |
157 | ("unicode-emoji" ,unicode-emoji) |
158 | ("unicode-cldr-common" ,unicode-cldr-common) | |
2f968763 MP |
159 | ("vala" ,vala) |
160 | ("pkg-config" ,pkg-config))) | |
161 | (native-search-paths | |
162 | (list (search-path-specification | |
163 | (variable "IBUS_COMPONENT_PATH") | |
164 | (files '("share/ibus/component"))))) | |
165 | (synopsis "Input method framework") | |
166 | (description | |
167 | "IBus is an input framework providing a full-featured and user-friendly | |
aad6f5bc RW |
168 | input method user interface. It comes with multilingual input support. It |
169 | may also simplify input method development.") | |
2f968763 MP |
170 | (home-page "https://github.com/ibus/ibus/wiki") |
171 | (license lgpl2.1+))) | |
12edffe4 | 172 | |
5fbbd29f RW |
173 | (define-public ibus-libpinyin |
174 | (package | |
2f968763 | 175 | (name "ibus-libpinyin") |
510d819c | 176 | (version "1.11.1") |
2f968763 MP |
177 | (source (origin |
178 | (method url-fetch) | |
179 | (uri (string-append "https://github.com/libpinyin/ibus-libpinyin/" | |
180 | "releases/download/" version | |
181 | "/ibus-libpinyin-" version ".tar.gz")) | |
182 | (sha256 | |
183 | (base32 | |
510d819c | 184 | "1bl1cgicd2df797dx1x0q904438bsn8i23djzcfcai4dp3631xc0")))) |
2f968763 MP |
185 | (build-system glib-or-gtk-build-system) |
186 | (arguments | |
187 | `(#:phases | |
188 | (modify-phases %standard-phases | |
189 | (add-after 'wrap-program 'wrap-with-additional-paths | |
190 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
191 | ;; Make sure 'ibus-setup-libpinyin' runs with the correct | |
192 | ;; PYTHONPATH and GI_TYPELIB_PATH. | |
193 | (let ((out (assoc-ref outputs "out"))) | |
194 | (wrap-program (string-append out "/libexec/ibus-setup-libpinyin") | |
195 | `("PYTHONPATH" ":" prefix | |
196 | (,(getenv "PYTHONPATH") | |
197 | ,(string-append (assoc-ref inputs "ibus") | |
198 | "/lib/girepository-1.0"))) | |
199 | `("GI_TYPELIB_PATH" ":" prefix | |
200 | (,(string-append (assoc-ref inputs "ibus") | |
201 | "/lib/girepository-1.0")))) | |
202 | #t)))))) | |
203 | (inputs | |
204 | `(("ibus" ,ibus) | |
205 | ("libpinyin" ,libpinyin) | |
206 | ("bdb" ,bdb) | |
207 | ("sqlite" ,sqlite) | |
208 | ("python" ,python) | |
209 | ("pyxdg" ,python-pyxdg) | |
afabb9ec | 210 | ("pygobject2" ,python-pygobject) |
2f968763 MP |
211 | ("gtk+" ,gtk+))) |
212 | (native-inputs | |
213 | `(("pkg-config" ,pkg-config) | |
214 | ("intltool" ,intltool) | |
215 | ("glib" ,glib "bin"))) | |
216 | (synopsis "Chinese pinyin and ZhuYin input methods for IBus") | |
217 | (description | |
218 | "This package includes a Chinese pinyin input method and a Chinese | |
5fbbd29f | 219 | ZhuYin (Bopomofo) input method based on libpinyin for IBus.") |
2f968763 MP |
220 | (home-page "https://github.com/libpinyin/ibus-libpinyin") |
221 | (license gpl2+))) | |
5fbbd29f | 222 | |
12edffe4 RW |
223 | (define-public libpinyin |
224 | (package | |
225 | (name "libpinyin") | |
44613030 | 226 | (version "2.3.0") |
12edffe4 RW |
227 | (source (origin |
228 | (method url-fetch) | |
8738c2b3 RW |
229 | (uri (string-append "https://github.com/libpinyin/libpinyin/" |
230 | "releases/download/" version | |
44613030 | 231 | "/libpinyin-" version ".tar.gz")) |
12edffe4 RW |
232 | (sha256 |
233 | (base32 | |
44613030 | 234 | "14969v6w8n1aiqphl2386dws7dmsdwbzyqnlz4kr8ppm39m9rp5k")))) |
12edffe4 | 235 | (build-system gnu-build-system) |
12edffe4 RW |
236 | (inputs |
237 | `(("glib" ,glib) | |
8738c2b3 | 238 | ("bdb" ,bdb))) |
12edffe4 | 239 | (native-inputs |
8738c2b3 | 240 | `(("pkg-config" ,pkg-config))) |
1f7a84dc | 241 | (synopsis "Library to handle Chinese pinyin") |
12edffe4 RW |
242 | (description |
243 | "The libpinyin C++ library provides algorithms needed for sentence-based | |
244 | Chinese pinyin input methods.") | |
245 | (home-page "https://github.com/libpinyin/libpinyin") | |
246 | (license gpl2+))) | |
1c6ae418 CM |
247 | |
248 | (define-public ibus-anthy | |
249 | (package | |
250 | (name "ibus-anthy") | |
ab84c13f | 251 | (version "1.5.9") |
1c6ae418 CM |
252 | (source (origin |
253 | (method url-fetch) | |
254 | (uri (string-append | |
255 | "https://github.com/ibus/ibus-anthy/releases/download/" | |
256 | version "/ibus-anthy-" version ".tar.gz")) | |
257 | (sha256 | |
258 | (base32 | |
ab84c13f | 259 | "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x")))) |
1c6ae418 CM |
260 | (build-system gnu-build-system) |
261 | (arguments | |
262 | '(#:configure-flags | |
263 | ;; Use absolute exec path in the anthy.xml. | |
264 | (list (string-append "--libexecdir=" %output "/libexec")) | |
265 | #:phases | |
266 | (modify-phases %standard-phases | |
267 | (add-after 'install 'wrap-programs | |
268 | (lambda* (#:key outputs #:allow-other-keys) | |
269 | (let ((out (assoc-ref outputs "out"))) | |
270 | (for-each | |
271 | (lambda (prog) | |
272 | (wrap-program (string-append out "/libexec/" prog) | |
273 | `("PYTHONPATH" ":" prefix | |
274 | (,(getenv "PYTHONPATH"))) | |
275 | `("GI_TYPELIB_PATH" ":" prefix | |
276 | (,(getenv "GI_TYPELIB_PATH") | |
277 | ,(string-append out "/lib/girepository-1.0"))))) | |
278 | '("ibus-engine-anthy" "ibus-setup-anthy")) | |
279 | #t)))))) | |
280 | (native-inputs | |
b94a6ca0 | 281 | `(("gettext" ,gettext-minimal) |
1c6ae418 CM |
282 | ("intltool" ,intltool) |
283 | ("pkg-config" ,pkg-config) | |
284 | ("python" ,python))) | |
285 | (inputs | |
286 | `(("anthy" ,anthy) | |
287 | ("gtk+" ,gtk+) | |
288 | ("ibus" ,ibus) | |
289 | ("gobject-introspection" ,gobject-introspection) | |
290 | ("python-pygobject" ,python-pygobject))) | |
291 | (synopsis "Anthy Japanese language input method for IBus") | |
292 | (description "IBus-Anthy is an engine for the input bus \"IBus\"). It | |
293 | adds the Anthy Japanese language input method to IBus. Because most graphical | |
294 | applications allow text input via IBus, installing this package will enable | |
295 | Japanese language input in most graphical applications.") | |
296 | (home-page "https://github.com/fujiwarat/ibus-anthy") | |
297 | (license gpl2+))) | |
78209a16 MP |
298 | |
299 | (define-public librime | |
300 | (package | |
301 | (name "librime") | |
ca49d732 | 302 | (version "1.5.3") |
78209a16 MP |
303 | (source |
304 | (origin | |
86374285 RW |
305 | (method git-fetch) |
306 | (uri (git-reference | |
307 | (url "https://github.com/rime/librime.git") | |
308 | (commit version))) | |
309 | (file-name (git-file-name name version)) | |
78209a16 | 310 | (sha256 |
950ebfd1 | 311 | (base32 |
ca49d732 | 312 | "0xskhdhk7dgpc71r39pfzxi5vrlzy90aqj1gzv8nnapq91p2awhv")) |
950ebfd1 EF |
313 | (modules '((guix build utils))) |
314 | (snippet | |
315 | '(begin | |
316 | (delete-file-recursively "thirdparty/src") | |
317 | (delete-file-recursively "thirdparty/bin") | |
318 | (delete-file-recursively "thirdparty/include/X11") | |
319 | #t)))) | |
78209a16 | 320 | (build-system cmake-build-system) |
950ebfd1 | 321 | (arguments |
51d4c79d | 322 | '(#:phases |
950ebfd1 EF |
323 | (modify-phases %standard-phases |
324 | (add-after 'unpack 'patch-source | |
325 | (lambda _ | |
326 | (substitute* "CMakeLists.txt" | |
327 | (("include_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/include\\)") "") | |
328 | (("link_directories\\($\\{PROJECT_SOURCE_DIR\\}/thirdparty/lib\\)") "")) | |
329 | #t))))) | |
78209a16 MP |
330 | (inputs |
331 | `(("boost" ,boost) | |
332 | ("glog" ,glog) | |
333 | ("leveldb" ,leveldb) | |
334 | ("marisa" ,marisa) | |
335 | ("opencc" ,opencc) | |
336 | ("yaml-cpp" ,yaml-cpp))) | |
950ebfd1 EF |
337 | (native-inputs |
338 | `(("googletest" ,googletest) | |
339 | ("xorgproto" ,xorgproto))) ; keysym.h | |
78209a16 MP |
340 | (home-page "https://rime.im/") |
341 | (synopsis "The core library of Rime Input Method Engine") | |
342 | (description "@dfn{librime} is the core library of Rime Input Method | |
343 | Engine, which is a lightweight, extensible input method engine supporting | |
344 | various input schemas including glyph-based input methods, romanization-based | |
345 | input methods as well as those for Chinese dialects. It has the ability to | |
346 | compose phrases and sentences intelligently and provide very accurate | |
347 | traditional Chinese output.") | |
348 | (license bsd-3))) | |
1329f095 MP |
349 | |
350 | (define-public rime-data | |
351 | (package | |
352 | (name "rime-data") | |
775e81b5 | 353 | (version "0.38.20190131") |
1329f095 MP |
354 | (source |
355 | (origin | |
356 | (method git-fetch) | |
357 | (uri (git-reference | |
358 | (url "https://github.com/rime/plum.git") | |
775e81b5 | 359 | (commit "8b48688cd4610d0c9223eb68831a31b6134e4cc8"))) |
1329f095 MP |
360 | (file-name "plum-checkout") |
361 | (sha256 | |
775e81b5 | 362 | (base32 "0fv3hv4av9y7afxijh1n8idnyf82v9rxxi2ypmxd7lkj4naa22qh")))) |
1329f095 MP |
363 | (build-system gnu-build-system) |
364 | (arguments | |
365 | `(#:tests? #f ; no tests | |
366 | #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
367 | "no_update=1") | |
368 | #:phases | |
369 | (modify-phases %standard-phases | |
370 | (add-after 'unpack 'patch-source | |
371 | (lambda _ | |
372 | ;; Set .DEFAULT_GOAL to `all'. | |
373 | ;; Don't build binary schemas. The output is not deterministic. | |
374 | (substitute* "Makefile" | |
375 | (("^\\.DEFAULT_GOAL := preset") | |
376 | ".DEFAULT_GOAL := all")) | |
377 | #t)) | |
378 | ;; Add schema packages into "package/rime" directory. | |
379 | (add-after 'unpack 'add-packages | |
380 | (lambda* (#:key inputs #:allow-other-keys) | |
381 | (let* ((dest-dir "package/rime")) | |
382 | (mkdir-p dest-dir) | |
383 | (for-each (lambda (pkg) | |
775e81b5 MP |
384 | (symlink (assoc-ref inputs |
385 | (string-append "rime-" pkg)) | |
1329f095 MP |
386 | (string-append dest-dir "/" pkg))) |
387 | '("array" | |
388 | "bopomofo" | |
389 | "cangjie" | |
390 | "combo-pinyin" | |
391 | "double-pinyin" | |
392 | "emoji" | |
393 | "essay" | |
394 | "ipa" | |
395 | "jyutping" | |
396 | "luna-pinyin" | |
397 | "middle-chinese" | |
398 | "pinyin-simp" | |
399 | "prelude" | |
400 | "quick" | |
401 | "scj" | |
402 | "soutzoe" | |
403 | "stenotype" | |
404 | "stroke" | |
405 | "terra-pinyin" | |
406 | "wubi" | |
407 | "wugniu"))) | |
408 | #t)) | |
409 | (delete 'configure)))) | |
410 | (native-inputs | |
775e81b5 | 411 | `(("rime-array" |
1329f095 MP |
412 | ,(origin |
413 | (method git-fetch) | |
414 | (uri (git-reference | |
415 | (url "https://github.com/rime/rime-array.git") | |
775e81b5 | 416 | (commit "93cc99238f120606a076220ec4ddcad164f6396a"))) |
1329f095 MP |
417 | (file-name "rime-array-checkout") |
418 | (sha256 | |
419 | (base32 | |
775e81b5 MP |
420 | "06yxrv3x702751jvx46rfw3ix34jk7jh183rz6bllznzi7lxz7sz")))) |
421 | ("rime-bopomofo" | |
1329f095 MP |
422 | ,(origin |
423 | (method git-fetch) | |
424 | (uri (git-reference | |
425 | (url "https://github.com/rime/rime-bopomofo.git") | |
775e81b5 | 426 | (commit "ed25098386f5efd3d70b08650f0d1b70c41c11a3"))) |
1329f095 MP |
427 | (file-name "rime-bopomofo-checkout") |
428 | (sha256 | |
429 | (base32 | |
775e81b5 MP |
430 | "1ip1pbfb1hadf2mcymr5939iagf25ywfl67d9198jahzyr6rdyvc")))) |
431 | ("rime-cangjie" | |
1329f095 MP |
432 | ,(origin |
433 | (method git-fetch) | |
434 | (uri (git-reference | |
435 | (url "https://github.com/rime/rime-cangjie.git") | |
775e81b5 | 436 | (commit "5fd8ce6f64039e505ca02655a621f2e830b97c19"))) |
1329f095 MP |
437 | (file-name "rime-cangjie-checkout") |
438 | (sha256 | |
439 | (base32 | |
775e81b5 MP |
440 | "1gf6r0q593ixar6v0jyvs56cik2gjp7pf9v799rfd2yydyia3bfg")))) |
441 | ("rime-combo-pinyin" | |
1329f095 MP |
442 | ,(origin |
443 | (method git-fetch) | |
444 | (uri (git-reference | |
445 | (url "https://github.com/rime/rime-combo-pinyin.git") | |
775e81b5 | 446 | (commit "9bd952b964e9744e5d18e9e31625b50f3585a2cb"))) |
1329f095 MP |
447 | (file-name "rime-combo-pinyin-checkout") |
448 | (sha256 | |
449 | (base32 | |
775e81b5 MP |
450 | "0crafjs39x4j221gb34mxxh3cdpxfhhx3nfw6b6bgkzlrp35a02b")))) |
451 | ("rime-double-pinyin" | |
1329f095 MP |
452 | ,(origin |
453 | (method git-fetch) | |
454 | (uri (git-reference | |
455 | (url "https://github.com/rime/rime-double-pinyin.git") | |
775e81b5 | 456 | (commit "69bf85d4dfe8bac139c36abbd68d530b8b6622ea"))) |
1329f095 MP |
457 | (file-name "rime-double-pinyin-checkout") |
458 | (sha256 | |
459 | (base32 | |
775e81b5 MP |
460 | "093wif5avvvw45fqbwj5wkbxrychy4pagl4mwsmbrayc8jkp69ak")))) |
461 | ("rime-emoji" | |
1329f095 MP |
462 | ,(origin |
463 | (method git-fetch) | |
464 | (uri (git-reference | |
465 | (url "https://github.com/rime/rime-emoji.git") | |
775e81b5 | 466 | (commit "c8d67f9b50bf89a10c57da646d2e6db8799aef38"))) |
1329f095 MP |
467 | (file-name "rime-emoji-checkout") |
468 | (sha256 | |
469 | (base32 | |
775e81b5 MP |
470 | "0ngcm088iyyp3llxvv0m80i7n5928d6cgh256ikhn3ixallxxdxv")))) |
471 | ("rime-essay" | |
1329f095 MP |
472 | ,(origin |
473 | (method git-fetch) | |
474 | (uri (git-reference | |
475 | (url "https://github.com/rime/rime-essay.git") | |
775e81b5 | 476 | (commit "71d0b1f3d4f3bfe61ae07581edf07579740c4421"))) |
1329f095 MP |
477 | (file-name "rime-essay-checkout") |
478 | (sha256 | |
479 | (base32 | |
775e81b5 MP |
480 | "1iwz104k7zfk7lpa257kvpqdr6jhbg3p76n3644ywiz4l7kc678i")))) |
481 | ("rime-ipa" | |
1329f095 MP |
482 | ,(origin |
483 | (method git-fetch) | |
484 | (uri (git-reference | |
485 | (url "https://github.com/rime/rime-ipa.git") | |
775e81b5 | 486 | (commit "e420c7bfb07153a2d2484eb2bdccdd719811abbb"))) |
1329f095 MP |
487 | (file-name "rime-ipa-checkout") |
488 | (sha256 | |
489 | (base32 | |
775e81b5 MP |
490 | "1wfv7lb4y61b3qic5mhw92rn46cckldd9wrkcq03mg5512mbw63z")))) |
491 | ("rime-jyutping" | |
1329f095 MP |
492 | ,(origin |
493 | (method git-fetch) | |
494 | (uri (git-reference | |
495 | (url "https://github.com/rime/rime-jyutping.git") | |
775e81b5 | 496 | (commit "04891a298319888e8c6b1a20e0fa81cfaea01264"))) |
1329f095 MP |
497 | (file-name "rime-jyutping-checkout") |
498 | (sha256 | |
499 | (base32 | |
775e81b5 MP |
500 | "0wsj965khglz36cnvfm4fkv386xvxhmsxgcw88p5qi0b3wlbzzx6")))) |
501 | ("rime-luna-pinyin" | |
1329f095 MP |
502 | ,(origin |
503 | (method git-fetch) | |
504 | (uri (git-reference | |
505 | (url "https://github.com/rime/rime-luna-pinyin.git") | |
775e81b5 | 506 | (commit "c9c405566177cb3898bdb82d7f4157587f2d9c01"))) |
1329f095 MP |
507 | (file-name "rime-luna-pinyin-checkout") |
508 | (sha256 | |
509 | (base32 | |
775e81b5 MP |
510 | "0i7f2675lvj9pzwlm8550ifnr3xqi77xlyyvml1wpxpkfqhjr475")))) |
511 | ("rime-middle-chinese" | |
1329f095 MP |
512 | ,(origin |
513 | (method git-fetch) | |
514 | (uri (git-reference | |
515 | (url "https://github.com/rime/rime-middle-chinese.git") | |
775e81b5 | 516 | (commit "ed6d44f8d0bedf6e0c1c3183a270f8f01a211a40"))) |
1329f095 MP |
517 | (file-name "rime-middle-chinese-checkout") |
518 | (sha256 | |
519 | (base32 | |
775e81b5 MP |
520 | "09mql88lsrxa99pyllby5z22kaiwwa037ha8gwaxjnnlsjgvz7zx")))) |
521 | ("rime-pinyin-simp" | |
1329f095 MP |
522 | ,(origin |
523 | (method git-fetch) | |
524 | (uri (git-reference | |
525 | (url "https://github.com/rime/rime-pinyin-simp.git") | |
775e81b5 | 526 | (commit "bb5a6dfa871669d2f451b477bfff6d131df6f6c6"))) |
1329f095 MP |
527 | (file-name "rime-pinyin-simp-checkout") |
528 | (sha256 | |
529 | (base32 | |
775e81b5 MP |
530 | "0ss82042k833w5q72h72ghcfchkx00nx6l4z4fb861s2rxr0bkjd")))) |
531 | ("rime-prelude" | |
1329f095 MP |
532 | ,(origin |
533 | (method git-fetch) | |
534 | (uri (git-reference | |
535 | (url "https://github.com/rime/rime-prelude.git") | |
775e81b5 | 536 | (commit "8a52b4f86a59f3eb602f9a4cf6a680a67c15df8c"))) |
1329f095 MP |
537 | (file-name "rime-prelude-checkout") |
538 | (sha256 | |
539 | (base32 | |
775e81b5 MP |
540 | "039fr3996vfxzn2milaq1f5fw08f6zgjsxsql6cfhsc5b55fidm7")))) |
541 | ("rime-quick" | |
1329f095 MP |
542 | ,(origin |
543 | (method git-fetch) | |
544 | (uri (git-reference | |
545 | (url "https://github.com/rime/rime-quick.git") | |
775e81b5 | 546 | (commit "3fe5911ba608cb2df1b6301b76ad1573bd482a76"))) |
1329f095 MP |
547 | (file-name "rime-quick-checkout") |
548 | (sha256 | |
549 | (base32 | |
775e81b5 MP |
550 | "08bh87ym5qvw55lyw20l3m7jd4c2z5rvil8h5q8790r7z6j6ijy9")))) |
551 | ("rime-scj" | |
1329f095 MP |
552 | ,(origin |
553 | (method git-fetch) | |
554 | (uri (git-reference | |
555 | (url "https://github.com/rime/rime-scj.git") | |
775e81b5 | 556 | (commit "cab5a0858765eff0553dd685a2d61d5536e9149c"))) |
1329f095 MP |
557 | (file-name "rime-scj-checkout") |
558 | (sha256 | |
559 | (base32 | |
775e81b5 MP |
560 | "0ard2bjp4896a8dimmcwyjwgmp9kl4rz92yc92jnd3y4rgwl6fvk")))) |
561 | ("rime-soutzoe" | |
1329f095 MP |
562 | ,(origin |
563 | (method git-fetch) | |
564 | (uri (git-reference | |
565 | (url "https://github.com/rime/rime-soutzoe.git") | |
775e81b5 | 566 | (commit "beeaeca72d8e17dfd1e9af58680439e9012987dc"))) |
1329f095 MP |
567 | (file-name "rime-soutzoe-checkout") |
568 | (sha256 | |
569 | (base32 | |
775e81b5 MP |
570 | "0jyqx0q9s0qxn168l5n8zav8jcl2g5ppr7pa8jm1vwrllf20slcc")))) |
571 | ("rime-stenotype" | |
1329f095 MP |
572 | ,(origin |
573 | (method git-fetch) | |
574 | (uri (git-reference | |
575 | (url "https://github.com/rime/rime-stenotype.git") | |
775e81b5 | 576 | (commit "1d472097c32d943d1096644f4c31f28799a17bd8"))) |
1329f095 MP |
577 | (file-name "rime-stenotype-checkout") |
578 | (sha256 | |
579 | (base32 | |
775e81b5 MP |
580 | "1dy9qlbyhnshq2k1vcvkqn2624r96iaixhyrx1z7v0vz84fjf6y4")))) |
581 | ("rime-stroke" | |
1329f095 MP |
582 | ,(origin |
583 | (method git-fetch) | |
584 | (uri (git-reference | |
585 | (url "https://github.com/rime/rime-stroke.git") | |
775e81b5 | 586 | (commit "f802735392b378fb2a56a9b7b53b8ec96a30ccaf"))) |
1329f095 MP |
587 | (file-name "rime-stroke-checkout") |
588 | (sha256 | |
589 | (base32 | |
775e81b5 MP |
590 | "1wlrsskxhldh8369n771gk7sxflzdx0c9qhq1mqm5hhkwc5ig1j0")))) |
591 | ("rime-terra-pinyin" | |
1329f095 MP |
592 | ,(origin |
593 | (method git-fetch) | |
594 | (uri (git-reference | |
595 | (url "https://github.com/rime/rime-terra-pinyin.git") | |
775e81b5 | 596 | (commit "b9e0edd3182e74b26b03a278c038e669ca538a35"))) |
1329f095 MP |
597 | (file-name "rime-terra-pinyin-checkout") |
598 | (sha256 | |
599 | (base32 | |
775e81b5 MP |
600 | "1vzrv2k178bii4ld9rvpdi8zmcwybd8bks0qzjx2v4kbjgwj28zk")))) |
601 | ("rime-wubi" | |
1329f095 MP |
602 | ,(origin |
603 | (method git-fetch) | |
604 | (uri (git-reference | |
605 | (url "https://github.com/rime/rime-wubi.git") | |
775e81b5 | 606 | (commit "dd052ee158a38cb791755318b1aef9b4a3ed0316"))) |
1329f095 MP |
607 | (file-name "rime-wubi-checkout") |
608 | (sha256 | |
609 | (base32 | |
775e81b5 MP |
610 | "00xzv3sbwqh2jz4i7s315h7rw17qa2dgj7kflyy3blxk0s2cqiqa")))) |
611 | ("rime-wugniu" | |
1329f095 MP |
612 | ,(origin |
613 | (method git-fetch) | |
614 | (uri (git-reference | |
615 | (url "https://github.com/rime/rime-wugniu.git") | |
775e81b5 | 616 | (commit "abd1ee98efbf170258fcf43875c21a4259e00b61"))) |
1329f095 MP |
617 | (file-name "rime-wugniu-checkout") |
618 | (sha256 | |
619 | (base32 | |
775e81b5 | 620 | "0qn54d3cclny106ixdw08r5n6wn52ffs1hgrma3k0j4pv0kr9nlq")))))) |
1329f095 MP |
621 | (home-page "https://rime.im/") |
622 | (synopsis "Schema data of Rime Input Method Engine") | |
623 | (description "@dfn{rime-data} provides the schema data of Rime Input | |
624 | Method Engine.") | |
625 | (license lgpl3+))) | |
d5b23d2b MP |
626 | |
627 | (define-public ibus-rime | |
628 | (package | |
629 | (name "ibus-rime") | |
f7a25b50 | 630 | (version "1.4.0") |
d5b23d2b MP |
631 | (source |
632 | (origin | |
487e3f5a RW |
633 | (method git-fetch) |
634 | (uri (git-reference | |
635 | (url "https://github.com/rime/ibus-rime.git") | |
636 | (commit version))) | |
637 | (file-name (git-file-name name version)) | |
d5b23d2b | 638 | (sha256 |
f7a25b50 | 639 | (base32 "12y6jdz1amhgrnqa7zjim63dfsz6zyxyahbirfan37wmcfp6gp1d")))) |
d5b23d2b MP |
640 | (build-system gnu-build-system) |
641 | (arguments | |
642 | `(#:tests? #f ; no tests | |
643 | #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
644 | #:phases | |
645 | (modify-phases %standard-phases | |
646 | (add-after 'unpack 'patch-source | |
647 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
648 | ;; Define RIME_DATA_DIR. It's required but not used by the code. | |
649 | (substitute* "Makefile" | |
650 | (("cmake") | |
651 | (string-append "cmake -DRIME_DATA_DIR=" | |
652 | (assoc-ref inputs "rime-data") | |
653 | "/share/rime-data"))) | |
654 | ;; rime_config.h defines the actual data directory. | |
655 | (substitute* "rime_config.h" | |
656 | (("^#define IBUS_RIME_INSTALL_PREFIX .*$") | |
657 | (string-append "#define IBUS_RIME_INSTALL_PREFIX \"" | |
658 | (assoc-ref outputs "out") | |
659 | "\"\n")) | |
660 | (("^#define IBUS_RIME_SHARED_DATA_DIR .*$") | |
661 | (string-append "#define IBUS_RIME_SHARED_DATA_DIR \"" | |
662 | (assoc-ref inputs "rime-data") | |
663 | "/share/rime-data\"\n"))) | |
664 | #t)) | |
562b4e47 | 665 | (add-after 'unpack 'fix-file-names |
666 | (lambda* (#:key outputs #:allow-other-keys) | |
667 | ;; IBus uses the component file rime.xml to start the Rime | |
668 | ;; engine. It must be patched with appropriate file names. | |
669 | (substitute* "rime.xml" | |
670 | (("/usr") (assoc-ref outputs "out"))) | |
671 | #t)) | |
d5b23d2b MP |
672 | (delete 'configure)))) |
673 | (inputs | |
674 | `(("gdk-pixbuf" ,gdk-pixbuf) | |
675 | ("glib" ,glib) | |
676 | ("ibus" ,ibus) | |
677 | ("libnotify" ,libnotify) | |
678 | ("librime" ,librime) | |
679 | ("rime-data" ,rime-data))) | |
680 | (native-inputs | |
c69959f0 | 681 | `(("cmake" ,cmake-minimal) |
d5b23d2b MP |
682 | ("pkg-config" ,pkg-config))) |
683 | (home-page "https://rime.im/") | |
684 | (synopsis "Rime Input Method Engine for IBus") | |
685 | (description "@dfn{ibus-rime} provides the Rime input method engine for | |
686 | IBus. Rime is a lightweight, extensible input method engine supporting | |
687 | various input schemas including glyph-based input methods, romanization-based | |
688 | input methods as well as those for Chinese dialects. It has the ability to | |
689 | compose phrases and sentences intelligently and provide very accurate | |
690 | traditional Chinese output.") | |
691 | (license gpl3+))) | |
94b8fe80 | 692 | |
693 | (define-public libhangul | |
694 | (package | |
695 | (name "libhangul") | |
696 | (version "0.1.0") | |
697 | (source | |
698 | (origin | |
699 | (method url-fetch) | |
700 | (uri (string-append "http://kldp.net/hangul/release/" | |
701 | "3442-libhangul-" version ".tar.gz")) | |
702 | (sha256 | |
703 | (base32 | |
704 | "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar")))) | |
705 | (build-system gnu-build-system) | |
706 | (home-page "https://github.com/libhangul/libhangul") | |
707 | (synopsis "Library to support hangul input method logic") | |
708 | (description | |
709 | "This package provides a library to support hangul input method logic, | |
710 | hanja dictionary and small hangul character classification.") | |
711 | (license lgpl2.1+))) | |
30208c10 | 712 | |
713 | (define-public ibus-libhangul | |
714 | (package | |
715 | (name "ibus-libhangul") | |
716 | (version "1.5.3") | |
717 | (source | |
718 | (origin | |
719 | (method url-fetch) | |
720 | (uri (string-append "https://github.com/libhangul/ibus-hangul/" | |
721 | "releases/download/" version | |
722 | "/ibus-hangul-" version ".tar.gz")) | |
723 | (sha256 | |
724 | (base32 | |
725 | "1400ba2p34vr9q285lqvjm73f6m677cgfdymmjpiwyrjgbbiqrjy")))) | |
726 | (build-system gnu-build-system) | |
727 | (arguments | |
728 | `(#:phases | |
729 | (modify-phases %standard-phases | |
730 | (add-after 'install 'wrap | |
731 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
732 | (wrap-program (string-append (assoc-ref outputs "out") | |
733 | "/libexec/ibus-setup-hangul") | |
734 | `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))) | |
735 | `("LD_LIBRARY_PATH" ":" prefix | |
736 | (,(string-append (assoc-ref inputs "libhangul") "/lib"))) | |
737 | `("GI_TYPELIB_PATH" ":" prefix | |
738 | (,(getenv "GI_TYPELIB_PATH")))) | |
739 | #t))))) | |
740 | (native-inputs | |
741 | `(("pkg-config" ,pkg-config) | |
742 | ("gettext" ,gettext-minimal) | |
743 | ("glib:bin" ,glib "bin"))) | |
744 | (inputs | |
745 | `(("ibus" ,ibus) | |
746 | ("glib" ,glib) | |
747 | ("python-pygobject" ,python-pygobject) | |
748 | ("gtk+" ,gtk+) | |
749 | ("libhangul" ,libhangul) | |
750 | ("python" ,python))) | |
751 | (home-page "https://github.com/libhangul/ibus-hangul") | |
752 | (synopsis "Hangul engine for IBus") | |
753 | (description | |
754 | "ibus-hangul is a Korean input method engine for IBus.") | |
755 | (license gpl2+))) |