From b67280dd6fb1e4711e56bdc3f39e6a7f5f91d789 Mon Sep 17 00:00:00 2001 From: Josh Bode Date: Sun, 27 Oct 2024 12:32:47 +1100 Subject: [PATCH] fnlfmt: use included `Makefile` for build Solves missing `fnlfmt` pagkage error since it is not being inlined --- pkgs/development/tools/fnlfmt/default.nix | 34 +++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/development/tools/fnlfmt/default.nix b/pkgs/development/tools/fnlfmt/default.nix index a5f325ebdab8..052068710cf3 100644 --- a/pkgs/development/tools/fnlfmt/default.nix +++ b/pkgs/development/tools/fnlfmt/default.nix @@ -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";