2024-10-04 16:56:33 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
substituteAll,
|
|
|
|
antlr4_9,
|
|
|
|
libargs,
|
|
|
|
catch2,
|
|
|
|
cmake,
|
|
|
|
yaml-cpp,
|
|
|
|
}:
|
2022-12-28 21:21:41 +00:00
|
|
|
let
|
|
|
|
antlr4 = antlr4_9;
|
|
|
|
in
|
2021-03-09 03:18:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "luaformatter";
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "1.3.6";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-08-22 07:53:02 +00:00
|
|
|
owner = "Koihik";
|
|
|
|
repo = "LuaFormatter";
|
2021-03-09 03:18:52 +00:00
|
|
|
rev = version;
|
2021-08-22 07:53:02 +00:00
|
|
|
sha256 = "14l1f9hrp6m7z3cm5yl0njba6gfixzdirxjl8nihp9val0685vm0";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-lib-paths.patch;
|
|
|
|
antlr4RuntimeCpp = antlr4.runtime.cpp.dev;
|
2023-02-02 18:25:31 +00:00
|
|
|
inherit libargs catch2 yaml-cpp;
|
2021-08-22 07:53:02 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
buildInputs = [
|
|
|
|
antlr4.runtime.cpp
|
|
|
|
yaml-cpp
|
|
|
|
];
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString (
|
|
|
|
stdenv.isDarwin && stdenv.isx86_64
|
|
|
|
) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-08-22 07:53:02 +00:00
|
|
|
description = "Code formatter for Lua";
|
|
|
|
homepage = "https://github.com/Koihik/LuaFormatter";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.asl20;
|
2021-09-18 10:52:07 +00:00
|
|
|
platforms = platforms.all;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2021-08-22 07:53:02 +00:00
|
|
|
mainProgram = "lua-format";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|