# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=eglexternalplatform
pkgver=1.2
pkgrel=2
pkgdesc="EGL External Platform interface"
url=https://github.com/NVIDIA/eglexternalplatform
arch=(any)
license=(MIT)
depends=(libegl)
makedepends=(
  git
  meson
)
source=("git+$url#tag=$pkgver")
b2sums=('9da96c07158ad5e22720ebe25f675bcb11bc87f081622a04d12af2f4406984836b2c2078f89e5a0b441ceea2052073b614356abfe2000173f7a0bfaa9fc2c325')

prepare() {
  cd $pkgname

  # https://gitlab.archlinux.org/archlinux/packaging/packages/eglexternalplatform/-/issues/1
  git cherry-pick -n 70cd612f7da99449ba0c9bbbbc0ef1b3bef43f19
}

build() {
  arch-meson $pkgname build --includedir /usr/include/EGL
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 $pkgname/COPYING
}

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