luaPackages.luarocks: generate luarocks as well
When installing a lua package that depends on luarocks, luarocks was not capable of recognizing the luarocks module: https://github.com/NixOS/nixpkgs/issues/316009 . As explained here https://github.com/luarocks/luarocks/issues/1659, luarocks needs a manifest to recognize the package. I first attempted to generate a manifest with `luarocks-admin make-manifest` on our current manual luarocks derivation but this ended up being too hackish as the `make-manifest` requires a .rockspec or .rock to work, which we had not. It seemed simpled to just rename the current manual luarocks derivation to luarocks_bootstrap in order to break cyclic dependencies in buildLuarocksPackage and add a generated luarocks derivation. Previously it was impossible to test luarocks because of the cyclic dependency but we will now be able to test the generated derivation.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{ lib
|
||||
, lua
|
||||
, wrapLua
|
||||
, luarocks
|
||||
, luarocks_bootstrap
|
||||
, writeTextFile
|
||||
|
||||
# Whether the derivation provides a lua module or not.
|
||||
@@ -91,7 +91,7 @@ let
|
||||
nativeBuildInputs = [
|
||||
lua # for lua.h
|
||||
wrapLua
|
||||
luarocks
|
||||
luarocks_bootstrap
|
||||
];
|
||||
|
||||
inherit doCheck extraConfig rockspecFilename knownRockspec externalDeps nativeCheckInputs;
|
||||
@@ -99,7 +99,7 @@ let
|
||||
buildInputs = let
|
||||
# example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ]
|
||||
externalDeps' = lib.filter (dep: !lib.isDerivation dep) self.externalDeps;
|
||||
in [ lua.pkgs.luarocks ]
|
||||
in [ luarocks_bootstrap ]
|
||||
++ buildInputs
|
||||
++ lib.optionals self.doCheck ([ luarocksCheckHook ] ++ self.nativeCheckInputs)
|
||||
++ (map (d: d.dep) externalDeps')
|
||||
|
||||
Reference in New Issue
Block a user