opam-version: "2.0"
synopsis: "Latest 4.02 trunk snapshot"
maintainer: "platform@lists.ocaml.org"
authors: ["Xavier Leroy" "Damien Doligez" "Alain Frisch" "Jacques Garrigue" "Didier Rémy" "Jérôme Vouillon"]
homepage: "https://ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
dev-repo: "git+https://github.com/ocaml/ocaml.git#4.02"
depends: [
  "ocaml" {= "4.02.4" & post}
  "base-unix" {post}
  "base-bigarray" {post}
  "base-threads" {post}
  "base-ocamlbuild" {post}
  "ocaml-beta" {opam-version < "2.1"}
]
conflict-class: "ocaml-core-compiler"
flags: [ compiler avoid-version hidden-version ]
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"]
    {os != "openbsd" & os != "freebsd" & os != "macos"}
  [
    "./configure"
    "-prefix"
    prefix
    "-with-debug-runtime"
    "-cc"
    "cc"
    "-aspp"
    "cc -c"
  ] {os = "openbsd" | os = "freebsd" | os = "macos"}
  [make "world"]
  [make "world.opt"]
]
install: [make "install"]
url {
  src: "https://github.com/ocaml/ocaml/archive/4.02.tar.gz"
}
patches: ["fix-gcc10.patch"]
extra-files: [ ["fix-gcc10.patch" "md5=91a4a258611302bc57f4d9fadb7fc14d"] ]
available: !(os = "macos" & arch = "arm64")
