1{ lib
2, fetchFromGitHub
3, ocamlPackages
4}:
5
6ocamlPackages.buildDunePackage rec {
7 pname = "stanc";
8 version = "2.32.2";
9
10 minimalOCamlVersion = "4.12";
11 duneVersion = "3";
12
13 src = fetchFromGitHub {
14 owner = "stan-dev";
15 repo = "stanc3";
16 rev = "v${version}";
17 hash = "sha256-dngmZXVb59uV7EugYIZAqE1gk66em7iuzllbbPWK2xk=";
18 };
19
20 # Error: This expression has type [ `Use_Sys_unix ]
21 postPatch = ''
22 substituteInPlace test/integration/run_bin_on_args.ml \
23 --replace "if Sys.file_exists (to_windows path) then to_windows cmd else cmd" "cmd"
24 '';
25
26 nativeBuildInputs = with ocamlPackages; [
27 menhir
28 ];
29 buildInputs = with ocamlPackages; [
30 core_unix
31 menhirLib
32 ppx_deriving
33 fmt
34 yojson
35 ];
36
37 meta = with lib; {
38 homepage = "https://github.com/stan-dev/stanc3";
39 description = "The Stan compiler and utilities";
40 license = licenses.bsd3;
41 maintainers = with maintainers; [ wegank ];
42 platforms = platforms.unix;
43 };
44}