# Maintainer: Peter Jung <ptr1337@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=egl-wayland2
pkgver=1.0.0.rc.r57.g1893c37
pkgrel=1
pkgdesc="EGLStream-based Wayland external platform (2)"
url="https://github.com/NVIDIA/egl-wayland2"
arch=(x86_64 aarch64)
license=(Apache-2.0)
depends=(
  eglexternalplatform
  mesa
  glibc
  libdrm
  wayland
)
makedepends=(
  git
  'libglvnd>=1.3.4'
  meson
  wayland-protocols
)
provides=(libnvidia-egl-wayland2.so)
_commit=1893c371d074c5a648a65e198c4e0eee80d2d7f1
source=("git+$url#tag=$_commit")
b2sums=('22347b3e1fbd1b13874df1aaad1662cdb357e9c338efe4551a44112b3f72ef76893738e37c88261d288087ea269c593bccf4e2e89168a07db9ef10901ffe65f1')

pkgver() {
  cd $pkgname
  git describe --long --tags | sed -E 's/^v//;s/-0-g[0-9a-f]+$//;s/-([0-9]+)-g/.r\1.g/;s/-/./g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  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/LICENSE
}

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