depot/third_party/nixpkgs/pkgs/by-name/ol/ols/package.nix
Default email 98eb3e9ef5 Project import generated by Copybara.
GitOrigin-RevId: 00d80d13810dbfea8ab4ed1009b09100cca86ba8
2024-07-01 15:47:52 +00:00

59 lines
1.1 KiB
Nix

{
fetchFromGitHub,
lib,
makeBinaryWrapper,
odin,
stdenv,
unstableGitUpdater,
}:
stdenv.mkDerivation {
pname = "ols";
version = "0-unstable-2024-06-18";
src = fetchFromGitHub {
owner = "DanielGavin";
repo = "ols";
rev = "6209c11593a3ac175d058a1b12a884fa4d288620";
hash = "sha256-YAeYmX62+5FjHIYt2uWY4aVW6v326vNFl4vQLl585lg=";
};
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";
};
}