Subject: [PATCH 4/4] gnu: Add ibus-chewing.

From: Efraim Flashner <[email-masked]>
Date: Sun, 29 Sep 2024 10:55:06 +0300

* gnu/packages/ibus.scm (ibus-chewing): New variable.

Co-authored-by: Charles <[email-masked]>.
Change-Id: I37c1ac836e5afd3101378d206e5c2056293cc182
---
 gnu/packages/ibus.scm | 52 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 2f4211c385b..0dfce29ea36 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2015-2023 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2015 Andreas Enge <[email-masked]>
 ;;; Copyright © 2016 Chris Marusich <[email-masked]>
-;;; Copyright © 2017, 2018 Efraim Flashner <[email-masked]>
+;;; Copyright © 2017, 2018, 2024 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2018, 2019, 2020, 2021 Peng Mei Yu <[email-masked]>
 ;;; Copyright © 2020 kanichos <[email-masked]>
@@ -13,6 +13,7 @@
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2023 Luis Felipe López Acevedo <[email-masked]>
 ;;; Copyright © 2024 Zheng Junjie <[email-masked]>
+;;; Copyright © 2024 Charles <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,7 @@ (define-module (gnu packages ibus)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages iso-codes)
+  #:use-module (gnu packages language)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages logging)
   #:use-module (gnu packages perl)
@@ -380,6 +382,54 @@ (define-public libpinyin
     (home-page "https://github.com/libpinyin/libpinyin")
     (license gpl2+)))
 
+(define-public ibus-chewing
+  (package
+    (name "ibus-chewing")
+    (version "2.1.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/chewing/ibus-chewing")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0fgscxb8nhli4g8d3yy0wxzbk9bcyj6bvmqrzbddkvgikmanj36b"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      ;; Settings schema 'org.freedesktop.IBus.Chewing' is not installed
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'prepare-for-tests
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                ;; IBus requires write access to the HOME directory.
+                (setenv "HOME" (getcwd))
+                ;; MESA: error: ZINK: failed to choose pdev
+                (setenv "GALLIUM_DRIVER" "llvmpipe")
+                (system "Xvfb :1 &")
+                (setenv "DISPLAY" ":1")))))))
+    (inputs
+     (list glib
+           gtk
+           ibus
+           libadwaita
+           libchewing))
+    (native-inputs
+     (list dbus
+           gettext-minimal
+           gobject-introspection
+           `(,glib "bin")
+           pkg-config
+           xorg-server-for-tests))
+    (home-page "https://chewing.im/")
+    (synopsis "Chewing engine for IBus")
+    (description "IBus-Chewing is an IBus front-end of Chewing, an intelligent
+Chinese input method for Zhuyin (BoPoMoFo) users.")
+    (license gpl2)))
+
 (define-public ibus-anthy
   (package
     (name "ibus-anthy")
-- 
Efraim Flashner   <[email-masked]>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted