1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
{ lib
, python3
, melpaBuild
, fetchFromGitHub
, substituteAll
, acm
, markdown-mode
, git
, go
, gopls
, pyright
, ruff
, tempel
, writeScript
, writeText
}:
let
rev = "14180dcfa42a50e5365175a1bf5dc9dd8db196eb";
python = python3.withPackages (ps: with ps; [
epc
orjson
paramiko
rapidfuzz
sexpdata
six
]);
in
melpaBuild {
pname = "lsp-bridge";
version = "20240520.1548";
src = fetchFromGitHub {
owner = "manateelazycat";
repo = "lsp-bridge";
inherit rev;
hash = "sha256-HIOIHvcazCeyAlMoVSPl8uVXh5zI+UuoNNJgIhFO6BY=";
};
commit = rev;
patches = [
# Hardcode the python dependencies needed for lsp-bridge, so users
# don't have to modify their global environment
(substituteAll {
src = ./hardcode-dependencies.patch;
python = python.interpreter;
})
];
packageRequires = [
acm
markdown-mode
];
checkInputs = [
git
go
gopls
pyright
python
ruff
tempel
];
recipe = writeText "recipe" ''
(lsp-bridge
:repo "manateelazycat/lsp-bridge"
:fetcher github
:files
("*.el"
"lsp_bridge.py"
"core"
"langserver"
"multiserver"
"resources"))
'';
doCheck = true;
checkPhase = ''
runHook preCheck
cd "$sourceRoot"
mkfifo test.log
cat < test.log &
HOME=$(mktemp -d) python -m test.test
runHook postCheck
'';
__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"
'';
meta = with lib; {
description = "A blazingly fast LSP client for Emacs";
homepage = "https://github.com/manateelazycat/lsp-bridge";
license = licenses.gpl3Only;
maintainers = with maintainers; [ fxttr kira-bruneau ];
};
}
|