# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Maintainer: Laurent Carlier <lordheavym@gmail.com>

pkgname=vulkan-icd-loader
pkgver=1.4.328.0
pkgrel=1
pkgdesc="Vulkan Installable Client Driver (ICD) Loader"
url="https://www.vulkan.org/"
arch=(x86_64 aarch64)
license=(Apache-2.0)
depends=(glibc)
makedepends=(
  cmake
  git
  libx11
  libxrandr
  ninja
  python-lxml
  vulkan-headers
  wayland
)
optdepends=(
  # vulkan-driver: vulkan-intel/vulkan-radeon/nvidia-utils/....
  'vulkan-driver: packaged vulkan driver'
)
provides=(libvulkan.so)
groups=(vulkan-devel)
source=("git+https://github.com/KhronosGroup/Vulkan-Loader#tag=vulkan-sdk-$pkgver")
b2sums=('eb0f78c3c804e54985a21bbdcfd052899677adcd466fcf1c5000e3e00c8dff8bcfbc3968b57d9ac0a8acc066dee3208fbfa21a5e521339277179e7f54450c197')

build() {
  local cmake_options=(
    -D CMAKE_BUILD_TYPE=Release
    -D CMAKE_INSTALL_PREFIX=/usr
    -D CMAKE_INSTALL_SYSCONFDIR=/etc
    -D CMAKE_SKIP_INSTALL_RPATH=ON
  )

  cmake -S Vulkan-Loader -B build -G Ninja "${cmake_options[@]}"
  cmake --build build
}

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

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

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