# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Vincent B. <vb@luminar.eu.org>

pkgname=opam
pkgver=2.5.0
pkgrel=1
pkgdesc='OCaml package manager'
arch=(x86_64 aarch64)
url='https://opam.ocaml.org/'
license=(LGPL-2.1-only)
depends=(bubblewrap gcc-libs glibc ocaml-compiler-libs unzip)
optdepends=('darcs: For downloading packages with darcs'
            'git: For downloading packages with git'
            'mercurial: For downloading packages with mercurial'
            'rsync: For downloading packages with rsync')
source=("https://github.com/ocaml/opam/releases/download/${pkgver%_*}/opam-full-${pkgver/_/-}.tar.gz")
b2sums=('ef3c0900c3edf7b3ba491dc7ff28fbce19f397673de141433bb2ac64f5e1fe37f8d3eaab2dc3f994886f03d986e0a6ede1466c3051d8e73513ac15dcf5c49bb3')

build() {
  cd opam-full-${pkgver%_*}
  ./configure --prefix=/usr --with-mccs --with-vendored-deps
  make all -j1
}

package() {
  make -C opam-full-${pkgver%_*} DESTDIR="$pkgdir" install
}
