# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=libmsym
pkgver=0.2.3
pkgrel=9
pkgdesc='Molecular point group symmetry lib'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='http://www.openchemistry.org/'
license=(MIT)
depends=(glibc)
makedepends=(cmake
             python-setuptools)
optdepends=('python: Python bindings')
source=($pkgname-$pkgver.tar.gz::"https://github.com/mcodev31/libmsym/archive/v$pkgver-paper.tar.gz")
sha256sums=('3741ebe163cf40696570d6b62e4834ca587d43dcac9de713994cc5e2960fb8fd')

build() {
  cmake -B build -S $pkgname-$pkgver-paper \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -DMSYM_BUILD_PYTHON=ON \
    -DMSYM_PYTHON_INSTALL_OPTS=--root="$pkgdir"
  cmake --build build
}

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

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