From 44eb727dc537403be092326639a5b7c6d7182146 Mon Sep 17 00:00:00 2001 From: dacctal Date: Sat, 2 May 2026 08:38:13 +0000 Subject: fixed like half of everything idk, you can install stuff now --- include/build.hh | 4 ++-- include/create_pkg.hh | 2 +- include/lua_build.hh | 2 +- include/lua_state.hh | 29 +++++++++++++++++++++++++++++ include/setup_repo.hh | 6 ------ include/vars.hh | 2 ++ 6 files changed, 35 insertions(+), 10 deletions(-) delete mode 100644 include/setup_repo.hh (limited to 'include') diff --git a/include/build.hh b/include/build.hh index 426f786..fb42ef1 100644 --- a/include/build.hh +++ b/include/build.hh @@ -1,7 +1,7 @@ #ifndef BUILD #define BUILD -#include -void build(std::filesystem::path build_dir); +#include "vars.hh" +void build(Pkg pkg); #endif diff --git a/include/create_pkg.hh b/include/create_pkg.hh index 0af5ccc..d7589f9 100644 --- a/include/create_pkg.hh +++ b/include/create_pkg.hh @@ -2,6 +2,6 @@ #define CREATE_PKG #include "vars.hh" -Pkg create_pkg(std::string arg); +Pkg create_pkg(std::string arg, const char* target = "default"); #endif diff --git a/include/lua_build.hh b/include/lua_build.hh index a7cdf39..473d80e 100644 --- a/include/lua_build.hh +++ b/include/lua_build.hh @@ -5,6 +5,6 @@ #include #include -bool lua_build(const char *path); +bool lua_build(const char* repository, const char* target, const char* path); #endif diff --git a/include/lua_state.hh b/include/lua_state.hh index a8dfed8..5965093 100644 --- a/include/lua_state.hh +++ b/include/lua_state.hh @@ -1,17 +1,46 @@ #ifndef LUA_STATE #define LUA_STATE +#include +#include extern "C" { #include #include #include } +typedef struct { + std::string key; + std::string value; +} url; + +typedef struct { + std::string url; + std::string version; +} dependency; + +typedef struct { + url source; + std::unordered_map dependencies; + int build; + int pre_install; + int install; + int post_install; +} repo; + +extern std::unordered_map cached_install_directories; +extern std::unordered_map cached_repos; +extern std::unordered_map cached_build_systems; + + void init_lua_state(); void free_lua_state(); lua_State* get_lua_state(); void cache_install_directories(); +bool repo_build(const char* repoository); +bool bldit(const char* target); +bool config_build(const char* path); void cache_repos(); void cache_build_systems(); diff --git a/include/setup_repo.hh b/include/setup_repo.hh deleted file mode 100644 index d383351..0000000 --- a/include/setup_repo.hh +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SETUP_REPO -#define SETUP_REPO - -void setup_repo(); - -#endif diff --git a/include/vars.hh b/include/vars.hh index b70615b..8c82155 100644 --- a/include/vars.hh +++ b/include/vars.hh @@ -15,6 +15,7 @@ extern bool config_exists; struct Pkg { std::string url; std::string name; + const char* target; std::string ver; std::filesystem::path src; }; @@ -76,6 +77,7 @@ extern const std::string color_reset; extern const std::string print_pkgit; extern const std::string print_skipped; +extern const std::string print_warning; extern const std::string print_error; #endif -- cgit v1.2.3