aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2024-10-26 14:26:10 -0300
committerGitHub <noreply@github.com>2024-10-26 14:26:10 -0300
commit2eab114a120c7818861c0640ecdc300cf7366e53 (patch)
treebeb69c7038d79d8ca77d072d6f3afb144b5ff891 /flake.nix
parentda309e886e31e6d55e46339647d56769d417114e (diff)
downloadSakura-2eab114a120c7818861c0640ecdc300cf7366e53.tar.gz
Sakura-2eab114a120c7818861c0640ecdc300cf7366e53.zip
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 <renans.l@icloud.com>
Diffstat (limited to '')
-rw-r--r--flake.nix27
1 files changed, 23 insertions, 4 deletions
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