# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=libcerf
epoch=1
pkgver=2.4
pkgrel=2
pkgdesc='Self-contained numeric library that provides an efficient and accurate implementation of complex error functions'
arch=(x86_64 aarch64)
url='https://jugit.fz-juelich.de/mlz/libcerf/'
license=(MIT)
depends=(glibc)
makedepends=(cmake
             git)
source=(git+https://jugit.fz-juelich.de/mlz/libcerf#tag=v$pkgver)
sha256sums=('6970f3c2a99f6ed4f5de6e91e2bfeea338b6d5e424a4d26a05e7978825a41273')

build() {
  cmake -B build -S $pkgname \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DPORTABLE=ON
  cmake --build build
}

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

  install -Dm644 $pkgname/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
