opam-version: "2.0"
synopsis: "The OCaml compiler (system version, from outside of opam)"
maintainer: [
  "David Allsopp <david@tarides.com>"
  "Florian Angeletti <florian.angeletti@inria.fr>"
]
license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception"
authors: "Xavier Leroy and many contributors"
homepage: "https://ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
dev-repo: "git+https://github.com/ocaml/ocaml"
depends: [
  # This is OCaml 4.14.2
  "ocaml" {= "4.14.2" & post}

  # General base- packages
  "base-unix" {post}
  "base-threads" {post}
  "base-bigarray" {post}

  # Architecture (Windows-only at present)
  "host-arch-x86_32" {os = "win32" & ?sys-ocaml-arch & sys-ocaml-arch = "i686" & post}
  "host-arch-x86_64" {os = "win32" & ?sys-ocaml-arch & sys-ocaml-arch = "x86_64" & post}
  "host-arch-unknown" {os = "win32" & (!(?sys-ocaml-arch) |
                       sys-ocaml-arch != "i686" &
                       sys-ocaml-arch != "x86_64") & post}

  # System (Windows-only at present)
  "host-system-mingw" {os = "win32" & ?sys-ocaml-arch & sys-ocaml-libc = "msvc" & sys-ocaml-cc = "cc" & post}
  "host-system-msvc" {os = "win32" & ?sys-ocaml-arch & sys-ocaml-cc = "msvc" & post}
  "host-system-other" {os = "win32" & ?sys-ocaml-arch & sys-ocaml-libc != "msvc" & post}

  # Environment configuration (Windows-only)
  # NB There are not "system" distributions of OCaml on Windows; the support
  # here is intended for binary caching setups, choosing to install a build
  # of OCaml external to opam, but still using opam to provide the C compiler
  # configuration.
  "conf-mingw-w64-gcc-x86_64" {?sys-ocaml-arch & sys-ocaml-arch = "x86_64" & sys-ocaml-libc = "msvc" & sys-ocaml-cc = "cc" & post}
  "conf-mingw-w64-gcc-i686" {?sys-ocaml-arch & sys-ocaml-arch = "i686" & sys-ocaml-libc = "msvc" & sys-ocaml-cc = "cc" & post}
  "mingw-w64-shims" {?sys-ocaml-arch & sys-ocaml-libc = "msvc" & sys-ocaml-cc = "cc" & os-distribution = "cygwin" & post}
  "ocaml-env-msvc32" {?sys-ocaml-arch & sys-ocaml-arch = "i686" & sys-ocaml-cc = "msvc" & post}
  "ocaml-env-msvc64" {?sys-ocaml-arch & sys-ocaml-arch = "x86_64" & sys-ocaml-cc = "msvc" & post}
]
conflict-class: "ocaml-core-compiler"
available: sys-ocaml-version = "4.14.2" & (os != "win32" | sys-ocaml-libc = "msvc")
flags: [compiler avoid-version]
build: ["ocaml" "gen_ocaml_config.ml"]
substs: "gen_ocaml_config.ml"
extra-source "gen_ocaml_config.ml.in" {
  src:
    "https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/ocaml-system/gen_ocaml_config.ml.in"
  checksum: [
    "sha256=71bcd3d35e28cbf71eda81991c8741268f4b87ced71573b2e75f64f136cebfc1"
    "md5=093e7bec1ec95f9e4c6a313d73c5d840"
  ]
}
