forked from DGNum/liminix
get fennel from source instead of luarocks
This commit is contained in:
parent
340f7211ef
commit
d79a1e15bb
1 changed files with 16 additions and 6 deletions
|
@ -2,20 +2,30 @@
|
||||||
runCommand
|
runCommand
|
||||||
, luaSmall
|
, luaSmall
|
||||||
, runtimeShell
|
, runtimeShell
|
||||||
|
, fetchurl
|
||||||
, lib
|
, lib
|
||||||
|
, lua53Packages
|
||||||
}:
|
}:
|
||||||
let lua = luaSmall;
|
let inherit (lua53Packages) lua;
|
||||||
in name : packages : source :
|
in name : packages : source :
|
||||||
let
|
let
|
||||||
luapath = builtins.map (f: "${f}/share/lua/${lua.luaversion}/?.lua;") packages;
|
fennel = fetchurl {
|
||||||
luacpath = builtins.map (f: "${f}/lib/lua/${lua.luaversion}/?.so;") packages;
|
url = "https://fennel-lang.org/downloads/fennel-1.3.0";
|
||||||
in runCommand name {} ''
|
hash = "sha256-hYSD3rBYF8iTjBOA1m+TvUu8BSp8q6uIMUXi0xwo/dU=";
|
||||||
|
};
|
||||||
|
|
||||||
|
luapath = builtins.map (f: "${f}/share/lua/${luaSmall.luaversion}/?.lua;") packages;
|
||||||
|
luacpath = builtins.map (f: "${f}/lib/lua/${luaSmall.luaversion}/?.so;") packages;
|
||||||
|
in runCommand name {
|
||||||
|
nativeBuildInputs = [ lua ];
|
||||||
|
} ''
|
||||||
|
echo $PATH
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
(
|
(
|
||||||
echo "#!${lua}/bin/lua"
|
echo "#!${luaSmall}/bin/lua"
|
||||||
echo "package.path = ${lib.strings.escapeShellArg luapath} .. package.path"
|
echo "package.path = ${lib.strings.escapeShellArg luapath} .. package.path"
|
||||||
echo "package.cpath = ${lib.strings.escapeShellArg luacpath} .. package.cpath"
|
echo "package.cpath = ${lib.strings.escapeShellArg luacpath} .. package.cpath"
|
||||||
${lua.pkgs.fennel}/bin/fennel --correlate --compile ${source}
|
lua ${fennel} --correlate --compile ${source}
|
||||||
) > $out
|
) > $out
|
||||||
chmod a+x $out
|
chmod a+x $out
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in a new issue