Unverified Commit 97e6d418 authored by Damien Cassou's avatar Damien Cassou Committed by GitHub
Browse files

emacsPackages.copilot: 0.1.27->0.2.0 (#401943)

parents 394cd23b 75a259ac
Loading
Loading
Loading
Loading
+14 −26
Original line number Diff line number Diff line
@@ -4,48 +4,36 @@
  editorconfig,
  f,
  fetchFromGitHub,
  replaceVars,
  jsonrpc,
  nodejs,
  s,
  melpaBuild,
  copilot-node-server,
  copilot-language-server,
}:
let
  # The Emacs package isn't compatible with the latest
  # copilot-node-server so we have to set a specific revision
  # https://github.com/copilot-emacs/copilot.el/issues/344
  pinned-copilot-node-server = copilot-node-server.overrideAttrs (old: rec {
    version = "1.27.0";
    src = fetchFromGitHub {
      owner = "jfcherng";
      repo = "copilot-node-server";
      rev = version;
      hash = "sha256-Ds2agoO7LBXI2M1dwvifQyYJ3F9fm9eV2Kmm7WITgyo=";
    };
  });
in
melpaBuild {
melpaBuild (finalAttrs: {
  pname = "copilot";
  version = "0-unstable-2024-12-28";
  version = "0.2.0";

  src = fetchFromGitHub {
    owner = "copilot-emacs";
    repo = "copilot.el";
    rev = "c5dfa99f05878db5e6a6a378dc7ed09f11e803d4";
    sha256 = "sha256-FzI08AW7a7AleEM7kSQ8LsWsDYID8SW1SmSN6/mIB/A=";
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-hIA+qdWoOJI9/hqBUSHhmh+jjzDnPiZkIzszCPuQxd0=";
  };

  files = ''(:defaults "dist")'';

  patches = [
    (replaceVars ./specify-copilot-install-dir.patch {
      copilot-node-server = pinned-copilot-node-server;
    })
  ];
  postPatch = ''
    substituteInPlace copilot.el \
      --replace-fail "defcustom copilot-server-executable \"copilot-language-server\"" \
                     "defcustom copilot-server-executable \"${lib.getExe copilot-language-server}\""
  '';

  packageRequires = [
    dash
    editorconfig
    f
    jsonrpc
    s
  ];

@@ -64,4 +52,4 @@ melpaBuild {
      "x86_64-windows"
    ];
  };
}
})
+0 −14
Original line number Diff line number Diff line
diff --git a/copilot.el b/copilot.el
index f1f5e51..ddf2b5b 100644
--- a/copilot.el
+++ b/copilot.el
@@ -132,8 +132,7 @@ (defcustom copilot-indentation-alist
 (defconst copilot-server-package-name "copilot-node-server"
   "The name of the package to install copilot server.")
 
-(defcustom copilot-install-dir (expand-file-name
-                                (locate-user-emacs-file (f-join ".cache" "copilot")))
+(defcustom copilot-install-dir "@copilot-node-server@"
   "Directory in which the servers will be installed."
   :risky t
   :type 'directory