# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Mosra <mosra@centrum.cz>

pkgname=magnum-plugins
pkgver=2019.10
pkgrel=1
pkgdesc='Plugins for the Magnum C++11/C++14 graphics engine'
arch=(x86_64)
url='https://magnum.graphics'
license=(MIT)
depends=(assimp devil faad2 freetype2 libjpeg libpng "magnum>=$pkgver")
makedepends=(cmake git ninja)
source=("git+https://github.com/mosra/magnum-plugins#tag=v$pkgver")
sha256sums=('SKIP')

build() {
  mkdir -p build
  cd build
  cmake "$srcdir/magnum-plugins" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DWITH_ASSIMPIMPORTER=ON \
    -DWITH_BASISIMAGECONVERTER=OFF \
    -DWITH_BASISIMPORTER=OFF \
    -DWITH_DDSIMPORTER=ON \
    -DWITH_DEVILIMAGEIMPORTER=ON \
    -DWITH_DRFLACAUDIOIMPORTER=ON \
    -DWITH_DRMP3AUDIOIMPORTER=ON \
    -DWITH_DRWAVAUDIOIMPORTER=ON \
    -DWITH_FAAD2AUDIOIMPORTER=ON \
    -DWITH_FREETYPEFONT=ON \
    -DWITH_ICOIMPORTER=ON \
    -DWITH_JPEGIMAGECONVERTER=ON \
    -DWITH_JPEGIMPORTER=ON \
    -DWITH_MESHOPTIMIZERSCENECONVERTER=OFF \
    -DWITH_MINIEXRIMAGECONVERTER=ON \
    -DWITH_OPENGEXIMPORTER=ON \
    -DWITH_PNGIMAGECONVERTER=ON \
    -DWITH_PNGIMPORTER=ON \
    -DWITH_PRIMITIVEIMPORTER=ON \
    -DWITH_STANFORDIMPORTER=ON \
    -DWITH_STANFORDSCENECONVERTER=ON \
    -DWITH_STBIMAGECONVERTER=ON \
    -DWITH_STBIMAGEIMPORTER=ON \
    -DWITH_STBTRUETYPEFONT=ON \
    -DWITH_STBVORBISAUDIOIMPORTER=ON \
    -DWITH_STLIMPORTER=ON \
    -DWITH_TINYGLTFIMPORTER=ON \
    -GNinja
  ninja
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
  install -Dm644 $pkgname/COPYING \
    "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

# getver: github.com/mosra/magnum-plugins/releases/latest
# vim: ts=2 sw=2 et:
