# (akien) The Vulkan SDK requires some care when updating. # Check instructions in the vulkan-headers spec file. # The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %if 0%{!?mkrel:1} %define mkrel(:) %{1}%{?dist} %endif # (akien) No soname upstream, arbitrarily using 0 for now # Without proper soname, the devel package would not generate the # devel() provides that RPM relies on to pull in the proper deps # in reverse dependencies. %define major 15 %define libname %mklibname %{name} %{major} %define devname %mklibname %{name} -d %if 0%{?mageia} >= 10 %bcond_without external_spirv_tools %else %bcond_with external_spirv_tools %endif # Cyclic dependencies between HLSL and glslang, we can't build with --no-undefined # for the time being: https://github.com/KhronosGroup/glslang/issues/1484 %define _disable_ld_no_undefined 1 Name: glslang # Check tag matching Vulkan sdk-* tag used for other Vulkan components. Version: %{major}.0.0 Release: %mkrel 1 Summary: Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator Group: System/Libraries License: BSD and GPLv3+ and ASL 2.0 URL: https://github.com/KhronosGroup/glslang Source0: https://github.com/KhronosGroup/glslang/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: (ninja or ninja-build or /usr/bin/ninja) %if %{with external_spirv_tools} BuildRequires: pkgconfig(SPIRV-Tools) >= 2024.3 %endif BuildRequires: pkgconfig(python3) BuildRequires: gcc-c++ %description %{name} is the official reference compiler front end for the OpenGL ES and OpenGL shading languages. It implements a strict interpretation of the specifications for these languages. %package -n %{libname} Summary: Library files for glslang Group: System/Libraries %description -n %{libname} Library files for glslang. %package -n %{devname} Summary: Development files for glslang Requires: %{name} = %{version}-%{release} Requires: %{libname} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} %description -n %{devname} %{name} is the official reference compiler front end for the OpenGL ES and OpenGL shading languages. It implements a strict interpretation of the specifications for these languages. %prep %autosetup -p1 %build %cmake -GNinja \ %if %{with external_spirv_tools} -DALLOW_EXTERNAL_SPIRV_TOOLS:BOOL=ON \ -DENABLE_OPT:BOOL=ON %else -DALLOW_EXTERNAL_SPIRV_TOOLS:BOOL=OFF \ -DENABLE_OPT:BOOL=OFF %endif %cmake_build %install %cmake_install %check pushd Test LD_LIBRARY_PATH+=%{buildroot}%{_libdir} ./runtests localResults \ %{buildroot}%{_bindir}/glslangValidator \ %{buildroot}%{_bindir}/spirv-remap popd %files %doc README.md README-spirv-remap.txt %{_bindir}/glslang %{_bindir}/glslangValidator %{_bindir}/spirv-remap %files -n %{libname} %{_libdir}/lib%{name}*.so.%{major} %{_libdir}/lib%{name}*.so.%{version} %{_libdir}/libSPIRV.so.%{major} %{_libdir}/libSPIRV.so.%{version} %{_libdir}/libSPVRemapper.so.%{major} %{_libdir}/libSPVRemapper.so.%{version} %files -n %{devname} %{_includedir}/%{name}/ %{_libdir}/cmake/%{name}/ %{_libdir}/lib%{name}*.so %{_libdir}/libSPIRV.so %{_libdir}/libSPVRemapper.so