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