GNU bug report logs - #62968
[PATCH] Add skktools.

Previous Next

Package: guix-patches;

Reported by: gemmaro <gemmaro.dev <at> gmail.com>

Date: Thu, 20 Apr 2023 14:12:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 62968 in the body.
You can then email your comments to 62968 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 guix-patches <at> gnu.org:
bug#62968; Package guix-patches. (Thu, 20 Apr 2023 14:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to gemmaro <gemmaro.dev <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 20 Apr 2023 14:12:02 GMT) Full text and rfc822 format available.

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

From: gemmaro <gemmaro.dev <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: gemmaro <gemmaro.dev <at> gmail.com>
Subject: [PATCH] Add skktools.
Date: Thu, 20 Apr 2023 23:06:28 +0900
Hello,

This patch adds skktools, which are SKK dictionary maintenance tools.

Some notes about this patch:

* skktools has skkdic-* programs and a number of scripts.
* Some scripts were excluded from the installation target because they
  are not available on modern systems.
* To install Emacs Lisp file, emacs-build-system is partially used
  with reference to the guile-wisp package definition [1].

I submitted this package to the Guix-jp channel ([2], thanks ROCKTAKEY
for review!), and I thought it would be nice to have it on the
official channel too.

1: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile-xyz.scm?id=f3424ada316a9962818b60ae22236efce8bd9fb7#n2107
2: https://gitlab.com/guix-jp/channel/-/merge_requests/8

Regards,
gemmaro.

* gnu/packages/language.scm (skktools): New variable.
---
 gnu/packages/language.scm | 157 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 208fab4f5b..c53efd2fa0 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2020 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2020, 2022 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2022 Milran <milranmike <at> protonmail.com>
+;;; Copyright © 2023 gemmaro <gemmaro.dev <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@ (define-module (gnu packages language)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages dbm)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages freedesktop)
@@ -49,6 +51,8 @@ (define-module (gnu packages language)
   #:use-module (gnu packages python)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages ruby)
+  #:use-module (gnu packages scheme)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages swig)
@@ -931,6 +935,159 @@ (define-public libskk
      "libskk is a library to deal with Japanese kana-to-kanji conversion method.")
     (license license:gpl3+)))
 
+(define-public skktools
+  (package
+    (name "skktools")
+    (version "1.3.4")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/skk-dev/skktools")
+                    (commit (string-append "skktools-"
+                                           (string-replace-substring version
+                                                                     "." "_")))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1zway8jsm18279xq8zlpr84iqiw373x3v0ysay74n9bjqxbl234a"))
+              (modules '((guix build utils)))
+              (snippet '(begin
+                          ;; Maybe requires jgawk
+                          (delete-file "unannotation.awk")
+                          (delete-file "convert2skk/edict2skk.awk")
+                          (delete-file "convert2skk/wnn2skk.awk")
+                          (delete-file "convert2skk/wnn2skk.sed") ;Used with wnn2skk.awk
+                          (delete-file "convert2skk/wnn2skk.sh") ;Depends on 2 files above
+                          ;; Requires jperl
+                          (delete-file "convert2skk/alpha-kana.pl")
+                          (delete-file "convert2skk/atok2skk.pl")
+                          (delete-file "convert2skk/read.me") ;Readme for jperl scripts
+                          (delete-file "convert2skk/wx2skk.pl")
+                          (delete-file-recursively "dbm")
+                          ;; Needs a lot requirements
+                          (delete-file "convert2skk/doc2skk.sh")
+                          ;; Obsolete scripts
+                          (delete-file-recursively "convert2skk/obsolete")
+                          ;; Contains syntax error
+                          (delete-file "convert2skk/pubdic2list")))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:modules ((guix build gnu-build-system)
+                  ((guix build emacs-build-system)
+                   #:prefix emacs:)
+                  (guix build utils)
+                  (guix build emacs-utils))
+       #:imported-modules (,@%gnu-build-system-modules
+                           (guix build emacs-build-system)
+                           (guix build emacs-utils))
+       #:phases (modify-phases %standard-phases
+                  (add-before 'install 'fix-library-loading
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (for-each (lambda (path)
+                                  (substitute* path
+                                    (("require 'skkdictools'")
+                                     "require_relative 'skkdictools'")))
+                                (list "filters/annotation-filter.rb"
+                                      "filters/asayaKe.rb"
+                                      "filters/complete-numerative.rb"
+                                      "filters/conjugation.rb"
+                                      "filters/make-tankan-dic.rb"))))
+                  (add-after 'install 'install-scripts
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((share (string-append (assoc-ref outputs "out")
+                                                  "/share/skktools")))
+                        (install-file "filters/skkdictools.rb" share)
+                        (for-each (lambda (file)
+                                    (invoke "chmod" "755" file)
+                                    (install-file file share))
+                                  (append (find-files "." "\\.rb$")
+                                          (find-files "." "\\.scm$")
+                                          (find-files "." "\\.py$")
+                                          (find-files "convert2skk" "\\.pl")
+                                          (find-files "convert2skk" "\\.rb")
+                                          (list "convert2skk/adddummy"
+                                                "convert2skk/list2skk"
+                                                "convert2skk/removedummy"
+                                                "convert2skk/skk2list")
+                                          (find-files "filters" "\\.rb$"))))))
+                  ;; Install and make autoloads for skk-xml.el.
+                  (add-after 'install 'install-emacs-files
+                    (assoc-ref emacs:%standard-phases
+                               'install))
+                  (add-after 'install-emacs-files 'compile-emacs-files
+                    (assoc-ref emacs:%standard-phases
+                               'build))
+                  (add-after 'compile-emacs-files 'make-autoloads
+                    (assoc-ref emacs:%standard-phases
+                               'make-autoloads))
+                  (add-after 'install 'install-docs
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((doc (string-append (assoc-ref outputs "out")
+                                                "/share/doc/"
+                                                ,name "-"
+                                                ,version)))
+                        (install-file "ChangeLog" doc)
+                        (for-each (lambda (file)
+                                    (install-file file doc))
+                                  (append (find-files "READMEs")))
+                        (copy-file "filters/README.md"
+                                   (string-append doc "/README.filters.md"))
+                        (copy-file "convert2skk/README.md"
+                                   (string-append doc "/README.convert2skk.md")))))
+                  (add-after 'wrap-scripts 'check-scripts
+                    ;; Skipped tests for:
+                    ;; * skk2cdb.py: Requires cdb file
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (string-append (assoc-ref outputs "out")
+                                                "/share/skktools")))
+                        (for-each (lambda (args)
+                                    (apply invoke
+                                           (string-append out "/"
+                                                          (car args))
+                                           (cdr args)))
+                                  '(("abbrev-convert.rb")
+                                    ("abbrev-simplify-keys.rb")
+                                    ("adddummy")
+                                    ("annotation-filter.rb")
+                                    ("aozora2skk.rb")
+                                    ("asayaKe.rb")
+                                    ("canna2skk.rb" "/dev/null")
+                                    ("chasen2skk.rb")
+                                    ("complete-numerative.rb")
+                                    ("conjugation.rb")
+                                    ("ctdicconv.rb")
+                                    ("dic-it2skk.rb" "/dev/null")
+                                    ("ipadic2skk.rb")
+                                    ("list2skk")
+                                    ("make-tankan-dic.rb")
+                                    ("prime2skk.rb")
+                                    ("removedummy")
+                                    ("saihenkan.rb")
+                                    ("skk2list")
+                                    ("/skkdic-diff.scm" "/dev/null"
+                                     "/dev/null")
+                                    ("skk-wordpicker.rb")))))))))
+    (native-inputs (list
+                    ;; for skkdic-expr2
+                    pkg-config
+                    ;; for installing Emacs Lisp files
+                    emacs-minimal))
+    (inputs (list bdb-4.8
+                  glib ;for skkdic-expr2
+                  ;; For scripts
+                  gauche
+                  perl
+                  python-2
+                  ruby))
+    (home-page "https://github.com/skk-dev/skktools")
+    (synopsis "SKK dictionary maintenance tools")
+    (description
+     "The skktools are SKK dictionary maintenance tools.  Note that the
+scripts are located under the share directory, while there might be
+some missing interpreters and might not work.")
+    (license license:gpl2)))
+
 (define-public mecab
   (package
     (name "mecab")

base-commit: 61d15695752997427ed9c3491470dd76b11bd00a
-- 
2.39.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 29 May 2023 22:15:02 GMT) Full text and rfc822 format available.

Notification sent to gemmaro <gemmaro.dev <at> gmail.com>:
bug acknowledged by developer. (Mon, 29 May 2023 22:15:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: gemmaro <gemmaro.dev <at> gmail.com>
Cc: 62968-done <at> debbugs.gnu.org
Subject: Re: bug#62968: [PATCH] Add skktools.
Date: Tue, 30 May 2023 00:14:51 +0200
[Message part 1 (text/plain, inline)]
Hi,

gemmaro <gemmaro.dev <at> gmail.com> skribis:

> Hello,
>
> This patch adds skktools, which are SKK dictionary maintenance tools.
>
> Some notes about this patch:
>
> * skktools has skkdic-* programs and a number of scripts.
> * Some scripts were excluded from the installation target because they
>   are not available on modern systems.
> * To install Emacs Lisp file, emacs-build-system is partially used
>   with reference to the guile-wisp package definition [1].
>
> I submitted this package to the Guix-jp channel ([2], thanks ROCKTAKEY
> for review!), and I thought it would be nice to have it on the
> official channel too.
>
> 1: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile-xyz.scm?id=f3424ada316a9962818b60ae22236efce8bd9fb7#n2107
> 2: https://gitlab.com/guix-jp/channel/-/merge_requests/8
>
> Regards,
> gemmaro.
>
> * gnu/packages/language.scm (skktools): New variable.

Sorry for the long delay.  Applied the changes below (license is ‘gpl2+’
because source file headers explicitly say “or any later version”).

Thanks!

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index 004a2df289..27a6ebf329 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -1070,10 +1070,10 @@ (define-public skktools
     (home-page "https://github.com/skk-dev/skktools")
     (synopsis "SKK dictionary maintenance tools")
     (description
-     "The skktools are SKK dictionary maintenance tools.  Note that the
-scripts are located under the share directory, while there might be
-some missing interpreters and might not work.")
-    (license license:gpl2)))
+     "The skktools are SKK dictionary maintenance tools.  This includes
+commands such as @command{skkdic-count}, @command{skkdic-expr}, and
+@command{skkdic-sort}.")
+    (license license:gpl2+)))
 
 (define-public mecab
   (package

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Jun 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 275 days ago.

Previous Next


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