From patchwork Thu Apr 20 14:06:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: gemmaro X-Patchwork-Id: 49323 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E4E1227BBEA; Thu, 20 Apr 2023 15:12:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 394F827BBE9 for ; Thu, 20 Apr 2023 15:12:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppV13-0000jE-4x; Thu, 20 Apr 2023 10:12:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppV10-0000hO-Gl for guix-patches@gnu.org; Thu, 20 Apr 2023 10:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppV10-0002Gh-6l for guix-patches@gnu.org; Thu, 20 Apr 2023 10:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ppV10-0000XX-1t for guix-patches@gnu.org; Thu, 20 Apr 2023 10:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62968] [PATCH] Add skktools. Resent-From: gemmaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Apr 2023 14:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62968 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62968@debbugs.gnu.org Cc: gemmaro X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16819998731994 (code B ref -1); Thu, 20 Apr 2023 14:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Apr 2023 14:11:13 +0000 Received: from localhost ([127.0.0.1]:38442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppV0C-0000W6-W7 for submit@debbugs.gnu.org; Thu, 20 Apr 2023 10:11:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:39036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppV08-0000Vw-Vw for submit@debbugs.gnu.org; Thu, 20 Apr 2023 10:11:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppV05-0008VH-Ps for guix-patches@gnu.org; Thu, 20 Apr 2023 10:11:06 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppV02-00023J-9B for guix-patches@gnu.org; Thu, 20 Apr 2023 10:11:05 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-63b5465fb99so976760b3a.1 for ; Thu, 20 Apr 2023 07:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681999859; x=1684591859; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=N4Yt81eQMpcX1k+UhZ+n/8v5vAqpdp6r+2fWKek7cEw=; b=G20z9v3qtvGqCuontYhBD/IPOC4ERU7mmMtRLtFpqKi3a2fGR9bfVPoxxC/kXbsDPo JpOtfBhmAys6S0VYzoDpQzK2Qv/3gEvzDoULKL5tYe8eUfJc6RcXsjbJPl+0TLzBSnnL qVHMmSpZlX3dOCABzzqyv/hVTAiSO1nMzyQ5m3W6ZxWZg2YAanQxU6ELOmyX/ah6Yz5G fOlkO2wlv1sXD4E2wtVUCjH45F6Tyay22rCflKJNea6v8cOkGDPZkkeM81oIGShr2k3/ g256726ASikD/y6ClJrXfkrvGkWB+wD8qhFhqCMLiBaJHciJ0e5B+Z/23FRCHI3qfmnj Uf5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681999859; x=1684591859; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=N4Yt81eQMpcX1k+UhZ+n/8v5vAqpdp6r+2fWKek7cEw=; b=RQxthn9+Hh7BxzW6juRp7FhhQDgl9T2LRfiRg7iKct7Y/SETwuiKaKvm0YwPJW+Kpe CdURnbXjA4mX7zv87p4gASS3pQWlHN9cYPc3cIul84X7GNSrlvTl8sVaYkaWBMocX8IX NR/t6aDFzxxlxJl0INd6PuqTk8Rl710kb41hYpW2OsGcQrep7NQZKl8q6lg/fx2grx/f thITl7CObJLgYEBG0n1B/KUO84lj3ZveDUwN2XVf6dvvkB9379pg6GWhsRK/qw5zz7jN 4LXapLSRwTIDcJOZQaP5av0uX7zU/CegbJnu/ugJxXqX3I/pTLZs2xVFsgTMsxKftxGu 0jsA== X-Gm-Message-State: AAQBX9cVmchKGUPt0lUFxG1SK102OD5vPQ4fAdJ10eul6StfXhxq3+9W dLk53OsaoNLwrna1H4KYhsEwMoE5ABePNg== X-Google-Smtp-Source: AKy350aCf1hmLiNzeKq0nLazximz5IbKFwmB4pqnliO3Y59K1hkbcQ2bDuVCaj0GTbCpVwuzjtxuSw== X-Received: by 2002:a05:6a00:1744:b0:63d:46d3:cc09 with SMTP id j4-20020a056a00174400b0063d46d3cc09mr1734515pfc.14.1681999859379; Thu, 20 Apr 2023 07:10:59 -0700 (PDT) Received: from mac.gemmaro.name ([240f:74:d1f0:1:ba1:e787:c9e:b1dc]) by smtp.gmail.com with ESMTPSA id g1-20020a056a00078100b0062ddcad2cc5sm1312192pfu.30.2023.04.20.07.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 07:10:58 -0700 (PDT) From: gemmaro Date: Thu, 20 Apr 2023 23:06:28 +0900 Message-Id: <3892d2a81cef75c2f7d81ada5600c28739651c40.1681997174.git.gemmaro.dev@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=gemmaro.dev@gmail.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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(+) base-commit: 61d15695752997427ed9c3491470dd76b11bd00a 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 ;;; Copyright © 2020, 2022 Julien Lepiller ;;; Copyright © 2022 Milran +;;; Copyright © 2023 gemmaro ;;; ;;; 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")