# (akien) The Vulkan SDK requires some care when updating.
# We only package SDK releases (sdk-%%{version}).
#
# There are many interdependent dependencies which need to be synced to specific
# "known good" commits for the APIs to be compatible.
#
# Upstream is now properly tagging `sdk-*` versions on each component, so the
# instructions below have been simplified.
# Find the latest SDK release by reviewing GitHub tags for e.g. Vulkan-Headers.
#
# Here's the build order.
# - A1 and A2 can be done in parallel.
# - 2. means that you should wait for 1. to finish, while 1.a. and 1.b. means
#   that both can be pushed in parallel.
#
# (A1) SPIRV stack:
# 1. spirv-headers
# 2. spirv-tools
# 3. glslang
#
# (A2) Vulkan stack:
# 1. vulkan-headers
# 2. vulkan-loader
#
# (B) Depends on A1 and A2 being completed:
# 1.a. vulkan-tools
# 1.b. vulkan-validation-layers
# 1.c. vkd3d
# 1.d. shaderc

%define __python %{__python3}

%if 0%{!?mkrel:1}
%define mkrel(c) %{1}%{?dist}
%endif

%define uname   Vulkan-Headers
%define uversion 1.4.306

Name:           vulkan-headers
Version:        %{uversion}
Release:        %mkrel 1
Summary:        Vulkan header files and API registry
Group:          Development/C
License:        ASL 2.0
URL:            https://github.com/KhronosGroup/Vulkan-Headers
Source0:        https://github.com/KhronosGroup/Vulkan-Headers/archive/vulkan-sdk-%{version}/%{uname}-%{uversion}.tar.gz

BuildRequires:  cmake
BuildRequires:  gcc, gcc-c++
BuildArch:      noarch

%description
Vulkan header files and API registry.

%prep
%autosetup -p1 -n %{uname}-%{uversion}

%build
%cmake \
    -DVULKAN_HEADERS_ENABLE_MODULE=OFF
%cmake_build

%install
%cmake_install

%files
%doc README.md
%license LICENSE.md
%{_includedir}/vulkan/
%{_includedir}/vk_video/
%dir %{_datadir}/vulkan
%{_datadir}/vulkan/registry/
%{_datadir}/cmake/VulkanHeaders/