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

pkgname=imath
pkgver=3.1.12
pkgrel=2
pkgdesc='A C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics'
url='https://www.openexr.com/'
arch=(x86_64 aarch64)
license=(BSD-3-Clause)
depends=(gcc-libs
         glibc)
optdepends=('boost-libs: python bindings'
            'python: python bindings')
makedepends=(boost
             cmake
             git
             python)
source=(git+https://github.com/AcademySoftwareFoundation/Imath#tag=v$pkgver)
sha256sums=('42b95856f39fd27cb30e26ef0e77ec5ad6b37c83ec9c2571914a7c9f0397daa0')

build() {
  cmake -B build -S Imath \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DPYTHON=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 Imath/LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname
}
