# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=vmaf
pkgver=%version%
pkgrel=%release%
pkgdesc='Perceptual video quality assessment algorithm based on multi-method fusion'
arch=('x86_64')
url='https://github.com/Netflix/vmaf/'
license=('BSD')
depends=('gcc-libs')
makedepends=('meson' 'nasm')
checkdepends=('vim')
source=("https://github.com/Netflix/vmaf/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('7178c4833639e6b989ecae73131d02f70735fdb3fc2c7d84bc36c9c3461d93b1')

build() {
    arch-meson -Denable_avx512='false' "${pkgname}-${pkgver}/libvmaf" build
    meson compile -C build
}

check() {
    meson test -C build
}

package() {
    meson install -C build --destdir "$pkgdir"
    install -D -m644 "${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
    cp -dr --no-preserve='ownership' "${pkgname}-${pkgver}/model" "${pkgdir}/usr/share"
}
