Subject: [bug#62664] [PATCH v2] gnu: Add emacs-copilot.

From: jgart <[email-masked]>
Date: Sun, 27 Oct 2024 21:40:38 -0500

* gnu/packages/emacs-xyz.scm (emacs-copilot): New variable.
Co-authored-by: Rostislav Svoboda <[email-masked]>

Change-Id: If2e32f5cc4df95ce99642b41a1df818a35b4343c
---
 gnu/packages/emacs-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 488b4cb5d7..76c9ed9947 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -4422,6 +4422,43 @@ (define-public emacs-carp
 listing type errors via Flycheck, as well as REPL support for Carp.")
       (license license:asl2.0))))
 
+(define-public emacs-copilot
+  (let ((commit "b5878d6a8c741138b5efbf4fe1c594f3fd69dbdd")
+        (revision "0"))
+    (package
+      (name "emacs-copilot")
+      (version (git-version "1.27.0" revision commit))
+      (source
+       (origin
+         (uri (git-reference
+               (url "https://github.com/copilot-emacs/copilot.el")
+               (commit commit)))
+         (method git-fetch)
+         (sha256
+          (base32 "1dgi3g2n57dv1a8hjjzgccrbl1bdf4xqwn9bmr453fz4qfab0v6k"))
+         (file-name (git-file-name name version))))
+      (build-system emacs-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'substitute-copilot-node-executable
+              (lambda* (#:key inputs #:allow-other-keys)
+                (emacs-substitute-variables "copilot.el"
+                  ("copilot-node-executable"
+                   (search-input-file inputs "/bin/node"))))))))
+      (inputs (list node-lts))
+      (propagated-inputs
+       (list emacs-dash
+             emacs-editorconfig
+             emacs-f
+             emacs-s))
+      (home-page "https://github.com/copilot-emacs/copilot.el")
+      (synopsis "Copilot plugin for Emacs")
+      (description
+       "This package provides an Emacs plugin for GitHub Copilot.")
+      (license license:expat))))
+
 (define-public emacs-coterm
   (package
     (name "emacs-coterm")

base-commit: 0d15c6e46c5c3a14ae776bb98c293527ba8ad319
-- 
2.46.0