Merge pull request #280251 from eclairevoyant/jdtls

jdt-language-server: move to `pkgs/by-name`, set `passthru.updateScript`
This commit is contained in:
kirillrdy 2024-01-25 06:30:38 +09:00 committed by GitHub
commit 06324f03cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 2 deletions

View File

@ -48,6 +48,8 @@ stdenv.mkDerivation (finalAttrs: {
install -Dm444 -t $out/bin bin/jdtls.py
'';
passthru.updateScript = ./update.sh;
meta = {
homepage = "https://github.com/eclipse/eclipse.jdt.ls";
description = "Java language server";

View File

@ -0,0 +1,21 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash --pure -p curl cacert libxml2 yq nix jq
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
DRV_DIR="$PWD"
# scrape the downloads page for release info
newver=$(curl -s 'https://download.eclipse.org/jdtls/milestones/' | xmllint --html - --xmlout 2>/dev/null | xq --raw-output '.html.body.main.div.div.div[0].div.table.tr | max_by(.td[3]).td[1].a.["#text"]')
prefix="https://download.eclipse.org/jdtls/milestones/$newver"
filename=$(curl -s "$prefix/latest.txt")
newtimestamp=$(echo $filename | sed "s|^.*-$newver-||;s|\.tar\.gz$||")
newhash="$(nix-hash --to-sri --type sha256 $(nix-prefetch-url "$prefix/$filename"))";
sed -i default.nix \
-e "/^ version =/ s|\".*\"|\"$newver\"|" \
-e "/^ timestamp =/ s|\".*\"|\"$newtimestamp\"|" \
-e "/^ hash =/ s|\".*\"|\"$newhash\"|" \

View File

@ -18324,8 +18324,6 @@ with pkgs;
javascript-typescript-langserver = callPackage ../development/tools/language-servers/javascript-typescript-langserver { };
jdt-language-server = callPackage ../development/tools/language-servers/jdt-language-server { };
jsonnet-language-server = callPackage ../development/tools/language-servers/jsonnet-language-server { };
kotlin-language-server = callPackage ../development/tools/language-servers/kotlin-language-server { };