%global commit 7c8da66bc27cc5c4ccb6a0fa612f56c9417518ff %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commit_date 20170518 %global gitrel .%{commit_date}.git%{shortcommit} Name: spirv-tools Version: 2016.7 Release: 0.1%{?gitrel}%{?dist} Summary: API and commands for processing SPIR-V modules License: ASL 2.0 URL: https://github.com/KhronosGroup Source0: %url/SPIRV-Tools/archive/%{commit}.tar.gz#/%{name}-%{commit}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: python2-devel BuildRequires: python-simplejson BuildRequires: spirv-headers-devel %description The package includes an assembler, binary module parser, disassembler, and validator for SPIR-V.. %package devel Summary: Development files for %{name} %description devel The SPIR-V Tool library contains all of the implementation details driving the SPIR-V assembler, binary module parser, disassembler and validator, and is used in the standalone tools whilst also enabling integration into other code bases directly. %prep %autosetup -n SPIRV-Tools-%{commit} # Fix lib path for 64bit %if 0%{__isa_bits} == 64 sed -i -e 's@LIBRARY DESTINATION lib@LIBRARY DESTINATION lib64@g' source/CMakeLists.txt source/opt/CMakeLists.txt sed -i -e 's@ARCHIVE DESTINATION lib@ARCHIVE DESTINATION lib64@g' source/CMakeLists.txt source/opt/CMakeLists.txt %endif %build mkdir build pushd build %cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DSPIRV-Headers_SOURCE_DIR=%{_prefix} .. %{make_build} popd %install pushd build %{make_install} popd %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files devel %license LICENSE %doc README.md CHANGES %{_bindir}/spirv-as %{_bindir}/spirv-cfg %{_bindir}/spirv-dis %{_bindir}/spirv-lesspipe.sh %{_bindir}/spirv-opt %{_bindir}/spirv-stats %{_bindir}/spirv-val %{_includedir}/spirv-tools/ %{_libdir}/libSPIRV-Tools-opt.so %{_libdir}/libSPIRV-Tools.so %changelog * Thu Jul 13 2017 Leigh Scott - 2016.7-0.1.20170518.git7c8da66 - First build