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

pkgname=opam
pkgver=2.1.5
pkgrel=3
pkgdesc='OCaml package manager'
arch=(x86_64 aarch64)
url='https://opam.ocaml.org/'
license=(GPL)
depends=(bubblewrap 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=('5e6b1140e279931dfb61f68d0c4888cb14d05ff610e2b151115efe6b6420d74e7079894b6f4360f377b155008530ba4ace9708bc9d1e1d8c13950c0a5be4de11')

build() {
  cd opam-full-$pkgver
  ./configure --prefix=/usr
  make lib-ext all -j1 \
    OCAMLC='ocamlc -unsafe-string' \
    OCAMLOPT='ocamlopt -unsafe-string'
}

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