Unverified Commit 89028117 authored by Xoddiel d'Croy's avatar Xoddiel d'Croy
Browse files

luaPackages.luacov: fix HTML report generation

Fixed up the HTML report generation capability of the `luacov` Lua
package. It is not entirely clear to me whether this used to work, and
got broken at some point, or whether it never worked.

The issue is that `luacov` uses the `datafile` rock to resolve its
static files for HTML reports (such as `prettier.js`, `report.css`,
etc.), which does not properly work in a Nix environment. This is
because `datafile` relies on the specific structure of the usual
LuaRocks directory to scan for files, which `nixpkgs` messes with.

Since we can't rely on `datafile` to detect a LuaRocks environment, I've
added a manual copy step to the derivation, merging the static files
with the other Lua files. We can then utilize the source-relative opener
to find the appropriate files.
parent 381d2403
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -491,6 +491,13 @@ in
    };
  });

  luacov = prev.luacov.overrideAttrs (oa: {
    postInstall = ''
      mkdir -p $out/share/lua/${lua.luaversion}/luacov/reporter/src/luacov/reporter/html
      mv src/luacov/reporter/html/static $out/share/lua/${lua.luaversion}/luacov/reporter/src/luacov/reporter/html/static
    '';
  });

  luadbi-mysql = prev.luadbi-mysql.overrideAttrs (oa: {

    luarocksConfig = lib.recursiveUpdate oa.luarocksConfig {