2022-10-04 22:08:43 +00:00
|
|
|
{
|
2024-06-30 15:58:29 +00:00
|
|
|
lua5_3,
|
|
|
|
stdenv,
|
|
|
|
makeWrapper,
|
|
|
|
}:
|
2022-10-04 22:08:43 +00:00
|
|
|
let
|
2025-02-10 21:55:08 +00:00
|
|
|
lua = lua5_3.withPackages (
|
|
|
|
ps: with ps; [
|
|
|
|
luasocket
|
|
|
|
luaposix
|
|
|
|
fennel
|
|
|
|
]
|
|
|
|
);
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2022-10-04 22:08:43 +00:00
|
|
|
pname = "tufted";
|
|
|
|
version = "1";
|
2025-02-10 21:55:08 +00:00
|
|
|
phases = [
|
|
|
|
"unpackPhase"
|
|
|
|
"installPhase"
|
|
|
|
];
|
2023-02-07 23:04:01 +00:00
|
|
|
buildInputs = [
|
|
|
|
lua
|
|
|
|
];
|
2022-10-04 22:08:43 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
src = ./.;
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib
|
2023-02-15 20:07:24 +00:00
|
|
|
cp tftp.lua tufted.fnl $out/lib
|
2023-02-07 23:04:01 +00:00
|
|
|
makeWrapper ${lua.pkgs.fennel}/bin/fennel \
|
2022-10-04 22:08:43 +00:00
|
|
|
$out/bin/tufted \
|
2023-02-07 23:04:01 +00:00
|
|
|
--prefix LUA_CPATH \; "${lua}/lib/lua/5.3/?.so" \
|
2022-10-04 22:08:43 +00:00
|
|
|
--add-flags "--add-fennel-path $out/lib/?.fnl" \
|
|
|
|
--add-flags "--add-package-path $out/lib/?.lua" \
|
2023-02-07 23:04:01 +00:00
|
|
|
--add-flags "--add-package-path ${lua}/share/lua/5.3/?.lua\;${lua}/share/lua/5.3/?/init.lua" \
|
2022-10-04 22:08:43 +00:00
|
|
|
--add-flags "$out/lib/tufted.fnl"
|
|
|
|
'';
|
|
|
|
}
|