fnlfmt: use included Makefile for build (#351547)

This commit is contained in:
Rick van Schijndel 2024-10-29 18:24:49 +01:00 committed by GitHub
commit 3e46dff78b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,10 @@
{ lib, stdenv, fetchFromSourcehut, luaPackages, lua }:
{
lib,
stdenv,
fetchFromSourcehut,
lua,
luaPackages,
}:
stdenv.mkDerivation rec {
pname = "fnlfmt";
@ -15,26 +21,26 @@ stdenv.mkDerivation rec {
buildInputs = [ lua ];
buildPhase = ''
runHook preBuild
makeFlags = [
"PREFIX=$(out)"
"FENNEL=${luaPackages.fennel}/bin/fennel"
];
sourceRoot = [ "${src.name}/tags/${version}" ];
echo "#!${lua}/bin/lua" > fnlfmt
${luaPackages.fennel}/bin/fennel --require-as-include --compile tags/${version}/cli.fnl >> fnlfmt
chmod +x fnlfmt
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
runHook postBuild
'';
$out/bin/fnlfmt --help > /dev/null
installPhase = ''
runHook preInstall
install -D ./fnlfmt $out/bin/fnlfmt
runHook postInstall
runHook postInstallCheck
'';
meta = with lib; {
description = "Formatter for Fennel";
homepage = "https://git.sr.ht/~technomancy/fnlfmt";
license = licenses.lgpl3Plus;
homepage = src.meta.homepage;
changelog = "${src.meta.homepage}/tree/${version}/changelog.md";
license = licenses.mit;
platforms = lua.meta.platforms;
maintainers = with maintainers; [ chiroptical ];
mainProgram = "fnlfmt";