%global _trivial .0 %global _buildid .2 %global sdkver 1.3.296.0 Name: glslang Version: 15.0.0 Release: 1%{dist}%{?_trivial}%{?_buildid} Summary: OpenGL and OpenGL ES shader front end and validator License: BSD-2-Clause AND BSD-3-Clause AND GPL-3.0-or-later AND Apache-2.0 URL: https://github.com/KhronosGroup/%{name} Source0: %url/archive/vulkan-sdk-%{sdkver}.tar.gz#/%{name}-sdk-%{sdkver}.tar.gz Patch3: 0001-pkg-config-compatibility.patch %if %{?amzn} == 2023 BuildRequires: gcc14 BuildRequires: gcc14-c++ %global toolchain gcc14 %else BuildRequires: gcc BuildRequires: gcc-c++ %endif BuildRequires: cmake3 BuildRequires: ninja-build BuildRequires: spirv-tools-devel BuildRequires: spirv-tools-libs %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 devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{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 -n %{name}-vulkan-sdk-%{sdkver} find . -name '*.h' -or -name '*.cpp' -or -name '*.hpp' | xargs chmod a-x %build # Stage 1: build static libraries mkdir static-build && pushd static-build %cmake3 .. \ -G Ninja \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DENABLE_SPVREMAPPER=ON \ -DENABLE_OPT=ON %cmake_build popd # Stage 2: build shared libraries mkdir shared-build && pushd shared-build %cmake3 .. \ -G Ninja \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_SHARED_LINKER_FLAGS="-lSPIRV-Tools -lSPIRV-Tools-opt" \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DENABLE_SPVREMAPPER=ON \ -DENABLE_OPT=ON %cmake_build popd %install # Install shared library build pushd shared-build %cmake_install popd # Manually install static libraries find static-build/amazon-linux-build -name '*.a' -exec install -m 644 {} %{buildroot}%{_libdir}/ \; # If missing, generate and install glslang.pc manually mkdir -p %{buildroot}%{_libdir}/pkgconfig cat > %{buildroot}%{_libdir}/pkgconfig/glslang.pc < - 11.6.0-1.20210825.git2fb89a0.amzn2023.0.2 - Mass rebuild for AL2023 * Mon Oct 03 2022 Stewart Smith - 11.6.0-1.20210825.git2fb89a0.amzn2022.0.1 - AL2022 pre-GA mass rebuild %autochangelog