[bug#77890] gnu: libskk: Fix tests.

Message ID 20250418061948.28269-2-hunt31999@gmail.com
State New
Headers
Series [bug#77890] gnu: libskk: Fix tests. |

Commit Message

Kurome April 18, 2025, 6:19 a.m. UTC
  Add a patch file to fix invalid escape:
https://github.com/ueno/libskk/pull/90

and symlink skk-jisyo.

* gnu/packages/patches/libskk-fix-invalid-escape.patch: New file.
* gnu/packages/language.scm: Import (gnu packages dictionaries).
(libskk) [source]: Use the patch.
[arguments] <#:prallel-tests?>: Disable parallel tests.
<#:phases>: Add `symlink-skk-jisyo`.
[inputs]: Add skk-jisyo.

Change-Id: I3d086f2a691a42b4df9083ca711261744b8ad418
---
 gnu/packages/language.scm                     | 23 +++++++++++++++++--
 .../patches/libskk-fix-invalid-escape.patch   | 16 +++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/libskk-fix-invalid-escape.patch
  

Patch

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 13957e12a0..b7d908b25b 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -40,6 +40,7 @@  (define-module (gnu packages language)
   #:use-module (gnu packages crates-database)
   #:use-module (gnu packages crates-tls)
   #:use-module (gnu packages dbm)
+  #:use-module (gnu packages dictionaries)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
@@ -924,8 +925,23 @@  (define-public libskk
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0y279pcgs3jrsi9vzx086xhz9jbz23dqqijp4agygc9ackp9sxy5"))))
+                "0y279pcgs3jrsi9vzx086xhz9jbz23dqqijp4agygc9ackp9sxy5"))
+              (patches
+               (search-patches
+                "libskk-fix-invalid-escape.patch"))))
     (build-system gnu-build-system)
+    (arguments
+     (list
+      #:parallel-tests? #f ; concurrency issues in tests
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'install 'symlink-skk-jisyo
+            (lambda _
+              (let ((dict-dir (string-append #$output "/share/skk")))
+                (mkdir-p dict-dir)
+                (invoke "ln" "-s"
+                        (string-append #$skk-jisyo "/share/skk")
+                        dict-dir)))))))
     (native-inputs (list autoconf
                          automake
                          gettext-minimal
@@ -933,7 +949,10 @@  (define-public libskk
                          libtool
                          pkg-config
                          vala))
-    (inputs (list libgee json-glib libxkbcommon))
+    (inputs (list libgee
+                  json-glib
+                  libxkbcommon
+                  skk-jisyo))
     (home-page "https://github.com/ueno/libskk")
     (synopsis "Dealing with Japanese kana-to-kanji conversion")
     (description
diff --git a/gnu/packages/patches/libskk-fix-invalid-escape.patch b/gnu/packages/patches/libskk-fix-invalid-escape.patch
new file mode 100644
index 0000000000..2f443e83c9
--- /dev/null
+++ b/gnu/packages/patches/libskk-fix-invalid-escape.patch
@@ -0,0 +1,16 @@ 
+fix parse error:
+https://github.com/ueno/libskk/pull/90
+
+diff --git a/rules/default/rom-kana/default.json b/rules/default/rom-kana/default.json
+index 6ddfce6..68dcff9 100644
+--- a/rules/default/rom-kana/default.json
++++ b/rules/default/rom-kana/default.json
+@@ -108,7 +108,7 @@
+             "myi": ["", "みぃ" ],
+             "myo": ["", "みょ" ],
+             "myu": ["", "みゅ" ],
+-            "n\'": ["", "ん" ],
++            "n'": ["", "ん" ],
+             "na": ["", "な" ],
+             "ne": ["", "ね" ],
+             "ni": ["", "に" ],