Skip to content

Commit

Permalink
fnlfmt: use included Makefile for build
Browse files Browse the repository at this point in the history
Solves missing `fnlfmt` pagkage error since it is not being inlined
  • Loading branch information
joshbode committed Oct 27, 2024
1 parent 79ed655 commit d88d2e2
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 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 @@ -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 ];
Expand Down

0 comments on commit d88d2e2

Please sign in to comment.