# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libplacebo
pkgver=6.338.2
pkgrel=7
pkgdesc='Reusable library for GPU-accelerated video/image rendering primitives'
url='https://github.com/haasn/libplacebo'
arch=('x86_64')
license=('LGPL-2.1-or-later')
depends=('vulkan-icd-loader' 'glslang' 'lcms2' 'shaderc'
         'glibc' 'gcc-libs' 'libunwind' 'libdovi' 'xxhash')
makedepends=(
  'meson' 'ninja' 'vulkan-headers' 'glad' 'nuklear'
  'python' 'python-setuptools' 'python-mako' 'python-markupsafe' 'python-jinja'
  'libglvnd'
)
provides=('libplacebo.so')
source=(https://code.videolan.org/videolan/libplacebo/-/archive/v${pkgver}/libplacebo-v${pkgver}.tar.gz)
sha512sums=('0f20ae47bc2a7cd128d667ec2dd750a2d6ad5f16be6ab97122c2dda1ebf239958ee4bf453a7f835bea2dafb60a2e27b795801532aad994e002854c190aa6bbd8')
b2sums=('23485d677fbc59d47cbfd56ac3d5187c18206d7c03b0a7c4decd1d5b5772a88de4e22228cfdfc4fe1ce2c8031ea053cee968d010474047dc511d597d9d5ee3a8')

build() {
  cd ${pkgname}-v${pkgver}
  CXXFLAGS+=" -I/usr/include/glslang"
  arch-meson build \
    -D tests=true \
    -D vulkan=enabled \
    -D glslang=enabled \
    -D shaderc=enabled \
    -D lcms=enabled \
    -D d3d11=disabled \
    -D libdovi=enabled \
    -D demos=false
  meson compile -C build
}

check() {
  cd ${pkgname}-v${pkgver}
  meson test -C build --print-errorlogs
}

package() {
  depends+=(
    'libdovi.so'
    'liblcms2.so'
    'libshaderc_shared.so'
    'libvulkan.so'
  )

  cd ${pkgname}-v${pkgver}
  meson install -C build --destdir "${pkgdir}"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim:set sw=2 sts=-1 et:
