# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgname=libultrahdr
pkgver=1.4.0
pkgrel=1
pkgdesc='The reference codec for the Ultra HDR format'
arch=(x86_64 aarch64)
url='https://github.com/google/libultrahdr'
license=(Apache-2.0)
depends=(gcc-libs
         glibc
         libglvnd
         libjpeg-turbo)
makedepends=(cmake
             git)
source=(git+https://github.com/google/libultrahdr#tag=v$pkgver)
sha256sums=('67a20b13bef0a0100054956f2db880d1233843a5382a773bc2da2db0ffd93796')

build() {
  cmake -B build -S $pkgname \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DUHDR_BUILD_TESTS=ON \
    -Wno-dev
  cmake --build build
}

check() {
    ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
