# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=libproxy
pkgname=(
  libproxy
  libproxy-docs
)
pkgver=0.5.9
pkgrel=1
pkgdesc="Automatic proxy configuration management library"
url="https://libproxy.github.io/libproxy/"
arch=(x86_64)
license=(LGPL-2.1-or-later)
depends=(
  curl
  duktape
  gcc-libs
  glib2
  glibc
)
makedepends=(
  gi-docgen
  git
  gobject-introspection
  gsettings-desktop-schemas
  meson
  vala
)
source=(
  "git+https://github.com/libproxy/libproxy#tag=$pkgver"
)
b2sums=('d7e9785dd07beb9fae97f51423fd7ba6cefee2942293c2960c07794617527d57f5fc0bd23c44c66d89d7b7303b12b2ef7e05d4f3d1bdd319e36370cc6b966935')

prepare() {
  cd libproxy
}

build() {
  local meson_options=(
    -D release=true
  )

  arch-meson libproxy build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package_libproxy() {
  provides=(libproxy.so)
  conflicts=('libproxy-webkit<0.5.0-1')

  meson install -C build --destdir "$pkgdir"

  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/doc
}

package_libproxy-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  mv doc/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
