Name:           vulkan-loader
Version:        1.3.261.0
Release:        1
Summary:        A desktop loader for Vulkan ICD
License:        ASL 2.0
URL:            https://github.com/KhronosGroup/Vulkan-Loader
Source0:        %url/archive/refs/tags/Vulkan-Loader-sdk-%{version}.tar.gz

BuildRequires:  gcc-c++ cmake3 ninja-build python%{python3_pkgversion}-devel vulkan-headers = %{version}
BuildRequires:  pkgconfig(wayland-client) pkgconfig(wayland-cursor) pkgconfig(wayland-server)
BuildRequires:  pkgconfig(wayland-egl) pkgconfig(x11) pkgconfig(xrandr)

Provides:       vulkan = %{version}-%{release} vulkan-filesystem = %{version}-%{release}
Provides:       vulkan%{?_isa} = %{version}-%{release}
Obsoletes:      vulkan < %{version}-%{release} vulkan-filesystem < %{version}-%{release}

Requires:       mesa-vulkan-drivers

%description
This package supplies system like Windows, Linux, and MacOS
with the Khronos official Vulkan ICD desktop loader.

%package        devel
Summary:        Libraries and header files for developing applications that use vulkan-loader
Requires:       %{name} = %{version}-%{release} vulkan-headers
Provides:       vulkan-devel%{?_isa} = %{version}-%{release}
Provides:       vulkan-devel = %{version}-%{release}
Obsoletes:      vulkan-devel < %{version}-%{release}

%description    devel
Libraries and header files for developing applications that use vulkan-loader.

%prep
%autosetup -n Vulkan-Loader-sdk-%{version} -p1

%build
%cmake3 -GNinja -DCMAKE_BUILD_TYPE=Release .
%ninja_build

%install
%ninja_install

install -d %{buildroot}%{_sysconfdir}/vulkan/{explicit,implicit}_layer.d/ \
           %{buildroot}%{_datadir}/vulkan/{explicit,implicit}_layer.d/ \
           %{buildroot}{%{_sysconfdir},%{_datadir}}/vulkan/icd.d

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%license LICENSE.txt 
%doc README.md CONTRIBUTING.md
%dir %{_sysconfdir}/{vulkan/,vulkan/explicit_layer.d/,vulkan/icd.d/,vulkan/implicit_layer.d/}
%dir %{_datadir}/{vulkan/,vulkan/explicit_layer.d/,vulkan/icd.d/,vulkan/implicit_layer.d/}
%{_libdir}/*.so.*

%files devel
%{_libdir}/pkgconfig/vulkan.pc
%{_libdir}/*.so

%changelog
* Thu Aug 24 2023 dillon chen <dillon.chen@gmail.com> - sdk-1.3.261.0-1
- Update to sdk-1.3.261.0

* Fri Jul 21 2023 dillon chen <dillon.chen@gmail.com> - 1.3.257-1
- update to 1.3.257

* Wed Jan 8 2020 wutao <wutao61@huawei.com> - 1.1.92.0-2
- Package init
