# Description: The EGLStream-based Wayland external platform
# URL: https://github.com/NVIDIA/egl-wayland/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: eglexternalplatform mesa wayland-protocols

name=egl-wayland
version=1.1.21
release=1
source=(https://github.com/NVIDIA/egl-wayland/archive/$version/$name-$version-$release.tar.gz
  glvnd.diff)

build() {
  patch -Np1 -d $name-$version -i $SRC/glvnd.diff

  meson setup $name-$version build \
    --prefix=/usr \
    --buildtype=plain \
    --wrap-mode nodownload \
    -D b_lto=true \
    -D b_pie=true
  meson compile -C build
  DESTDIR=$PKG meson install -C build

  rm -rf $PKG/usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json
  rmdir $PKG/usr/share/egl/egl_external_platform.d/ $PKG/usr/share/egl
}
