blob: 3edecc27cf89182e3776901e15dce8dc69280280 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
{
description = "Sakura Relational Engine";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
RNT = {
type = "github";
owner = "dont-rely-on-nulls";
repo = "RNT";
ref = "session";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, nix-filter, RNT }:
flake-utils.lib.eachDefaultSystem (system:
let
legacyPackages = nixpkgs.legacyPackages.${system};
lib = legacyPackages.lib;
ocamlPackages = legacyPackages.ocamlPackages;
ppx_protocol_conv =
legacyPackages.callPackage ./deps/ppx_protocol_conv.nix {
lib = legacyPackages.lib;
fetchFromGitHub = legacyPackages.fetchFromGitHub;
ocamlPackages = ocamlPackages; };
ppx_protocol_conv_xml_light =
legacyPackages.callPackage ./deps/ppx_protocol_conv_xml_light.nix {
lib = legacyPackages.lib;
ppx_protocol_conv = ppx_protocol_conv;
fetchFromGitHub = legacyPackages.fetchFromGitHub;
ocamlPackages = ocamlPackages; };
rnt = RNT.packages.${system}.default;
sources = {
ocaml = nix-filter.lib {
root = ./.;
include = [
".ocamlformat"
"dune-project"
(nix-filter.lib.inDirectory "bin")
(nix-filter.lib.inDirectory "lib")
];
};
nix = nix-filter.lib {
root = ./.;
include = [ (nix-filter.lib.matchExt "nix") ];
};
};
in {
packages = {
default = self.packages.${system}.relational_engine;
relational_engine = ocamlPackages.buildDunePackage {
pname = "sakura";
version = "0.1.0";
duneVersion = "3";
src = sources.ocaml;
buildInputs = [ ppx_protocol_conv_xml_light
ppx_protocol_conv
rnt ]
++ (with ocamlPackages; [
sha
ctypes
ctypes-foreign
data-encoding
ppx_inline_test
ppx_deriving
ppx_sexp_conv
lwt
lwt-exit
batteries
num
]);
strictDeps = true;
};
};
devShells = {
default = legacyPackages.mkShell {
packages = [
legacyPackages.nixpkgs-fmt
legacyPackages.ocamlformat
ocamlPackages.odoc
ocamlPackages.ocaml-lsp
ocamlPackages.ocamlformat-rpc-lib
ocamlPackages.utop
ocamlPackages.sha
ocamlPackages.ctypes
ocamlPackages.ctypes-foreign
rnt
ocamlPackages.data-encoding
ocamlPackages.ppx_inline_test
ocamlPackages.ppx_deriving
ocamlPackages.ppx_sexp_conv
ocamlPackages.lwt
ocamlPackages.lwt-exit
ocamlPackages.batteries
ocamlPackages.num
ppx_protocol_conv
ppx_protocol_conv_xml_light
ocamlPackages.earlybird
legacyPackages.coq
legacyPackages.coqPackages.stdlib
legacyPackages.z3
];
shellHook = ''
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH:+$CAML_LD_LIBRARY_PATH:}$(ocamlfind query num)"
'';
inputsFrom = [ self.packages.${system}.relational_engine ];
};
};
});
}
|