%global commit 7251f3cb0f4db3f917006dcef44d8a719a5a2be8 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: spirv-llvm-translator Version: 13.0.0 Release: 0.5.git%{shortcommit}%{?dist} Summary: LLVM to SPIRV Translator License: NCSA URL: https://github.com/KhronosGroup/SPIRV-LLVM-Translator Source0: %{name}-%{shortcommit}.tar.xz Patch0: spirv-llvm-translator-building.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: llvm-devel BuildRequires: spirv-headers-devel %description Khronos LLVM to SPIRV Translator. This is a library to be used by Mesa for OpenCL support. It translate LLVM IR to Khronos SPIR-V. It also includes a standalone tool used for building libclc. %package devel Summary: Development files for LLVM to SPIRV Translator Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains libraries and header files for developing against %{name} %package tools Summary: Standalone llvm to spirv translator tool Requires: %{name}%{?_isa} = %{version}-%{release} %description tools This package contains the standalone llvm to spirv tool. %prep %setup -n %{name}-%{shortcommit} %patch0 -p1 -R %build %cmake -B "%{_vpath_builddir}" \ -GNinja \ -DLLVM_BUILD_TOOLS=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_RPATH:BOOL=";" #-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr %ninja_build -C "%{_vpath_builddir}" %install %ninja_install -C "%{_vpath_builddir}" %files %doc README.md %{_libdir}/libLLVMSPIRVLib.so.* %files tools %{_bindir}/llvm-spirv %files devel %dir %{_includedir}/LLVMSPIRVLib/ %{_includedir}/LLVMSPIRVLib/* %{_libdir}/libLLVMSPIRVLib.so %{_libdir}/pkgconfig/LLVMSPIRVLib.pc %changelog