2020-10-01 21:25:28 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2024-01-07 03:30:02 +00:00
|
|
|
, python3
|
2020-10-01 21:25:28 +00:00
|
|
|
, jdk
|
|
|
|
}:
|
|
|
|
|
2024-01-07 03:30:02 +00:00
|
|
|
let
|
2024-08-08 09:12:23 +00:00
|
|
|
timestamp = "202408011337";
|
2024-01-07 03:30:02 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-10-01 21:25:28 +00:00
|
|
|
pname = "jdt-language-server";
|
2024-08-08 09:12:23 +00:00
|
|
|
version = "1.38.0";
|
2020-10-01 21:25:28 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-07 03:30:02 +00:00
|
|
|
url = "https://download.eclipse.org/jdtls/milestones/${finalAttrs.version}/jdt-language-server-${finalAttrs.version}-${timestamp}.tar.gz";
|
2024-08-08 09:12:23 +00:00
|
|
|
hash = "sha256-uml3iKGfK6V7FjAqums0PGSZKMlfdrDRcElKwS0XrHg=";
|
2020-10-01 21:25:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-01-07 03:30:02 +00:00
|
|
|
# Used for the included wrapper
|
|
|
|
python3
|
2020-10-01 21:25:28 +00:00
|
|
|
];
|
|
|
|
|
2024-01-07 03:30:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
# We store the plugins, config, and features folder in different locations
|
|
|
|
# than in the original package. In addition, hard-code the path to the jdk
|
|
|
|
# in the wrapper, instead of searching for it in PATH at runtime.
|
|
|
|
substituteInPlace bin/jdtls.py \
|
2024-07-05 23:02:10 +00:00
|
|
|
--replace-fail "jdtls_base_path = Path(__file__).parent.parent" "jdtls_base_path = Path(\"$out/share/java/jdtls/\")" \
|
|
|
|
--replace-fail "java_executable = get_java_executable(known_args)" "java_executable = '${lib.getExe jdk}'"
|
2024-01-07 03:30:02 +00:00
|
|
|
'';
|
2020-10-01 21:25:28 +00:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
let
|
2024-01-07 03:30:02 +00:00
|
|
|
# The application ships with different config directories for each platform.
|
|
|
|
# Note the application come with ARM variants as well, although the
|
|
|
|
# current included wrapper doesn't use them.
|
2020-10-01 21:25:28 +00:00
|
|
|
configDir = if stdenv.isDarwin then "config_mac" else "config_linux";
|
|
|
|
in
|
2024-01-07 03:30:02 +00:00
|
|
|
''
|
2024-01-24 18:33:55 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2024-01-07 03:30:02 +00:00
|
|
|
install -Dm444 -t $out/share/java/jdtls/plugins/ plugins/*
|
|
|
|
install -Dm444 -t $out/share/java/jdtls/features/ features/*
|
|
|
|
install -Dm444 -t $out/share/java/jdtls/${configDir} ${configDir}/*
|
|
|
|
install -Dm555 -t $out/bin bin/jdtls
|
|
|
|
install -Dm444 -t $out/bin bin/jdtls.py
|
2024-01-24 18:33:55 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-10-01 21:25:28 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-11 10:27:51 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2024-01-07 03:30:02 +00:00
|
|
|
meta = {
|
2020-10-01 21:25:28 +00:00
|
|
|
homepage = "https://github.com/eclipse/eclipse.jdt.ls";
|
|
|
|
description = "Java language server";
|
2024-01-07 03:30:02 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
|
|
|
|
license = lib.licenses.epl20;
|
|
|
|
maintainers = with lib.maintainers; [ matt-snider ];
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
mainProgram = "jdtls";
|
2020-10-01 21:25:28 +00:00
|
|
|
};
|
2024-01-07 03:30:02 +00:00
|
|
|
})
|