#Maintainer: Juergen Hoetzel <juergen@archlinux.org>

pkgname=lablgtk2
pkgver=2.18.8
pkgrel=2
pkgdesc="An Objective Caml interface to gtk2"
arch=(x86_64)
license=('LGPL')
url="http://lablgtk.forge.ocamlcore.org/"
depends=('gtk2' 'librsvg' 'gtksourceview2')
makedepends=('ocaml-compiler-libs>=4.0.8' 'camlp5>=4.08' 'libglade')
optdepends=('ocaml: for using the tools')
DLAGENTS=('https::/usr/bin/curl -fLC - --insecure --retry 3 --retry-delay 3 -o %o %u')
source=("https://github.com/garrigue/lablgtk/releases/download/lablgtk2188/lablgtk-${pkgver}.tar.gz")
sha256sums=('91f59bafd07989ea00080f4fd65512ce339878c7117bf5116bad3b93b64d4de3')
options=(!makeflags staticlibs)

build() {
  cd "${srcdir}/lablgtk-${pkgver}"
  ./configure --prefix=/usr \
    --without-gnomeui \
    --without-gnomecanvas \
    --without-panel \
    --without-gtkspell \
    --without-gtksourceview
  make world
  make opt
}

package() {
  cd "${srcdir}/lablgtk-${pkgver}"
  make DESTDIR=${pkgdir} old-install
  install -m644 META "${pkgdir}/usr/lib/ocaml/lablgtk2/"
}
