File mingw64-spirv-tools.spec of Package mingw64-spirv-tools

#
# spec file for package mingw64-spirv-tools
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define _lto_cflags %{nil}
%{_mingw64_package_header_debug}
Name:           mingw64-spirv-tools
Version:        2025.4
Release:        0
Summary:        API and commands for processing SPIR-V modules
License:        Apache-2.0
URL:            https://github.com/KhronosGroup/SPIRV-Tools
Source:         https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/v%{version}.tar.gz
BuildRequires:  bison
BuildRequires:  mingw64-cross-cmake
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-spirv-headers >= 1.6.4+sdk328
BuildArch:      noarch
BuildSystem:    mingw64cmake
BuildOption:    -DSPIRV-Headers_SOURCE_DIR="%{_mingw64_prefix}"

%description
The package includes an assembler, binary module parser,
disassembler, and validator for SPIR-V.

%{_mingw64_debug_package}

%prep -a
find . -type f -name CMakeLists.txt -exec \
    perl -i -pe 's{\@PACKAGE_VERSION\@}{%{version}}' CMakeLists.txt {} +

%install -a
perl -i -lpe 's{^#!%{_bindir}/env sh$}{#!/bin/sh}' \
    "%{buildroot}%{_mingw64_bindir}/spirv-lesspipe.sh"

# CMake just ignores options that should make it pick static-only
rm %{buildroot}%{_mingw64_bindir}/libSPIRV-Tools-shared.dll
rm %{buildroot}%{_mingw64_libdir}/libSPIRV-Tools-shared.dll.a
rm %{buildroot}%{_mingw64_libdir}/pkgconfig/SPIRV-Tools-shared.pc

%files
%license LICENSE
%{_mingw64_bindir}/spirv-*.exe
%{_mingw64_bindir}/spirv-lesspipe.sh
%{_mingw64_libdir}/cmake/
%{_mingw64_libdir}/libSPIRV-Tools.a
%{_mingw64_libdir}/libSPIRV-Tools-diff.a
%{_mingw64_libdir}/libSPIRV-Tools-link.a
%{_mingw64_libdir}/libSPIRV-Tools-lint.a
%{_mingw64_libdir}/libSPIRV-Tools-opt.a
%{_mingw64_libdir}/libSPIRV-Tools-reduce.a
%{_mingw64_libdir}/pkgconfig/SPIRV-Tools.pc
%{_mingw64_includedir}/spirv-tools/

%changelog
openSUSE Build Service is sponsored by