depot/third_party/nixpkgs/pkgs/by-name/ol/ols/package.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

59 lines
1.1 KiB
Nix

{
fetchFromGitHub,
lib,
makeBinaryWrapper,
odin,
stdenv,
unstableGitUpdater,
}:
stdenv.mkDerivation {
pname = "ols";
version = "0-unstable-2024-06-04";
src = fetchFromGitHub {
owner = "DanielGavin";
repo = "ols";
rev = "5805fd0b688446eeb23528497972b9f934208f1a";
hash = "sha256-zvojGIxMGawddWx5vnBQMTybz+jL9LXfaShbof7wwq0=";
};
postPatch = ''
patchShebangs build.sh
'';
nativeBuildInputs = [ makeBinaryWrapper ];
buildInputs = [ odin ];
buildPhase = ''
runHook preBuild
./build.sh
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 ols -t $out/bin/
wrapProgram $out/bin/ols --set-default ODIN_ROOT ${odin}/share
runHook postInstall
'';
passthru.updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
meta = {
inherit (odin.meta) platforms;
description = "Language server for the Odin programming language";
homepage = "https://github.com/DanielGavin/ols";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
astavie
znaniye
];
mainProgram = "ols";
};
}