File glslang.spec of Package glslang

Name:           glslang
Version:        16.1.0
Release:        %mkrel 1
Summary:        Khronos reference GLSL/SPIR-V compiler
License:        BSD
Group:          Development/Tools
URL:            https://github.com/KhronosGroup/glslang
Source0:        glslang-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  ninja
BuildRequires:  python3
BuildRequires:  spirv-tools-devel

%description
glslang is the Khronos reference compiler for GLSL, translating to SPIR-V.
It provides the glslangValidator tool used by Mesa and other projects.

%package devel
Summary:        Development files for glslang
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description devel
The glslang development package contains headers and libraries needed to
build applications against glslang.

%prep
%setup -q -n glslang-%{version}

%build
cmake -S . -B build \
    -GNinja \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
    -DENABLE_GLSLANG_BINARIES=ON \
    -DENABLE_HLSL=ON \
    -DENABLE_OPT=ON \
    -DALLOW_EXTERNAL_SPIRV_TOOLS=ON \
    -DBUILD_SHARED_LIBS=ON \
    -DGLSLANG_TESTS=OFF
ninja -C build %{?_smp_mflags}

%install
DESTDIR=%{buildroot} ninja -C build install

%files
%doc README.md
%license LICENSE.txt
%{_bindir}/glslangValidator
%{_bindir}/glslang
%{_libdir}/libglslang.so*
%{_libdir}/libSPIRV.so*
%{_libdir}/libglslang-default-resource-limits.so*

%files devel
%{_includedir}/glslang/
%{_includedir}/glslang/SPIRV/
%{_includedir}/glslang/Public/
%{_includedir}/glslang/Include/
%{_libdir}/cmake/glslang/

%changelog
* Thu Dec 04 2025 Henrik <you@example.com> - 16.1.0-1
- Update to glslang 16.1.0 release
- Retained shared library build and disabled tests via CMake option
openSUSE Build Service is sponsored by