From d88d2e234c177f20c452381f38720f8d83c6b4cc 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 | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/pkgs/development/tools/fnlfmt/default.nix b/pkgs/development/tools/fnlfmt/default.nix index a5f325ebdab87..6d6f2d340ac16 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"; @@ -11,29 +17,23 @@ stdenv.mkDerivation rec { hash = "sha256-LYHhKC8iA4N8DdCH8GfSOkN/e+W3YjkFhVSDQraKoFk="; }; - nativeBuildInputs = [ luaPackages.fennel ]; + nativeBuildInputs = [ + lua + luaPackages.fennel + ]; - buildInputs = [ lua ]; + makeFlags = [ "PREFIX=$(out)" ]; + sourceRoot = [ "${src.name}/tags/${version}" ]; - buildPhase = '' - runHook preBuild - - echo "#!${lua}/bin/lua" > fnlfmt - ${luaPackages.fennel}/bin/fennel --require-as-include --compile tags/${version}/cli.fnl >> fnlfmt - chmod +x fnlfmt - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - install -D ./fnlfmt $out/bin/fnlfmt - runHook postInstall + doInstallCheck = true; + installCheckPhase = '' + $out/bin/fnlfmt --help > /dev/null ''; - meta = with lib; { + meta = with lib; rec { description = "Formatter for Fennel"; - homepage = "https://git.sr.ht/~technomancy/fnlfmt"; + homepage = src.meta.homepage; + changelog = "${homepage}/tree/${version}/changelog.md"; license = licenses.lgpl3Plus; platforms = lua.meta.platforms; maintainers = with maintainers; [ chiroptical ];