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

pkgname=opam
pkgver=2.1.0
pkgrel=1
pkgdesc='OCaml package manager'
arch=(x86_64)
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=('3d51159568b6e85834f70a3545fe37d82470d4253bf9db6fef32b4314fd0a82182737bba6be62a9dd04b6d8fb8d7468b2e23ac39fa475f467adfdb0ec8d52181')

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
}

# getver: github.com/ocaml/opam/releases
