Unverified Commit 3e46dff7 authored by Rick van Schijndel's avatar Rick van Schijndel Committed by GitHub
Browse files

fnlfmt: use included `Makefile` for build (#351547)

parents 4472a2a1 b67280dd
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
{ 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";