1{ stdenv, fetchFromGitHub, makeBinaryWrapper, odin, lib }:
2
3stdenv.mkDerivation {
4 pname = "ols";
5 version = "nightly-2023-11-04";
6
7 src = fetchFromGitHub {
8 owner = "DanielGavin";
9 repo = "ols";
10 rev = "b19c24eb17e7c16bcfb3144665fd405fd5e580f3";
11 hash = "sha256-c8mHVdXbn7aRKI/QBIZvBvl4sCNK49q+crQmTCjptwM=";
12 };
13
14 nativeBuildInputs = [
15 makeBinaryWrapper
16 ];
17
18 buildInputs = [
19 odin
20 ];
21
22 postPatch = ''
23 patchShebangs build.sh
24 '';
25
26 buildPhase = ''
27 runHook preBuild
28
29 ./build.sh
30
31 runHook postBuild
32 '';
33
34 installPhase = ''
35 runHook preInstall
36
37 mkdir -p $out/bin
38 cp ols $out/bin
39 wrapProgram $out/bin/ols --set-default ODIN_ROOT ${odin}/share
40
41 runHook postInstall
42 '';
43
44 meta = with lib; {
45 description = "Language server for the Odin programming language";
46 homepage = "https://github.com/DanielGavin/ols";
47 license = licenses.mit;
48 maintainers = with maintainers; [ astavie znaniye ];
49 platforms = odin.meta.platforms;
50 };
51}