# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=python-pynest2d
pkgver=4.10.0
pkgrel=1
pkgdesc="Python bindings for libnest2d"
arch=(x86_64)
url="https://github.com/Ultimaker/pynest2d"
license=("LGPL")
depends=(python polyclipping nlopt)
makedepends=(sip4 cmake boost libnest2d)
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/Ultimaker/pynest2d/archive/${pkgver}.tar.gz fix-cpp-version.patch)
sha512sums=('62a3c6266bf3c4e7f806d9674debe6872917af422443dd5e9c54a430bf95190fb00cf6dd3fd4e66572f266a673f4cf1500a3d42565cfd1cf2ce4e288b7db2acc'
            '0d01349a110bc2cde6b7279ba8b8d60cd71c599fe10054e4082aac86bf4e30184959dcfcc795a63ae7517845c014b14db029a6070833696191d874dbfa24ed30')

prepare() {
  cd pynest2d-${pkgver}
  patch -Np1 -i ${srcdir}/fix-cpp-version.patch

  mkdir build
}

build() {
  cd pynest2d-${pkgver}/build
  cmake .. -DCMAKE_INSTALL_PREFIX=/usr
}

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