Skip to content

Commit

Permalink
fnlfmt: use included Makefile for build (#351547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindavi authored Oct 29, 2024
2 parents 4472a2a + b67280d commit 3e46dff
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions pkgs/development/tools/fnlfmt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ lib, stdenv, fetchFromSourcehut, luaPackages, lua }:
{
lib,
stdenv,
fetchFromSourcehut,
lua,
luaPackages,
}:

stdenv.mkDerivation rec {
pname = "fnlfmt";
Expand All @@ -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";
Expand Down

0 comments on commit 3e46dff

Please sign in to comment.