%global commit 691513b4fb406eccfc2f7d7f8213c8505ff5b897 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20230807 Name: ISPCTexComp Version: 0 Release: 0.4.%{commitdate}git%{shortcommit}%{?dist} Summary: ISPC Texture Compressor - SIMD-optimized texture block compression License: MIT URL: https://github.com/GameTechDev/ISPCTextureCompressor Source0: %{url}/archive/%{commit}/ISPCTextureCompressor-%{shortcommit}.tar.gz # Only x86_64 and aarch64 are supported (ISPC SIMD targets) ExclusiveArch: x86_64 aarch64 BuildRequires: gcc-c++ BuildRequires: ispc BuildRequires: make %description ISPC Texture Compressor is a set of CPU SIMD-optimized texture block compression algorithms from Intel. It supports BC6H, BC7, ASTC, ETC1, BC1, BC3, BC4, and BC5 compression formats. The compressor uses the Intel ISPC compiler to generate optimized SIMD code for SSE2, AVX, and NEON instruction sets. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Header files for developing applications that use the ISPC Texture Compressor library. %prep %autosetup -n ISPCTextureCompressor-%{commit} # Fix the ISPC path to use the system ispc compiler instead of bundled binary sed -i 's|ISPC/linux/ispc|ispc|g' Makefile.linux # Ensure -shared is in the linker flags for the shared library build. # Fedora's hardened LDFLAGS inject startup files (Scrt1.o) which cause # "undefined reference to 'main'" errors when building shared libraries # without the -shared flag. Force -shared and -nostartfiles into the link line. sed -i 's/$(CXX) $(LDFLAGS)/$(CXX) -shared -nostartfiles $(LDFLAGS)/' Makefile.linux # Add -fPIC to ISPC and C++ compilation so object files are suitable for # shared library linking with Fedora's hardened toolchain. sed -i 's/$(ISPC)/$(ISPC) --pic/' Makefile.linux sed -i 's/$(CXX) $(CXXFLAGS)/$(CXX) -fPIC $(CXXFLAGS)/' Makefile.linux %build %ifarch x86_64 %make_build -f Makefile.linux ISPC_ARCH=x86-64 ISPC_TARGET="sse2,sse4,avx" %endif %ifarch aarch64 %make_build -f Makefile.linux ISPC_ARCH=aarch64 ISPC_TARGET="neon" %endif %install # Install shared library install -d %{buildroot}%{_libdir} install -p -m 0755 build/libispc_texcomp.so %{buildroot}%{_libdir}/libispc_texcomp.so.0.0.0 ln -s libispc_texcomp.so.0.0.0 %{buildroot}%{_libdir}/libispc_texcomp.so.0 ln -s libispc_texcomp.so.0 %{buildroot}%{_libdir}/libispc_texcomp.so # Install header file install -d %{buildroot}%{_includedir}/%{name} install -p -m 0644 ispc_texcomp/ispc_texcomp.h %{buildroot}%{_includedir}/%{name}/ispc_texcomp.h %files %license license.txt %{_libdir}/libispc_texcomp.so.0 %{_libdir}/libispc_texcomp.so.0.0.0 %files devel %{_includedir}/%{name}/ %{_libdir}/libispc_texcomp.so %changelog * Wed Feb 11 2026 O3DE Package Maintainers - 0-0.4.20230807git691513b - Add --pic to ISPC and -fPIC to CXX flags for PIC-compliant shared library - Fix R_X86_64_PC32 relocation error with Fedora hardened linker * Wed Feb 11 2026 O3DE Package Maintainers - 0-0.3.20230807git691513b - Fix shared library linking: add -shared -nostartfiles to linker flags - Fedora hardened LDFLAGS inject Scrt1.o causing undefined reference to main * Tue Feb 11 2025 O3DE Package Maintainers - 0-0.1.20230807git691513b - Initial package based on commit 691513b - SIMD-optimized texture compression library (BC6H, BC7, ASTC, ETC1, BC1-BC5)