opam-version: "2.0"
synopsis: "opam 2.1 bootstrapped binary"
description: """
This package compiles (bootstraps) opam. For consistency and safety of the installation, the binaries are not installed into the PATH, but into lib/opam-devel, from where the user can manually install them system-wide.
"""
maintainer: "opam-devel@lists.ocaml.org"
authors: [
  "Vincent Bernardoff <vb@luminar.eu.org>"
  "Raja Boujbel <raja.boujbel@ocamlpro.com>"
  "Roberto Di Cosmo <roberto@dicosmo.org>"
  "Thomas Gazagnaire <thomas@gazagnaire.org>"
  "Louis Gesbert <louis.gesbert@ocamlpro.com>"
  "Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>"
  "Anil Madhavapeddy <anil@recoil.org>"
  "Guillem Rieu <guillem.rieu@ocamlpro.com>"
  "Ralf Treinen <ralf.treinen@pps.jussieu.fr>"
  "Frederic Tuong <tuong@users.gforge.inria.fr>"
]
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam/issues"
dev-repo: "git+https://github.com/ocaml/opam.git"
build: [
  ["./configure" "--disable-checks" "--prefix" prefix]
  [make "%{name}%.install"]
  [make "tests"] {with-test & opam-version < "2.1" & os-distribution != "alpine" & os-distribution != "arch" & os-distribution != "centos"} # https://github.com/ocaml/opam/pull/4500
]
depends: [
  "ocaml" {>= "4.02.3"}
  "opam-client" {= version}
  "cmdliner" {>= "0.9.8"}
  "dune" {>= "1.5.0"}
]
post-messages: [
"The development version of opam has been successfully compiled into %{lib}%/%{name}%. You should not run it from there, please install the binaries to your PATH, e.g. with
    sudo cp %{lib}%/%{name}%/opam /usr/local/bin

If you just want to give it a try without altering your current installation, you could use instead:
    alias opam2=\"OPAMROOT=~/.opam2 %{lib}%/%{name}%/opam\""
  {success}
]
url {
  src: "https://github.com/ocaml/opam/archive/2.1.0-beta4.tar.gz"
  checksum: [
    "md5=c8b674ab0803330a1daaa241b067c7e3"
    "sha512=d9ee987a173a013a40a2ab1765f7e2d71bdc1b191e868ec99f4b60e9b6792b1850894a484b9770ae7fb4a540a9fd3f2417506701924f45430a2a31125ba5784f"
  ]
}
