2023-09-05 16:45:20 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
2024-07-02 21:30:08 +00:00
|
|
|
fetchYarnDeps,
|
|
|
|
fixup-yarn-lock,
|
|
|
|
makeWrapper,
|
|
|
|
nodejs,
|
|
|
|
stdenv,
|
|
|
|
yarn,
|
2023-09-05 16:45:20 +00:00
|
|
|
}:
|
|
|
|
|
2024-07-02 21:30:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2023-09-05 16:45:20 +00:00
|
|
|
pname = "yaml-language-server";
|
2024-06-20 02:42:19 +00:00
|
|
|
version = "1.15.0";
|
2023-09-05 16:45:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "redhat-developer";
|
|
|
|
repo = "yaml-language-server";
|
|
|
|
rev = version;
|
2024-06-20 02:42:19 +00:00
|
|
|
hash = "sha256-Y3Q/y9UIiy7US8Jl4vxT0Pfw8h3hiXK+Cu9TEQHyAaA=";
|
2023-09-05 16:45:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
|
|
|
hash = "sha256-zHcxZ4VU6CGux72Nsy0foU4gFshK1wO/LTfnwOoirmg=";
|
|
|
|
};
|
|
|
|
|
2024-07-02 21:30:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
fixup-yarn-lock
|
|
|
|
yarn
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
nodejs
|
|
|
|
];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
yarn config --offline set yarn-offline-mirror "$offlineCache"
|
|
|
|
fixup-yarn-lock yarn.lock
|
|
|
|
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
|
|
|
|
patchShebangs node_modules
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
2023-09-05 16:45:20 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
2024-07-02 21:30:08 +00:00
|
|
|
yarn --offline compile
|
|
|
|
yarn --offline build:libs
|
2023-09-05 16:45:20 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
2024-07-02 21:30:08 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
yarn --offline --production install
|
|
|
|
|
|
|
|
mkdir -p $out/bin $out/lib/node_modules/yaml-language-server
|
|
|
|
cp -r . $out/lib/node_modules/yaml-language-server
|
|
|
|
ln -s $out/lib/node_modules/yaml-language-server/bin/yaml-language-server $out/bin/
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-09-05 16:45:20 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/redhat-developer/yaml-language-server/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
description = "Language Server for YAML Files";
|
|
|
|
homepage = "https://github.com/redhat-developer/yaml-language-server";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
mainProgram = "yaml-language-server";
|
2024-06-22 13:03:16 +00:00
|
|
|
maintainers = [ ];
|
2023-09-05 16:45:20 +00:00
|
|
|
};
|
|
|
|
}
|