summary refs log tree commit diff
path: root/pkgs/development/compilers/stanc
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-04 00:47:16 +0100
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-08 23:52:23 +0100
commit7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd (patch)
tree5c1d52cd5c0acef08116ef6db1176b66a99f87d1 /pkgs/development/compilers/stanc
parent85be954926ddcbd4d01d75ec37cfa81c312cc7bd (diff)
downloadnixpkgs-7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd.tar
nixpkgs-7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd.tar.gz
nixpkgs-7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd.tar.bz2
nixpkgs-7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd.tar.lz
nixpkgs-7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd.tar.xz
nixpkgs-7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd.tar.zst
nixpkgs-7ea4e36ad7eb40b8d4a6ffa6c61eb415057c06dd.zip
stanc: init at 2.31.0
Diffstat (limited to 'pkgs/development/compilers/stanc')
-rw-r--r--pkgs/development/compilers/stanc/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/development/compilers/stanc/default.nix b/pkgs/development/compilers/stanc/default.nix
new file mode 100644
index 00000000000..e3df16230a7
--- /dev/null
+++ b/pkgs/development/compilers/stanc/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, fetchFromGitHub
+, ocamlPackages
+}:
+
+ocamlPackages.buildDunePackage rec {
+  pname = "stanc";
+  version = "2.31.0";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitHub {
+    owner = "stan-dev";
+    repo = "stanc3";
+    rev = "v${version}";
+    hash = "sha256-5GOyKVt3LHN1D6UysOZT8isVQLKexwEcK0rwI45dDcg=";
+  };
+
+  # Error: This expression has type [ `Use_Sys_unix ]
+  postPatch = ''
+    substituteInPlace test/integration/run_bin_on_args.ml \
+      --replace "if Sys.file_exists (to_windows path) then to_windows cmd else cmd" "cmd"
+  '';
+
+  buildInputs = with ocamlPackages; [
+    core_unix
+    menhir
+    menhirLib
+    ppx_deriving
+    fmt
+    yojson
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/stan-dev/stanc3";
+    description = "The Stan compiler and utilities";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ wegank ];
+    platforms = platforms.unix;
+  };
+}