## START: Set by rpmautospec
## (rpmautospec version 0.7.1)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           gfxreconstruct
Version:        1.3.283.0
Release:        %autorelease
Summary:        Graphics API Capture and Replay Tools for Reconstructing Graphics Application Behavior

License:        MIT
URL:            https://github.com/LunarG/gfxreconstruct
Source0:        %url/archive/vulkan-sdk-%{version}.tar.gz#/gfxreconstruct-sdk-%{version}.tar.gz

Patch0: system-vulkan-headers.patch
Patch1: remove-VK_DRIVER_ID_MESA_AGXV.patch

BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libX11-devel
BuildRequires:  libxcb-devel
BuildRequires:  libXrandr-devel
BuildRequires:  libzstd-devel
BuildRequires:  lz4-devel
BuildRequires:  vulkan-headers
BuildRequires:  vulkan-loader-devel
BuildRequires:  vulkan-utility-libraries-devel
BuildRequires:  wayland-devel
BuildRequires:  xcb-util-keysyms-devel
BuildRequires:  zlib-devel

%description
The GFXReconstruct project provides tools for the capture and replay of
graphics API calls, allowing the graphics commands executed by an application
to be recorded to a file that may later be replayed to reconstruct the
graphics-specific behavior of the captured application. The replay code has
been organized with a framework design to make it easy to create additional
tools for processing capture files.

%prep
%autosetup -p1 -n gfxreconstruct-vulkan-sdk-%{version}

%build
%cmake3 -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_WERROR=OFF
%cmake_build

%install
%cmake_install

%ldconfig_scriptlets

%files
%license LICENSE.txt
%doc README.md CONTRIBUTING.md

%{_bindir}/gfxrecon-replay
%{_bindir}/gfxrecon-compress
%{_bindir}/gfxrecon-info
%{_bindir}/gfxrecon-tocpp
%{_bindir}/gfxrecon-extract
%{_bindir}/gfxrecon-optimize
%{_bindir}/gfxrecon-capture-vulkan.py
%{_bindir}/gfxrecon-capture.py
%{_bindir}/gfxrecon.py
%{_bindir}/gfxrecon-convert
%{_datadir}/vulkan/explicit_layer.d/VkLayer_gfxreconstruct.json
%{_libdir}/libVkLayer_gfxreconstruct.so

%changelog
## START: Generated by rpmautospec
* Tue Sep 10 2024 John Doe <packager@example.com> - 1.3.283.0-1
- Uncommitted changes
## END: Generated by rpmautospec