GNU bug report logs - #73549
[PATCH 0/4] Update libchewing and add fcitx5 and ibus packages

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Sun, 29 Sep 2024 07:55:01 UTC

Severity: normal

Tags: patch

Done: jgart <jgart <at> dismail.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73549 in the body.
You can then email your comments to 73549 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to all_but_last <at> 163.com, iyzsong <at> envs.net, guix-patches <at> gnu.org:
bug#73549; Package guix-patches. (Sun, 29 Sep 2024 07:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to all_but_last <at> 163.com, iyzsong <at> envs.net, guix-patches <at> gnu.org. (Sun, 29 Sep 2024 07:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: guix-patches <at> gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH 0/4] Update libchewing and add fcitx5 and ibus packages
Date: Sun, 29 Sep 2024 10:53:13 +0300
chewing is another input method for Chinese, with support for fcitx5 and
ibus.  The newer version of libchewing (with many improvements!)
required corrosion, which allows cmake to build projects with rust.

This was a joint effort to put together, and has been tested with Gnome
to work as expected.

Charles (2):
  gnu: Add corrosion.
  gnu: Add fcitx5-chewing.

Efraim Flashner (2):
  gnu: libchewing: Update to 0.9.0.
  gnu: Add ibus-chewing.

 gnu/packages/cmake.scm    | 42 +++++++++++++++++
 gnu/packages/fcitx5.scm   | 31 +++++++++++++
 gnu/packages/ibus.scm     | 52 +++++++++++++++++++++-
 gnu/packages/language.scm | 94 ++++++++++++++++++++++-----------------
 4 files changed, 178 insertions(+), 41 deletions(-)


base-commit: 2263c61aef3fbc374b2eae8abcd1498d19ad7124
-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Information forwarded to guix-patches <at> gnu.org:
bug#73549; Package guix-patches. (Sun, 29 Sep 2024 07:58:03 GMT) Full text and rfc822 format available.

Message #8 received at 73549 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 73549 <at> debbugs.gnu.org
Cc: Charles <charles <at> charje.net>, Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH 1/4] gnu: Add corrosion.
Date: Sun, 29 Sep 2024 10:55:03 +0300
From: Charles <charles <at> charje.net>

* gnu/packages/cmake.scm (corrosion): New variable.

Signed-off-by: Efraim Flashner <efraim <at> flashner.co.il>
Change-Id: I0bb56889722128b9946af495fab05d39beaaf65a
---
 gnu/packages/cmake.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 4466c4b91dd..8310dc55fa7 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2021 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2024 John Kehayias <john.kehayias <at> protonmail.com>
 ;;; Copyright © 2024 dan <i <at> dan.games>
+;;; Copyright © 2024 Charles <charles <at> charje.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@ (define-module (gnu packages cmake)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages rust)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages texinfo)
@@ -440,6 +442,46 @@ (define-public cmake-minimal-cross
     (search-paths
      (package-native-search-paths cmake-minimal))))
 
+(define-public corrosion
+  (package
+    (name "corrosion")
+    (version "0.5.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/corrosion-rs/corrosion")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32 "1sm1jhdrqzp3f36f7grh900wp7pk9l1zim49hrk87ac6frfmg8xx"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+       #:phases
+       #~(modify-phases %standard-phases
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 (invoke "ctest" "-E"
+                         (string-append
+                           "(" (string-join
+                                 (list "cbindgen_rust2cpp"
+                                       "rustup_proxy"
+                                       "hostbuild"
+                                       "parse_target_triple")
+                                 "|")
+                           ")"))))))))
+    (native-inputs
+     (list rust
+           `(,rust "cargo")))
+    (home-page "https://corrosion-rs.github.io/corrosion/")
+    (synopsis "Tool for integrating Rust into an existing CMake project")
+    (description "Corrosion, formerly known as cmake-cargo, is a tool for
+integrating Rust into an existing CMake project.  Corrosion can automatically
+import executables, static libraries, and dynamic libraries from a workspace
+or package manifest (Cargo.toml file).")
+    (license license:expat)))
+
 (define-public emacs-cmake-mode
   (package
     (inherit cmake)
-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Information forwarded to guix-patches <at> gnu.org:
bug#73549; Package guix-patches. (Sun, 29 Sep 2024 07:58:04 GMT) Full text and rfc822 format available.

Message #11 received at 73549 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 73549 <at> debbugs.gnu.org
Cc: Charles <charles <at> charje.net>, Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH 2/4] gnu: libchewing: Update to 0.9.0.
Date: Sun, 29 Sep 2024 10:55:04 +0300
* gnu/packages/language.scm (libchewing): Update to 0.9.0.
[build-system]: Switch to cargo-build-system.
[arguments]: Adjust for switch to cargo-build-system.  Enable
parallel-tests.  Add a phase to allow older versions of
rust-clap-mangen.  Add the cmake version of 'configure after 'configure.
Use the cmake versions of 'build, 'check and 'install.
[native-inputs]: Add corrosion, cmake-minimal.  Remove autoconf,
automake, libtool, perl, pkg-config, python-wrapper, texinfo.

Co-authored-by: Charles <charles <at> charje.net>
Change-Id: Ic11e38646fc47cfc2c575320f43b9355a1c83b39
---
 gnu/packages/language.scm | 94 ++++++++++++++++++++++-----------------
 1 file changed, 54 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 7a3deb0b438..78fcba4287f 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -8,6 +8,8 @@
 ;;; Copyright © 2022 Milran <milranmike <at> protonmail.com>
 ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2023 gemmaro <gemmaro.dev <at> gmail.com>
+;;; Copyright © 2024 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2024 Charles <charles <at> charje.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +33,9 @@ (define-module (gnu packages language)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages crates-io)
+  #:use-module (gnu packages crates-tls)
   #:use-module (gnu packages dbm)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages emacs)
@@ -63,6 +68,7 @@ (define-module (gnu packages language)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (guix packages)
+  #:use-module (guix build-system cargo)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system glib-or-gtk)
@@ -264,55 +270,63 @@ (define-public hime
 (define-public libchewing
   (package
     (name "libchewing")
-    (version "0.5.1")
+    (version "0.9.0")
     (source
      (origin
        (method git-fetch)
-       (uri
-        (git-reference
-         (url "https://github.com/chewing/libchewing.git")
-         (commit
-          (string-append "v" version))))
-       (file-name
-        (git-file-name name version))
+       (uri (git-reference
+             (url "https://github.com/chewing/libchewing")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "04d09w6xdd08v6laj9y4qmqsijw5i2jvshcilhh4vg6cfnfgl2my"))))
-    (build-system gnu-build-system)
+        (base32 "1n0w9niff46w7vncs699gj4y2xghn1sbl0f4mg5x33dcapqd14sg"))))
+    (build-system cargo-build-system)
     (arguments
-     `(;; test-easy-symbol and test-fullshape fail with multiple cores.
-       #:parallel-tests? #f
+     `(#:modules ((guix build cargo-build-system)
+                  (guix build utils)
+                  ((guix build cmake-build-system) #:prefix cmake:))
+       #:imported-modules ((guix build cmake-build-system)
+                           ,@%cargo-build-system-modules)
+       #:install-source? #f
+       ;; Keep the vendor-dir outside of cmake's directories.
+       #:vendor-dir "../guix-vendor"
+       #:cargo-inputs
+       (("rust-anyhow" ,rust-anyhow-1)
+        ("rust-clap" ,rust-clap-4)
+        ("rust-clap-mangen" ,rust-clap-mangen-0.2)
+        ("rust-der" ,rust-der-0.7)
+        ("rust-directories" ,rust-directories-5)
+        ("rust-env-logger" ,rust-env-logger-0.10)
+        ("rust-log" ,rust-log-0.4)
+        ("rust-rusqlite" ,rust-rusqlite-0.29))
+       #:cargo-development-inputs
+       (("rust-tempfile" ,rust-tempfile-3))
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'disable-failing-tests
+         (add-after 'unpack 'allow-older-version-of-clap-mangen
            (lambda _
-             (substitute* "test/Makefile.am"
-               (("	test-bopomofo ")
-                "")
-               (("	test-config ")
-                "")
-               (("	test-reset ")
-                "")
-               (("	test-symbol ")
-                "")
-               (("	test-keyboardless ")
-                "")
-               (("	test-special-symbol ")
-                "")
-               (("	test-keyboard ")
-                "")
-               (("	test-regression ")
-                "")
-               (("	test-userphrase ")
-                ""))
-             #t)))))
+             (substitute* "tools/Cargo.toml"
+               (("0.2.12") "0.2.11"))))
+         (add-after 'configure 'cmake-configure
+           (lambda args
+             (apply (assoc-ref cmake:%standard-phases 'configure)
+                    ;; For the tests.
+                    (append args (list #:out-of-source? #f)))))
+         (add-after 'unpack 'work-around-genkeystroke
+           (lambda _
+             ;; Remove this phase when we can find ncurses with cmake.
+             (substitute* "tests/CMakeLists.txt"
+               (("CURSES_FOUND") "FALSE"))))
+         (replace 'build
+           (assoc-ref cmake:%standard-phases 'build))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys #:rest args)
+             (when tests?
+               ((assoc-ref cmake:%standard-phases 'check)))))
+         (replace 'install
+           (assoc-ref cmake:%standard-phases 'install)))))
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("libtool" ,libtool)
-       ("perl" ,perl)
-       ("pkg-config" ,pkg-config)
-       ("python" ,python-wrapper)
-       ("texinfo" ,texinfo)))
+     (list corrosion cmake-minimal))
     (inputs
      (list ncurses sqlite))
     (synopsis "Chinese phonetic input method")
-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Information forwarded to all_but_last <at> 163.com, iyzsong <at> envs.net, guix-patches <at> gnu.org:
bug#73549; Package guix-patches. (Sun, 29 Sep 2024 07:58:05 GMT) Full text and rfc822 format available.

Message #14 received at 73549 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 73549 <at> debbugs.gnu.org
Cc: Charles <charles <at> charje.net>, Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH 3/4] gnu: Add fcitx5-chewing.
Date: Sun, 29 Sep 2024 10:55:05 +0300
From: Charles <charles <at> charje.net>

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

Signed-off-by: Efraim Flashner <efraim <at> flashner.co.il>
Change-Id: I27cd2d9732ad12a387ecaa258a36f7342d438ab1
---
 gnu/packages/fcitx5.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm
index c4c2b565db7..b6002f8023c 100644
--- a/gnu/packages/fcitx5.scm
+++ b/gnu/packages/fcitx5.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2022 Dominic Martinez <dom <at> dominicm.dev>
 ;;; Copyright © 2022 dan <i <at> dan.games>
 ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
+;;; Copyright © 2024 Charles <charles <at> charje.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,6 +42,7 @@ (define-module (gnu packages fcitx5)
   #:use-module (gnu packages ibus)
   #:use-module (gnu packages iso-codes)
   #:use-module (gnu packages kde-frameworks)
+  #:use-module (gnu packages language)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
@@ -369,6 +371,35 @@ (define-public fcitx5-anthy
 the Anthy input method.")
     (license license:gpl2+)))
 
+(define-public fcitx5-chewing
+  (package
+    (name "fcitx5-chewing")
+    (version "5.1.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/fcitx/fcitx5-chewing")
+                    (commit version)))
+              (sha256
+               (base32 "011psyvvcbrw062zw807lm33n827qza7mqaagf8zb0cz3hh1qwm9"))
+              (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'check 'pre-check
+                 (lambda _ (setenv "HOME" (getcwd)))))))
+    (inputs (list libchewing))
+    (native-inputs
+     (list extra-cmake-modules
+           pkg-config
+           gettext-minimal
+           fcitx5))
+    (home-page "https://github.com/fcitx/fcitx5-chewing")
+    (synopsis "Chewing wrapper for Fcitx")
+    (description "This provides libchewing input method support for fcitx5.")
+    (license license:gpl2+)))
+
 (define-public fcitx5-chinese-addons
   (package
     (name "fcitx5-chinese-addons")
-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Information forwarded to all_but_last <at> 163.com, iyzsong <at> envs.net, guix-patches <at> gnu.org:
bug#73549; Package guix-patches. (Sun, 29 Sep 2024 07:58:05 GMT) Full text and rfc822 format available.

Message #17 received at 73549 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 73549 <at> debbugs.gnu.org
Cc: Charles <charles <at> charje.net>, Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH 4/4] gnu: Add ibus-chewing.
Date: Sun, 29 Sep 2024 10:55:06 +0300
* gnu/packages/ibus.scm (ibus-chewing): New variable.

Co-authored-by: Charles <charles <at> charje.net>.
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 <rekado <at> elephly.net>
 ;;; Copyright © 2015 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2016 Chris Marusich <cmmarusich <at> gmail.com>
-;;; Copyright © 2017, 2018 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2017, 2018, 2024 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2018, 2019, 2020, 2021 Peng Mei Yu <pengmeiyu <at> riseup.net>
 ;;; Copyright © 2020 kanichos <kanichos <at> yandex.ru>
@@ -13,6 +13,7 @@
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la <at> protonmail.com>
 ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
+;;; Copyright © 2024 Charles <charles <at> charje.net>
 ;;;
 ;;; 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   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Reply sent to jgart <jgart <at> dismail.de>:
You have taken responsibility. (Sun, 20 Oct 2024 06:15:01 GMT) Full text and rfc822 format available.

Notification sent to Efraim Flashner <efraim <at> flashner.co.il>:
bug acknowledged by developer. (Sun, 20 Oct 2024 06:15:02 GMT) Full text and rfc822 format available.

Message #22 received at 73549-done <at> debbugs.gnu.org (full text, mbox):

From: jgart <jgart <at> dismail.de>
To: 73549-done <at> debbugs.gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [PATCH 0/4] Update libchewing and add fcitx5 and ibus packages
Date: Sun, 20 Oct 2024 01:13:40 -0500

LGTM, pushed.
-- 
all the best,
jgart




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 17 Nov 2024 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 212 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.