# Maintainer: Jelle van der Waa <jelle@vdwaa.nl>
# Contributor: Grey Christoforo <first name [at] last name [dot] net>

pkgname=uranium
pkgver=4.2.0
pkgrel=1
pkgdesc="A Python framework for building Desktop applications."
url="https://github.com/Ultimaker/Uranium"
arch=('any')
license=('LGPL')
depends=('python' 'qt5-quickcontrols' 'qt5-quickcontrols2' 'pyqt5-common' 'python-pyqt5' 'python-numpy' 'arcus' 'python-shapely')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::https://github.com/Ultimaker/${pkgname}/archive/${pkgver}.tar.gz"
        'https://patch-diff.githubusercontent.com/raw/Ultimaker/Uranium/pull/500.patch'
        'https://patch-diff.githubusercontent.com/raw/Ultimaker/Uranium/pull/499.patch')

sha256sums=('af394fb133e6a3ce92c245428bcf458956b2ca26c33122a35c464b9f5aaddd2e'
            'd2d8c9acccfc59f906bfefe07d1683d363c65ac162a60c494acdebea121d9527'
            '77cebd3742276ef585c8f93e7b942478e22abe1622ad6c1f0d1bd17d439fa3a5')

prepare() {
  cd Uranium-${pkgver}
  sed -i 's,/dist-packages,.${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt

  patch -p1 <"$srcdir/499.patch"
  patch -p1 <"$srcdir/500.patch"
}

build() {
  cd Uranium-${pkgver}
  mkdir -p build && cd build

  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release
  make
}

package() {
  cd Uranium-${pkgver}/build
  make DESTDIR="${pkgdir}" install
}

# vim:set ts=2 sw=2 et:
