add lua binding to fetch-freebsd

This commit is contained in:
Daniel Barlow
2024-08-08 13:27:21 +01:00
parent 64cd1626c6
commit 9550772cec
2 changed files with 76 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
cmake,
stdenv,
openssl,
lua,
fetchFromGitHub
}: stdenv.mkDerivation {
pname = "fetch-freebsd";
@@ -17,9 +18,14 @@
"-DFETCH_LIBRARY=ON"
"-DUSE_SYSTEM_SSL=ON"
];
postBuild = ''
$CC -shared -o fetch-lua.so ${./lua-glue.c} -I$src -Llibrary -lssl -lfetch -llua
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ openssl ];
buildInputs = [ lua openssl ];
postInstall = ''
rm -r $out/lib/lib*.a
mkdir -p $out/lib/lua/${lua.luaversion}
install fetch-lua.so $out/lib/lua/${lua.luaversion}/fetch.so
'';
}