1# Hooks for building lua packages.
2{ lua
3, lib
4, makeSetupHook
5, findutils
6, runCommand
7}:
8
9let
10 callPackage = lua.pkgs.callPackage;
11 luaInterpreter = lua.interpreter;
12in {
13
14 lua-setup-hook = LuaPathSearchPaths: LuaCPathSearchPaths:
15 let
16 hook = ./setup-hook.sh;
17 in runCommand "lua-setup-hook.sh" {
18 # hum doesn't seem to like caps !! BUG ?
19 luapathsearchpaths=lib.escapeShellArgs LuaPathSearchPaths;
20 luacpathsearchpaths=lib.escapeShellArgs LuaCPathSearchPaths;
21 } ''
22 cp ${hook} hook.sh
23 substituteAllInPlace hook.sh
24 mv hook.sh $out
25 '';
26
27 luarocksCheckHook = callPackage ({ luarocks }:
28 makeSetupHook {
29 name = "luarocks-check-hook";
30 propagatedBuildInputs = [ luarocks ];
31 } ./luarocks-check-hook.sh) {};
32
33 # luarocks installs data in a non-overridable location. Until a proper luarocks patch,
34 # we move the files around ourselves
35 luarocksMoveDataFolder = callPackage ({ }:
36 makeSetupHook {
37 name = "luarocks-move-rock";
38 propagatedBuildInputs = [ ];
39 } ./luarocks-move-data.sh) {};
40}