about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorMario Rodas2024-04-21 04:20:00 +0000
committerMario Rodas2024-04-21 04:20:00 +0000
commit30de194f8072314abc8d51d243466bdb35860bd7 (patch)
treef7291893f940e2905064d1eddaa719e9da2bb03c /pkgs/applications
parent3a82632c9bc5b34ab9f26138de48d44e9440afef (diff)
emacsPackages.lsp-bridge: fix passthru.updateScript
Emacs packages require a version string compatible with
`package-build.el`, which differs from `unstableGitUpdater`.
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix19
1 files changed, 17 insertions, 2 deletions
diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix
index 2ddd3e0bda3f..7bdd8dcca145 100644
--- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix
+++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix
@@ -11,8 +11,8 @@
 , pyright
 , ruff
 , tempel
+, writeScript
 , writeText
-, unstableGitUpdater
 }:
 
 let
@@ -88,7 +88,22 @@ melpaBuild {
     runHook postCheck
   '';
 
-  passthru.updateScript = unstableGitUpdater { };
+  passthru.updateScript = writeScript "update.sh" ''
+    #!/usr/bin/env nix-shell
+    #!nix-shell -i bash -p common-updater-scripts coreutils git gnused
+    set -eu -o pipefail
+
+    tmpdir="$(mktemp -d)"
+    git clone --depth=1 https://github.com/manateelazycat/lsp-bridge.git "$tmpdir"
+
+    pushd "$tmpdir"
+    commit=$(git show -s --pretty='format:%H')
+    # Based on: https://github.com/melpa/melpa/blob/2d8716906a0c9e18d6c979d8450bf1d15dd785eb/package-build/package-build.el#L523-L533
+    version=$(TZ=UTC git show -s --pretty='format:%cd' --date='format-local:%Y%m%d.%H%M' | sed 's|\.0*|.|')
+    popd
+
+    update-source-version emacsPackages.lsp-bridge $version --rev="$commit"
+  '';
 
   meta = with lib; {
     description = "A blazingly fast LSP client for Emacs";