nixpkgs/pkgs/by-name/st/starpls-bin/package.nix
2024-10-06 21:27:36 +02:00

43 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl, autoPatchelfHook }:
stdenv.mkDerivation (finalAttrs: {
pname = "starpls-bin";
version = "0.1.14";
src = {
x86_64-linux = fetchurl {
url = "https://github.com/withered-magic/starpls/releases/download/v${finalAttrs.version}/starpls-linux-amd64";
hash = "sha256-PYU+Jv3uaJqJKw6zSNOPl+NlIQgfm38cOrRqTdNXY+8=";
};
aarch64-darwin = fetchurl {
url = "https://github.com/withered-magic/starpls/releases/download/v${finalAttrs.version}/starpls-darwin-arm64";
hash = "sha256-9d1ybebguEUJu2PvMcToQEd8M4ajRrQUvBZqS6o0sbw=";
};
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isElf [
autoPatchelfHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isElf [
stdenv.cc.cc.lib
];
installPhase = ''
install -D $src $out/bin/starpls
'';
meta = with lib; {
homepage = "https://github.com/withered-magic/starpls";
description = "A language server for Starlark";
license = licenses.asl20;
platforms = [ "aarch64-darwin" "x86_64-linux" ];
maintainers = with maintainers; [ aaronjheng ];
mainProgram = "starpls";
};
})