Subject: [PATCH 1/1] gnu: Add emacs-ddskk-with-nicola
From: Taiju HIGASHI <[email-masked]>
To: [email-masked]
Cc: Taiju HIGASHI <[email-masked]>
Date: Thu, 18 Nov 2021 23:01:59 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

---
 gnu/packages/emacs-xyz.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index e141c390d8..0ca2bbc066 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -28635,6 +28635,35 @@ (define-public emacs-ddskk
 conversion program}, a Japanese input method on Emacs.")
       (license license:gpl2+))))
 
+(define-public emacs-ddskk-with-nicola
+  (package
+    (inherit emacs-ddskk)
+    (name "emacs-ddskk-with-nicola")
+    (synopsis "Simple Kana to Kanji conversion program (with NICOLA)")
+    (propagated-inputs
+     `(("emacs-ddskk" ,emacs-ddskk)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments emacs-ddskk)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'chdir
+             (lambda _
+               (chdir "nicola")
+               #t))
+           (replace 'configure
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (substitute* "Makefile"
+                   (("PREFIX = NONE")
+                    (string-append "PREFIX = " out))
+                   (("LISPDIR = NONE")
+                    (string-append "LISPDIR = " out "/share/emacs/site-lisp"))))
+               (make-file-writable "NICOLA-DDSKK-CFG")
+               (emacs-substitute-sexps "NICOLA-DDSKK-CFG"
+                 ("setq NICOLA-DDSKK_PREFIX" ""))
+               #t))
+           (delete 'check)))))))
+
 (define-public emacs-objed
   (package
     (name "emacs-objed")
-- 
2.33.1