opam-version: "2.0"
synopsis:
  "OCaml 4.05.0 plus statistical memory profiling, see <http://ocaml.org/meetings/ocaml/2016/Jourdan-statistically_profiling_memory_in_OCaml.pdf>"
maintainer: "platform@lists.ocaml.org"
depends: [
  "ocaml" {= "4.05.0" & post}
  "base-unix" {post}
  "base-bigarray" {post}
  "base-threads" {post}
]
conflict-class: "ocaml-core-compiler"
flags: compiler
setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs"
build: [
  [
    "sed"
    "-ib"
    "-e"
    "s/opts=\"\"/opts=\"-Wno-implicit-function-declaration\"/"
    "config/auto-aux/hasgot"
  ] {os = "macos"}
  ["./configure" "-prefix" prefix "-with-debug-runtime" "--statmemprof"]
  [make "world"]
  [make "world.opt"]
]
install: [make "install"]
url {
  src: "https://github.com/jhjourdan/ocaml/archive/memprof_4.05.0.tar.gz"
}
patches: ["fix-gcc10.patch"]
extra-files: [ ["fix-gcc10.patch" "md5=3791e3c17d11ec0f246fc6c5c5e5e2f3"] ]
available: !(os = "macos" & arch = "arm64")
