# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=verdict
pkgver=1.4.5
pkgrel=2
pkgdesc='Compute quality functions of 2 and 3-dimensional regions'
arch=(x86_64 aarch64)
url='https://github.com/sandialabs/verdict'
license=(BSD-3-Clause)
depends=(glibc)
makedepends=(git cmake)
source=("$pkgname::git+$url#tag=$pkgver")
sha512sums=('20285a498572a2e3a1e592593d7beb8efc541376c88b70510f309e315df83e6a56e954f7a9561c9262cc22d5ca64431a42310f1d326dafe1de5d7e4ffe5215b9')
b2sums=('93572bb0d0ac78900aa33373e6b199373de8a5c09e2d314cf3900c43acff59cf8c46cee5142f3e16fd384ebe051a4cc8b6500be3c2d6512ca18caf602d305fc1')

build() {
  local cmake_options=(
    -B build
    -S "$pkgname"
    -W no-author
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D BUILD_SHARED_LIBS=ON
    -D VERDICT_ENABLE_TESTING=OFF
  )

  cmake "${cmake_options[@]}"

  cmake --build build
}

package () {
  DESTDIR="$pkgdir" cmake --install build

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" "$pkgname/LICENSE"
}
