From 2eab114a120c7818861c0640ecdc300cf7366e53 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Sat, 26 Oct 2024 14:26:10 -0300 Subject: Basic storage with C interop (#1) * writer command design * dune build with shared core lib * port c lib project inside ocaml * os specific dynamic link * fix project name on flake * fix: cmake cxx version breaking merklecpp * finish write to disk and update maps func * add non atomic commit to transaction graph * merkle tree binding for generating root hash * disk module refactor --------- Co-authored-by: Renan Lopes --- flake.nix | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index ac1cb49..9f0c182 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "A compiler for a statically-typed relational programming language"; + description = "Relational Engine"; # Flake dependency specification # @@ -31,6 +31,7 @@ lib = legacyPackages.lib; merklecpp = legacyPackages.callPackage ./deps/merklecpp.nix {}; libressl = legacyPackages.callPackage ./deps/libressl.nix {}; + librelational_engine = legacyPackages.callPackage ./deps/relational_engine_lib.nix { libressl = libressl; merklecpp = merklecpp; }; # Filtered sources (prevents unecessary rebuilds) sources = { @@ -78,12 +79,17 @@ MERKLECPP_INCLUDE_PATH="${merklecpp}/include"; LIBRESSL_INCLUDE_PATH="${libressl}/include"; LIBRESSL_LIB_PATH="${libressl}/lib"; + OS_LIB_EXTENSION = if legacyPackages.stdenv.isDarwin then "dylib" else "so"; + LIBRELATIONAL_ENGINE_LIB_PATH="${librelational_engine}/lib"; + LIBRELATIONAL_ENGINE_INCLUDE_PATH="${librelational_engine}/include"; }; nativeInputs = []; - buildInputs = [ - # Ocaml package dependencies needed to build go here. + buildInputs = with ocamlPackages; [ + ctypes + ctypes-foreign + data-encoding ]; strictDeps = true; @@ -202,8 +208,9 @@ MERKLECPP_INCLUDE_PATH="${merklecpp}/include"; LIBRESSL_INCLUDE_PATH="${libressl}/include"; LIBRESSL_LIB_PATH="${libressl}/lib"; - CAML_INCLUDE_PATH="${legacyPackages.ocaml}/include"; OS_LIB_EXTENSION = if legacyPackages.stdenv.isDarwin then "dylib" else "so"; + LIBRELATIONAL_ENGINE_LIB_PATH="${librelational_engine}/lib"; + LIBRELATIONAL_ENGINE_INCLUDE_PATH="${librelational_engine}/include"; }; # Development tools @@ -225,8 +232,20 @@ ocamlPackages.menhir ocamlPackages.ctypes ocamlPackages.ctypes-foreign + ocamlPackages.data-encoding + legacyPackages.cmake + legacyPackages.gcc ]; + shellHook = '' + echo MERKLECPP_INCLUDE_PATH=$MERKLECPP_INCLUDE_PATH + echo LIBRESSL_INCLUDE_PATH=$LIBRESSL_INCLUDE_PATH + echo LIBRESSL_LIB_PATH=$LIBRESSL_LIB_PATH + echo OS_LIB_EXTENSION=$OS_LIB_EXTENSION + echo LIBRELATIONAL_ENGINE_LIB_PATH=$LIBRELATIONAL_ENGINE_LIB_PATH + echo LIBRELATIONAL_ENGINE_INCLUDE_PATH=$LIBRELATIONAL_ENGINE_INCLUDE_PATH + ''; + # Tools from packages inputsFrom = [ self.packages.${system}.relational_engine -- cgit v1.2.3