diff mbox series

[bug#63987,v2] gnu: Add emacs-jinx.

Message ID 87zg4w5pvi.fsf@posteo.de
State New
Headers show
Series [bug#63987,v2] gnu: Add emacs-jinx. | expand

Commit Message

Mekeor Melire June 18, 2023, 11:02 p.m. UTC
* gnu/packages/emacs-xyz.scm (emacs-jinx): New variable.
---
Some (but not all) changes in this patch version:

1. The patch still installs jinx-mod.so into $output/lib.

2. The patch does not import (gnu packages commencement) anymore.

3. The patch does not use (let ((commit ...) (revision ...)) ...) anymore.

4. The patch now adds emacs-jinx right before emacs-jit-spell.

5. The patch now splits phases of installation and build of documentation and jinx-mod.

6. The patch now uses a more concise package description.

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

+folding, if any.")
+    (license license:gpl3+)))
+
 (define-public emacs-jit-spell
   (package
     (name "emacs-jit-spell")
--
2.39.2
diff mbox series

Patch

diff --git a/gnu/packages/emacs-xyz.scm 
b/gnu/packages/emacs-xyz.scm
index 24a4ae169e..574fd4cfca 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -177,6 +177,7 @@  (define-module (gnu packages emacs-xyz)
   #:use-module (gnu packages djvu)
   #:use-module (gnu packages ebook)
   #:use-module (gnu packages emacs)
+  #:use-module (gnu packages enchant)
   #:use-module (gnu packages fonts)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages games)
@@ -10010,6 +10011,65 @@  (define-public emacs-jinja2-mode
 sgml/html integration, and indentation (working with sgml).")
     (license license:gpl3+)))

+(define-public emacs-jinx
+  (package
+    (name "emacs-jinx")
+    (version "0.8")
+    (source
+      (origin
+        (method git-fetch)
+        (uri
+          (git-reference
+            (url "https://github.com/minad/jinx")
+            (commit version)))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32
+ 
"1y097rnf9zg26jf4vh74a0laddfp4x6pp1fjqs3xqgwc0cmdq59w"))))
+    (build-system emacs-build-system)
+    (propagated-inputs (list emacs-compat))
+    (native-inputs (list emacs-compat enchant pkg-config 
texinfo))
+    (inputs (list enchant))
+    (arguments
+      (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-before 'install 'build-jinx-mod
+              (lambda* _
+                (invoke
+                  "emacs" "--batch" "-L" "."
+                  "-l" "jinx.el"
+                  "-f" "jinx--load-module")))
+            (add-before 'install 'patch-path-to-jinx-mod
+              (lambda _
+                (let ((file "jinx.el"))
+                  (make-file-writable file)
+                  (emacs-substitute-sexps file
+                    ("\"Compile and load dynamic module.\""
+                      `(module-load
+                         ,(string-append #$output 
"/lib/jinx-mod.so")))))))
+            (add-before 'install 'build-info
+              (lambda _
+                (invoke "emacs" "--batch"
+                  "--eval=(require 'ox-texinfo)"
+                  "--eval=(find-file \"README.org\")"
+                  "--eval=(org-texinfo-export-to-info)")))
+            (add-after 'install 'install-jinx-mod
+              (lambda _
+                (install-file "jinx-mod.so"
+                  (string-append #$output "/lib"))))
+            (add-after 'install 'install-info
+              (lambda _
+                (install-file "jinx.info"
+                  (string-append #$output "/share/info")))))))
+    (home-page "https://github.com/minad/jinx")
+    (synopsis "Emacs Enchanted Spell Checker")
+    (description "Jinx is a just-in-time spell-checker for Emacs 
based on the
+Enchant library.  It lazily highlights misspelled words in the 
text of the
+visible portion of the buffer by honouring window boundaries as 
well as text