opam-version: "2.0"
synopsis:
  "Official 4.06.1 release compiled with musl-clang -static and with flambda activated"
description:
  "Requires musl-clang to be installed (package musl on Arch Linux, musl-tools on Debian, musl-dev on Alpine)"
maintainer: "platform@lists.ocaml.org"
depends: [
  "ocaml" {= "4.06.1" & post}
  "base-unix" {post}
  "base-bigarray" {post}
  "base-threads" {post}
]
depexts: [
  ["musl-tools"] {os-family = "debian"}
  ["musl"] {os-distribution = "arch"}
  ["musl-dev"] {os-distribution = "alpine"}
]
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"
    "-flambda"
    "-cc"
    "musl-clang -Os" {os-distribution != "alpine"}
    "clang -Os" {os-distribution = "alpine"}
    "-aspp"
    "musl-clang -c" {os-distribution != "alpine"}
    "clang -c" {os-distribution = "alpine"}
    "-libs"
    "-static"
    "-no-curses"
    "-no-graph"
  ]
  [make "world"]
  [make "world.opt"]
]
install: [make "install"]
url {
  src: "https://github.com/ocaml/ocaml/archive/4.06.1.tar.gz"
  checksum: "md5=d02eb67b828de22c3f97d94b3c46acba"
}
patches: ["fix-gcc10.patch"]
extra-files: [ ["fix-gcc10.patch" "md5=171b510547baa777839b2ad50608a3ee"] ]
available: !(os = "macos" & arch = "arm64")
