1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 replaceVars,
6 antlr4_9,
7 libargs,
8 catch2,
9 cmake,
10 yaml-cpp,
11}:
12let
13 antlr4 = antlr4_9;
14in
15stdenv.mkDerivation rec {
16 pname = "luaformatter";
17 version = "1.3.6";
18
19 src = fetchFromGitHub {
20 owner = "Koihik";
21 repo = "LuaFormatter";
22 rev = version;
23 sha256 = "14l1f9hrp6m7z3cm5yl0njba6gfixzdirxjl8nihp9val0685vm0";
24 };
25
26 patches = [
27 (replaceVars ./fix-lib-paths.patch {
28 antlr4RuntimeCpp = antlr4.runtime.cpp.dev;
29 yamlCpp = yaml-cpp;
30 inherit libargs catch2;
31 })
32 ];
33
34 nativeBuildInputs = [ cmake ];
35
36 buildInputs = [
37 antlr4.runtime.cpp
38 yaml-cpp
39 ];
40
41 meta = with lib; {
42 description = "Code formatter for Lua";
43 homepage = "https://github.com/Koihik/LuaFormatter";
44 license = licenses.asl20;
45 platforms = platforms.all;
46 maintainers = with maintainers; [ figsoda ];
47 mainProgram = "lua-format";
48 };
49}