build
This commit is contained in:
47
flake.nix
47
flake.nix
@@ -102,7 +102,6 @@
|
||||
|
||||
};
|
||||
|
||||
|
||||
MainGUI = pkgs.stdenvNoCC.mkDerivation {
|
||||
|
||||
name = "MainGUI";
|
||||
@@ -145,6 +144,52 @@
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
Ollama = pkgs.stdenvNoCC.mkDerivation {
|
||||
|
||||
name = "Ollama";
|
||||
|
||||
src = ./.;
|
||||
|
||||
inherit imgui;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
clang
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
glfw
|
||||
glew
|
||||
|
||||
curl
|
||||
nlohmann_json
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
clang++ \
|
||||
modules/Ollama/src/*.cpp \
|
||||
modules/ImguiModule/src/*.cpp \
|
||||
modules/WindowModule/src/*.cpp \
|
||||
$imgui/backends/imgui_impl_glfw.cpp \
|
||||
$imgui/backends/imgui_impl_opengl3.cpp \
|
||||
$imgui/misc/cpp/*.cpp \
|
||||
$imgui/*.cpp \
|
||||
-DRENDERER_OPENGL \
|
||||
-DWINDOW_GLFW \
|
||||
-DMAINGUI_DYNAMIC \
|
||||
-fpic -shared \
|
||||
-I src -I include -I $imgui -I . \
|
||||
-lGL -lglfw -lGLEW \
|
||||
-Wall \
|
||||
-o $name
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp $name $out/bin
|
||||
'';
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "Ollama.h"
|
||||
#include "modules/ImguiModule/src/ImguiModule.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
Ollama::Ollama(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
|
||||
|
||||
name = "Ollama";
|
||||
@@ -27,6 +24,8 @@ void Ollama::onLoad() {
|
||||
|
||||
ImGui::SetCurrentContext(im->getContext());
|
||||
|
||||
curl = curl_easy_init();
|
||||
|
||||
}
|
||||
|
||||
void Ollama::run() {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "Archimedes.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
class Ollama : public Archimedes::Module {
|
||||
|
||||
public:
|
||||
@@ -10,6 +13,10 @@ class Ollama : public Archimedes::Module {
|
||||
void onLoad();
|
||||
|
||||
void run();
|
||||
|
||||
private:
|
||||
CURL* curl;
|
||||
|
||||
};
|
||||
|
||||
#ifdef OLLAMA_DYNAMIC
|
||||
|
||||
Reference in New Issue
Block a user