Name: ktx-software Version: 4.4.2 Release: %autorelease Summary: Khronos texture container library License: Apache-2.0 AND BSD-1-Clause AND MIT URL: https://github.com/KhronosGroup/KTX-Software # Repacked using Source1: excludes restricted decoder and image fixtures. # Upstream: %%{url}/archive/refs/tags/v%%{version}.tar.gz Source0: KTX-Software-%{version}-free.tar.gz Source1: repack-ktx.py Source2: ktx-smoke.c Patch0: ktx-system-zstd-libdir.patch BuildRequires: cmake >= 3.22 BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: pkgconfig(libzstd) # Codec sources are integrated into libktx; track the embedded versions. Provides: bundled(astc-encoder) = 5.3.0 Provides: bundled(basisu) = 1.16 Provides: bundled(miniz) = 1.15 Provides: bundled(dfdutils) %description KTX-Software provides libktx for reading and writing Khronos KTX and KTX2 texture containers, including Basis Universal and ASTC texture compression. This library-focused package is intended for applications such as Blender. OpenGL/Vulkan upload helpers and the restricted ETC software decoder are disabled. %package devel Summary: Development files for the Khronos texture library Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Headers and CMake configuration files for libktx. The CMake package is Ktx and its imported library target is KTX::ktx. %prep %autosetup -n KTX-Software-%{version} -p1 # Ensure the excluded restricted source and bundled Zstandard cannot be used. test ! -e external/etcdec/etcdec.cxx test ! -d external/basisu/zstd %build %cmake \ -DKTX_GIT_VERSION_FULL=v%{version} \ -DBUILD_SHARED_LIBS=ON \ -DKTX_FEATURE_KTX1=ON \ -DKTX_FEATURE_KTX2=ON \ -DKTX_FEATURE_TOOLS=OFF \ -DKTX_FEATURE_TESTS=OFF \ -DKTX_FEATURE_TOOLS_CTS=OFF \ -DKTX_FEATURE_LOADTEST_APPS=OFF \ -DKTX_FEATURE_DOC=OFF \ -DKTX_FEATURE_JNI=OFF \ -DKTX_FEATURE_PY=OFF \ -DKTX_FEATURE_ETC_UNPACK=OFF \ -DKTX_FEATURE_VK_UPLOAD=OFF \ -DKTX_FEATURE_GL_UPLOAD=OFF \ -DBASISU_SUPPORT_OPENCL=OFF \ -DBASISU_SUPPORT_SSE=OFF \ -DKTX_WERROR=OFF \ -DASTCENC_ISA_AVX2=OFF \ -DASTCENC_ISA_SSE41=OFF \ %ifarch x86_64 -DASTCENC_ISA_SSE2=ON %else -DASTCENC_ISA_SSE2=OFF -DASTCENC_ISA_NONE=ON %endif %cmake_build %install %cmake_install %check # Exercise installed CMake metadata and KTX2/Zstd read-write support. mkdir smoke cp %{SOURCE2} smoke/ktx-smoke.c cat > smoke/CMakeLists.txt <<'CMAKE' cmake_minimum_required(VERSION 3.22) project(KtxSmoke LANGUAGES C) find_package(Ktx 4.4 CONFIG REQUIRED) add_executable(ktx-smoke ktx-smoke.c) target_link_libraries(ktx-smoke PRIVATE KTX::ktx) CMAKE cmake -S smoke -B smoke-build -G Ninja \ -DKtx_DIR=%{buildroot}%{_libdir}/cmake/ktx \ -DCMAKE_C_FLAGS="%{build_cflags}" \ -DCMAKE_EXE_LINKER_FLAGS="%{build_ldflags}" cmake --build smoke-build ./smoke-build/ktx-smoke %files %license LICENSE.md NOTICE.md LICENSES/Apache-2.0.txt LICENSES/BSD-1-Clause.txt LICENSES/MIT.txt %doc README.md %{_libdir}/libktx.so.4* %files devel %{_includedir}/ktx.h %{_includedir}/KHR/khr_df.h %{_libdir}/libktx.so %{_libdir}/cmake/ktx/ %changelog %autochangelog