# Maintainer: Ray Ganardi <rayganardi [at] gmail [dot] com>
# Contributor: Andres F. Urquijo <alfagalileox@gmail.com>
# Contributor: Sebastian Krämer <basti.kr@gmail.com>

pkgname=python-qutip
pkgver=5.3.1
pkgrel=1
pkgdesc="QuTiP is open-source software for simulating the dynamics of open quantum systems"
arch=("aarch64" "x86_64")
url="http://qutip.org/index.html"
license=('BSD')
depends=("python-numpy" "python-scipy" "python-matplotlib")
makedepends=("gcc-fortran" "cython" "python-setuptools" "python-pip" "python-installer")
optdepends=(
  "blas: Needed for installing Fortran Monte Carlo solver."
  "mayavi: Needed for using the Bloch3d class."
  "python-pyqt4: required only for GUI elements."
  "texlive-bin: Needed if using LaTeX in figures."
  "python-nose: For running tests."
  "python-scikit-umfpack: Faster (~2-5x) steady state calculations."
)

source=("https://github.com/qutip/qutip/archive/v$pkgver.tar.gz")
sha256sums=('9bd6ace7dcbd4fda06b6ddc6e6f035bb17c9048b59db7cd9580610a99fb4cdcc')

build() {
  cd qutip-$pkgver

  # For https://github.com/python/cpython/issues/151547
  export CC=gcc
  export CXX=g++

  python setup.py build
}

package() {
  cd qutip-$pkgver

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
  install -D -m644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
