opam-version: "2.0"
synopsis: "4.01.0 release compiled with musl-gcc -static"
description:
  "Requires musl-gcc to be installed (package musl on Arch Linux, musl-tools on Debian, musl-dev on Alpine)"
maintainer: "platform@lists.ocaml.org"
depends: [
  "ocaml" {= "4.01.0" & post}
  "base-unix" {post}
  "base-bigarray" {post}
  "base-threads" {post}
  "base-ocamlbuild" {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"
    "-cc"
    "musl-gcc -Os" {os-distribution != "alpine"}
    "gcc -Os" {os-distribution = "alpine"}
    "-aspp"
    "musl-gcc -c" {os-distribution != "alpine"}
    "gcc -c" {os-distribution = "alpine"}
    "-libs"
    "-static"
    "-no-tk"
    "-no-curses"
    "-no-graph"
  ]
  [make "world.opt"]
]
install: [make "install"]
url {
  src: "http://caml.inria.fr/pub/distrib/ocaml-4.01/ocaml-4.01.0.tar.gz"
  checksum: "md5=04dfdd7da189462a4f10ec6530359cef"
}
available: !(os = "macos" & arch = "arm64")
