# Contributor: Laurent Carlier <lordheavym@gmail.com>

pkgname=static-compat-vulkan-headers
_pkgname=Vulkan-Headers
pkgver=1.4.350.0
pkgrel=1
epoch=2
pkgdesc="Vulkan header files"
arch=(any)
url="https://www.vulkan.org/"
license=("Apache-2.0 OR MIT")
makedepends=(static-compat-cmake git ninja)
provides=("static-compat-vulkan-hpp=${pkgver}")
source=(
  "git+https://github.com/KhronosGroup/Vulkan-Headers#tag=vulkan-sdk-$pkgver"
  0001-Remove-Werror.patch
)
b2sums=('c628cc671ca8bf57bd909803a62f486bdd58f120bdb04805e26a76063db615a732760647944e63faee48197082bc457c0b084a0914cc87685ecfae169ad6ccef'
        'f40a6ca5aa9d80b598b0d04ae9171062152ede95d663189ae2617bf86a23a6885cc8bcf2923e3b75fa1eb8f9c8403eb79a6d9b33019a10261abc6707b76f0c29')

prepare() {
  cd Vulkan-Headers

  # GCC 15 fix
  git apply -3 ../0001-Remove-Werror.patch
}

build() {
  source static-compat-environment
  static-compat-cmake -S Vulkan-Headers -B build -G Ninja
  cmake --build build
}

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

package() {
  source static-compat-environment
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 Vulkan-Headers/LICENSES/MIT.txt \
    -t "$pkgdir/usr/share/licenses/$pkgname"
}
