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 --- deps/relational_engine_lib.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 deps/relational_engine_lib.nix (limited to 'deps') diff --git a/deps/relational_engine_lib.nix b/deps/relational_engine_lib.nix new file mode 100644 index 0000000..b1d0488 --- /dev/null +++ b/deps/relational_engine_lib.nix @@ -0,0 +1,28 @@ +{ pkgs, libressl ? pkgs.callPackage ./libressl.nix {}, merklecpp ? pkgs.callPackage ./merklecpp.nix {}, ... }: +let + shared_lib_extension = if pkgs.stdenv.isDarwin then "dylib" else "so"; +in +pkgs.stdenv.mkDerivation { + name = "librelational_engine"; + src = ../shared/librelational_engine; + nativeBuildInputs = [ + pkgs.cmake + pkgs.gcc + ]; + buildInputs = [ libressl merklecpp ]; + env = { + MERKLECPP_INCLUDE_PATH="${merklecpp}/include"; + LIBRESSL_INCLUDE_PATH="${libressl}/include"; + LIBRESSL_LIB_PATH="${libressl}/lib"; + OS_LIB_EXTENSION = shared_lib_extension; + }; + buildPhase = '' + mkdir -p $out/lib + mkdir -p $out/include + cmake --build . --target relational_engine + ''; + installPhase = '' + mv librelational_engine.${shared_lib_extension} $out/lib/librelational_engine.${shared_lib_extension} + cp $src/library.h $out/include/library.h + ''; +} -- cgit v1.2.3