From 1371aac8280c8281d7b79926fc7b8d8e38cda3ab Mon Sep 17 00:00:00 2001 From: forever2k38 Date: Sun, 6 Sep 2026 22:35:45 +0200 Subject: feat: initial builds! --- src/build.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/build.c') diff --git a/src/build.c b/src/build.c index 855b38b..243f3bc 100644 --- a/src/build.c +++ b/src/build.c @@ -2,10 +2,12 @@ #include "package.h" #include "paths.h" +#include "download.h" #include "lauxlib.h" #include "lua.h" #include "lualib.h" #include "stdio.h" +#include "stdlib.h" #include "unistd.h" int pow_package_build(pow_package *pkg) { @@ -31,16 +33,25 @@ int pow_package_build(pow_package *pkg) { if ((err = chdir(tmp_path))) { printf("uh oh oops %d\n", err); + + return 1; } + printf("building package %s\n", pkg->name); + + pow_download_source(pkg->sources[0], tmp_path); + lua_getfield(pkg->L, -1, "build"); if (lua_pcall(pkg->L, 0, 0, 0) != LUA_OK) { + free(tmp_path); + printf("error running script: %s\n", lua_tostring(pkg->L, -1)); return 1; } + free(tmp_path); fflush(stdout); return 0; -- cgit v1.3