diff mbox series

[bug#60767] gnu: Add emacs-liberime.

Message ID 87ilhbcil6.fsf@163.com
State New
Headers show
Series [bug#60767] gnu: Add emacs-liberime. | expand

Commit Message

Feng Shu Jan. 13, 2023, 12:39 a.m. UTC
* gnu/packages/emacs-xyz.scm (emacs-liberime): New variable.
---
 gnu/packages/emacs-xyz.scm | 40 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

Comments

Nicolas Goaziou Jan. 13, 2023, 10:01 p.m. UTC | #1
Hello,

Feng Shu <tumashu@163.com> writes:

> * gnu/packages/emacs-xyz.scm (emacs-liberime): New variable.

Applied with the following tweaks. Thank you.

> +(define-public emacs-liberime
> +  (let ((commit "70ad2e6e1f0ff74fc8b9b5177b9aba645a18e546")
> +        (revision "0"))
> +    (package
> +      (name "emacs-liberime")
> +      (version (git-version "v0.0.6" revision commit))

"v" is not part of the version tag so I put it elsewher.

> +      (synopsis "Librime Emacs Lisp Binding")

Binding -> binding.

Regards,
diff mbox series

Patch

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index bd8675f63a..9ebbbca366 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -31362,6 +31362,46 @@  REPL appropriate to the current major mode.")
      "Rime is an Emacs input method built upon Rime input method engine.")
     (license license:gpl3+)))
 
+(define-public emacs-liberime
+  (let ((commit "70ad2e6e1f0ff74fc8b9b5177b9aba645a18e546")
+        (revision "0"))
+    (package
+      (name "emacs-liberime")
+      (version (git-version "v0.0.6" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/merrickluo/liberime")
+               (commit commit)))
+         (sha256
+          (base32
+           "1y9a1khfyz262yarn7rd0hg5vxaz8j80mhad7mh01m6685nfw39b"))
+         (file-name (git-file-name name version))))
+      (build-system emacs-build-system)
+      (arguments
+       (list
+        #:include #~(cons "^src/liberime-core.so$" %default-include)
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'delete-files-and-patch-paths
+              (lambda* (#:key inputs #:allow-other-keys)
+                (delete-file-recursively "emacs-module")
+                (emacs-substitute-variables "liberime.el"
+                  ("liberime-module-file"
+                   (string-append #$output "/src/liberime-core.so"))
+                  ("liberime-shared-data-dir"
+                   (search-input-directory inputs "share/rime-data")))))
+            (add-before 'install 'build-emacs-module
+              (lambda _
+                (invoke "make"))))))
+      (inputs (list librime rime-data))
+      (home-page "https://github.com/merrickluo/liberime")
+      (synopsis "Librime Emacs Lisp Binding")
+      (description
+       "Liberime is an Emacs dynamic module provide librime bindings.")
+      (license license:gpl3+))))
+
 (define-public emacs-bison-mode
   (package
     (name "emacs-bison-mode")