# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>

pkgname=geos
pkgver=3.12.2
pkgrel=1.1
pkgdesc="C/C++ library for computational geometry"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://libgeos.org/"
license=(LGPL)
depends=(gcc-libs bash)
makedepends=(cmake)
options=(!emptydirs)
changelog=$pkgname.changelog
source=(https://download.osgeo.org/$pkgname/$pkgname-$pkgver.tar.bz2)
sha256sums=('34c7770bf0090ee88488af98767d08e779f124fa33437e0aabec8abd4609fec6')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_DOCUMENTATION=OFF
  make -C build
}

check() {
  ctest --test-dir build --verbose
}

package() {
  make -C build DESTDIR="${pkgdir}" install
}
