Merge pull request #134716 from SuperSandro2000/luaformatter

luaformatter: combine with duplicate package lua-format, remove submo…
This commit is contained in:
Sandro 2021-08-19 00:07:27 +02:00 committed by GitHub
commit 90fcdb586a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 48 deletions

View File

@ -1,31 +1,33 @@
{ cmake, fetchFromGitHub, lib, stdenv }:
{ lib, stdenv, fetchFromGitHub, substituteAll, antlr4, libargs, catch2, cmake, libyamlcpp }:
stdenv.mkDerivation rec {
pname = "luaformatter";
version = "1.3.6";
src = fetchFromGitHub {
owner = "koihik";
repo = "luaformatter";
owner = "Koihik";
repo = "LuaFormatter";
rev = version;
sha256 = "0440kdab5i0vhlk71sbprdrhg362al8jqpy7w2vdhcz1fpi5cm0b";
fetchSubmodules = true;
sha256 = "14l1f9hrp6m7z3cm5yl0njba6gfixzdirxjl8nihp9val0685vm0";
};
patches = [
(substituteAll {
src = ./fix-lib-paths.patch;
antlr4RuntimeCpp = antlr4.runtime.cpp.dev;
inherit libargs catch2 libyamlcpp;
})
];
nativeBuildInputs = [ cmake ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp lua-format $out/bin
runHook postInstall
'';
buildInputs = [ antlr4.runtime.cpp libyamlcpp ];
meta = with lib; {
description = "Code formatter for lua";
homepage = "https://github.com/koihik/luaformatter";
description = "Code formatter for Lua";
homepage = "https://github.com/Koihik/LuaFormatter";
license = licenses.asl20;
maintainers = with maintainers; [ figsoda ];
maintainers = with maintainers; [ figsoda SuperSandro2000 ];
mainProgram = "lua-format";
};
}

View File

@ -1,32 +0,0 @@
{ lib, stdenv, fetchFromGitHub, substituteAll, antlr4, libargs, catch2, cmake, libyamlcpp }:
stdenv.mkDerivation rec {
pname = "lua-format";
version = "1.3.6";
src = fetchFromGitHub {
owner = "Koihik";
repo = "LuaFormatter";
rev = version;
sha256 = "14l1f9hrp6m7z3cm5yl0njba6gfixzdirxjl8nihp9val0685vm0";
};
patches = [
(substituteAll {
src = ./fix-lib-paths.patch;
antlr4RuntimeCpp = antlr4.runtime.cpp.dev;
inherit libargs catch2 libyamlcpp;
})
];
nativeBuildInputs = [ cmake ];
buildInputs = [ antlr4.runtime.cpp libyamlcpp ];
meta = with lib; {
description = "Code formatter for Lua";
homepage = "https://github.com/Koihik/LuaFormatter";
license = licenses.asl20;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}

View File

@ -971,8 +971,6 @@ with pkgs;
logseq = callPackage ../applications/misc/logseq { };
lua-format = callPackage ../tools/misc/lua-format { };
lxterminal = callPackage ../applications/terminal-emulators/lxterminal { };
microcom = callPackage ../applications/terminal-emulators/microcom { };