Skip to content

Commit

Permalink
emacsPackages.lsp-bridge: clean
Browse files Browse the repository at this point in the history
  • Loading branch information
jian-lin authored and kira-bruneau committed Jul 19, 2024
1 parent 7c0dd19 commit 2294034
Showing 1 changed file with 14 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
, pyright
, ruff
, tempel
, writeScript
, writeText
, unstableGitUpdater
}:

let
rev = "0babcae1bb1fba67257916011a638675e07ec753";
python = python3.withPackages (ps: with ps; [
epc
orjson
Expand All @@ -29,17 +27,15 @@ let
in
melpaBuild {
pname = "lsp-bridge";
version = "20240702.1417";
version = "0-unstable-2024-06-29";

src = fetchFromGitHub {
owner = "manateelazycat";
repo = "lsp-bridge";
inherit rev;
rev = "0babcae1bb1fba67257916011a638675e07ec753";
hash = "sha256-jr0KF0MqeV6ULMWjB4hRJOyv2i7UP51owtIWcEAfvzU=";
};

commit = rev;

patches = [
# Hardcode the python dependencies needed for lsp-bridge, so users
# don't have to modify their global environment
Expand All @@ -64,17 +60,13 @@ melpaBuild {
tempel
];

recipe = writeText "recipe" ''
(lsp-bridge
:repo "manateelazycat/lsp-bridge"
:fetcher github
:files
("*.el"
"lsp_bridge.py"
"core"
"langserver"
"multiserver"
"resources"))
files = ''
("*.el"
"lsp_bridge.py"
"core"
"langserver"
"multiserver"
"resources")
'';

doCheck = true;
Expand All @@ -91,27 +83,12 @@ melpaBuild {

__darwinAllowLocalNetworking = true;

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"
'';
passthru.updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };

meta = with lib; {
meta = {
description = "Blazingly fast LSP client for Emacs";
homepage = "https://github.com/manateelazycat/lsp-bridge";
license = licenses.gpl3Only;
maintainers = with maintainers; [ fxttr kira-bruneau ];
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ fxttr kira-bruneau ];
};
}

0 comments on commit 2294034

Please sign in to comment.